Five clock per pixel RLE mode

Topics related to the API, programming discussions & questions, coding tips, bugs, etc. should go here.
CunningFellow
Posts: 1174
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Five clock per pixel RLE mode

Post by CunningFellow » Tue Dec 05, 2017 5:13 am

D3thAdd3r,

There is a patch to cuzebox to allow it to run in the emulator. I failed at patching Uzem though. I don't know what I did wrong there as I did originally write the patch for Uzem that allowed interrupt ended scanlines while developing T2K.

Here is a Uze file you can put on real hardware though.

I think I have settled on what game I am going to use this mode for. Super Hexagon just seems easier at the moment. I want to get the game over and done with at least semi fast as I have an idea for a REALLY amazing new video mode after this one.
Attachments
RLE_Easy_C_Lines.uze
(11.54 KiB) Downloaded 93 times

CunningFellow
Posts: 1174
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Five clock per pixel RLE mode

Post by CunningFellow » Fri Dec 08, 2017 10:21 pm

These are still not being calculated by the AVR. I am doing things on a spread sheet so I can visually see the workings of the maths I am doing. This is to make sure the 8bit * 8:8bit from precalculated sin/tan tables works as expected. The maths is very simple. Only an 8x16 mulitply and a few adds per line so there should be no problem for the AVR to do a few 100 of them per 1/60th of a second.

But this is what a coloured hexagon that uses 16 of the available 255 lines looks like. (Uze file and a JPG)
Attachments
RLE_Static_Hexagon.jpg
RLE_Static_Hexagon.jpg (20.73 KiB) Viewed 2810 times
RLE_Static_Hexagon.uze
(11.72 KiB) Downloaded 93 times

User avatar
Artcfox
Posts: 944
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Five clock per pixel RLE mode

Post by Artcfox » Sat Dec 09, 2017 4:51 am

Even though I'm guessing that this game will be super hard for me to play, I'm really looking forward to it!

I think maybe an actual SNES paddle-type controller might be really awesome to use for it.

User avatar
D3thAdd3r
Posts: 2422
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Five clock per pixel RLE mode

Post by D3thAdd3r » Sat Dec 09, 2017 7:05 pm

I messed around with a driver for an N64 controller but never finished it. The protocol was fairly simple, and even someone managed to do all the timing(which is relatively fast compared to SNES) without assembly for some Arduino N64 controller reader. That honestly seems about the easiest possible way to get some sort of analog input. Playstation dual shock types are nice too, but that needs separate hardware for the pins. A bit off topic, but I really would like to see an analog solution some day at least, if not also a rotary one for things like T2k and others.

User avatar
D3thAdd3r
Posts: 2422
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Five clock per pixel RLE mode

Post by D3thAdd3r » Sat Dec 09, 2017 7:09 pm

Also wondering what this mode might be able to realize for a real game. I bet quite a lot, and something that would be visually over the top. For flat polygons, at least for 3d stuff, it almost seems a double edged sword versus wireframe. Filled looks better than wireframe, but requires hidden surface removal AFAIK, something that seems quite complex to pull off without something like a Z buffer(requiring gobs of ram). This could be cool for a raycaster maybe, where depth information can be inherent in the rendering code without requiring an extra step. By raycaster even not what has so far been demonstrated(all same height walls), but even perhaps raised floors/ceilings approaching more Doom like geometry instead of Wolfenstein.

CunningFellow
Posts: 1174
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Five clock per pixel RLE mode

Post by CunningFellow » Sat Dec 09, 2017 10:50 pm

Artcfox wrote:
Sat Dec 09, 2017 4:51 am
Even though I'm guessing that this game will be super hard for me to play, I'm really looking forward to it!
Hexagon is hard. My best time is under 40 seconds.

https://terrycavanaghgames.com/hexagon/

And I generally like games that are "polar" or spinny-aroundy.
D3thAdd3r wrote:
Sat Dec 09, 2017 7:09 pm
Also wondering what this mode might be able to realize for a real game. I bet quite a lot, and something that would be visually over the top.
3D games like Elite are possible. Probably also the freescape games like Driller and Total Eclipse. A reduced polygon and no bitmap version of Starfox even maybe. Carrier Command, Starglider, X-Wing I would say not possible.

You could have a car racing game with no limits on what the track looked like but would be limited to square cars. Maybe not at free form as Hard Drivin' but more appealing than Pole-Position on the 2600.

Stun Runner maybe.

The Sentinel maybe.

My favorite game of all time Virus/Zarch sadly a big NO.

If you are happy to rely on the SD card for holding pre-calculated moves and polygon descriptions, then Virtua Fighter minus bitmaps could be on the cards.
D3thAdd3r wrote:
Sat Dec 09, 2017 7:09 pm
For flat polygons, at least for 3d stuff, it almost seems a double edged sword versus wireframe. Filled looks better than wireframe, but requires hidden surface removal AFAIK, something that seems quite complex to pull off without something like a Z buffer(requiring gobs of ram).
If you don't have gobs of RAM you need to mathematically work out the intersection of lines. This mode already has the major cost of that as a requirement. Working out the gradient of the line. You need to go from (X1, Y1), (X1, Y2) to Y=MX+C for the mode to work in the first place. And from my brief calculations as long as lines are longer than about 15 pixels then this mode is faster than mode6 where you have to plot each pixel.

Also games like Elite intentionally drew the spaceships like wedges of cheese. This is so the back surfaces can get removed from just calculating the normal. So a single ship can get drawn without having to do ANY line intersection code for hidden surface. You only need to do that if you have 2 or more ships overlapping. And bounding boxes help there.

CunningFellow
Posts: 1174
Joined: Mon Feb 11, 2013 8:08 am
Location: Brisbane, Australia

Re: Five clock per pixel RLE mode

Post by CunningFellow » Wed Dec 13, 2017 5:10 am

This is doing some math. It will be mostly look up tables when I think about it some more.

By the looks of it will have no problem with speed in the game :)

Again UZE will run on real hardware OR a patched cuzebox.
Attachments
RLE_Movement.uze
(11.7 KiB) Downloaded 95 times

User avatar
Artcfox
Posts: 944
Joined: Thu Jun 04, 2015 5:35 pm
Contact:

Re: Five clock per pixel RLE mode

Post by Artcfox » Wed Dec 13, 2017 5:32 am

CunningFellow wrote:
Wed Dec 13, 2017 5:10 am
This is doing some math. It will be mostly look up tables when I think about it some more.

By the looks of it will have no problem with speed in the game :)

Again UZE will run on real hardware OR a patched cuzebox.
Woah! This is super-awesome, and looks like it will be extremely fast. I really should patch my Android version of CUzeBox so it can run this video mode.

User avatar
Jubatian
Posts: 1355
Joined: Thu Oct 01, 2015 9:44 pm
Location: Hungary
Contact:

Re: Five clock per pixel RLE mode

Post by Jubatian » Thu Dec 14, 2017 5:48 pm

Pretty smooth! I think I will do the UART emulation before the end of the year so this will work proper (and D3thAdd3r's ESP8622 work then could be also merged in at a further point).

User avatar
uze6666
Site Admin
Posts: 4449
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Five clock per pixel RLE mode

Post by uze6666 » Sun Aug 12, 2018 3:12 am

I'm being late, but this is really impressive and the use of the UART interrupt is clever, why didn't I think of it! Really hope something comes out of this video mode. I can totally see streaming line/polygon coordinates from the sd card for very impressive animations. :P

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests