It is currently Sun May 26, 2019 2:34 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Wed Jan 02, 2019 2:59 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2510
Location: DIGDUG
This is my "what if F-zero or Mario Kart were made in 1985" idea. About 1 year of planning and about 2 days of actual programming.

https://youtu.be/vn7xwTau7s0

I was only able to calculate half of the road per frame... and still have enough frame left to play music and move some sprites (later). It would probably look better with a much bigger racetrack.

Edit, changed title.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Wed Jan 02, 2019 3:37 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11357
Location: Rio de Janeiro - Brazil
Interesting! Reminds me of this: https://youtu.be/7Nw3OL4-tw4

But the resolution is way too low... Do you think you can improve it and still have it run smoothly?


Top
 Profile  
 
PostPosted: Wed Jan 02, 2019 4:20 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2510
Location: DIGDUG
I was going to do a second pass over the data and do a "smoothing", and that pass could put edges as well... but I don't think I have the processing time. Currently it takes a (worse case scenario) 200 scanlines to process 1/2 of the picture.

I would have to drop down to 15 fps to do much more.


Unrelated, I could make a nice scrolling text demo, or scrolling logo / title screen with this method.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Wed Jan 02, 2019 4:27 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21401
Location: NE Indiana, USA (NTSC)
What frame rate does F-FF run at?

_________________
Pin Eight | Twitter | GitHub | Patreon


Top
 Profile  
 
PostPosted: Wed Jan 02, 2019 4:31 pm 
Offline
User avatar

Joined: Fri Nov 12, 2004 2:49 pm
Posts: 7711
Location: Chexbres, VD, Switzerland
I hate to be negative when criticising, especailly after all the effort you put into this project. However this really looks awful. Rendering is inapropriate for racers as it's way too slow. Simulate a pre-rendered road by distorting it is the standard way to do it. Look at Rad Racer, it actually looks quite good and convincing. I was expecting something like that when I clicked on the link. So yeah... that's what a Mario Kart or F-Zero would have looked like on the NES.

Sure Rad Racer uses the MMC1, which is a "special chip", but actually it doesn't use much of the chip, and it uses it mainly for extra memory, so if the game was single-level it could have fitted a NROM cart easily. For a NROM racer from 1985, look at F1-Race (the road is only distorted horizontally, not vertically, as it probably wasn't understood how to do this with the NES at this date).


Top
 Profile  
 
PostPosted: Wed Jan 02, 2019 4:37 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 8372
Location: Seattle
Yeah, but we already have seen dozens of instances of using raster effects to fake 3d.


Top
 Profile  
 
PostPosted: Wed Jan 02, 2019 4:39 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11357
Location: Rio de Janeiro - Brazil
Bregalad wrote:
Simulate a pre-rendered road by distorting it is the standard way to do it.

The standard way is also the boring way. I'd rather see something unique, even if it doesn't look great.


Top
 Profile  
 
PostPosted: Wed Jan 02, 2019 5:27 pm 
Offline
User avatar

Joined: Thu Aug 13, 2015 4:40 pm
Posts: 405
Location: Rio de Janeiro - Brazil
I thought it looked great. I mean, afaik dougeff isn't an artist, I'm talking about the programming of the thing. It looks like real mode 7, at low resolution, ok.

I think one improvement that may be simple to add is to add different tiles depending on depth (screen y coordinate, really). It can be used to simulate distance.

_________________
https://twitter.com/bitinkstudios <- Follow me on twitter! Thanks!


Top
 Profile  
 
PostPosted: Wed Jan 02, 2019 5:41 pm 
Offline
User avatar

Joined: Thu Mar 31, 2016 11:15 am
Posts: 514
tepples wrote:
What frame rate does F-FF run at?

30 FPS for 1 player, 20 for 2 players

Quote:
I think one improvement that may be simple to add is to add different tiles depending on depth (screen y coordinate, really). It can be used to simulate distance.

Oh yeah and attributes + a few palettes are trivial for this effect too.


Top
 Profile  
 
PostPosted: Wed Jan 02, 2019 5:56 pm 
Offline

Joined: Fri Feb 24, 2012 12:09 pm
Posts: 900
dougeff wrote:
This is my "what if F-zero or Mario Kart were made in 1985" idea. About 1 year of planning and about 2 days of actual programming.
https://youtu.be/vn7xwTau7s0

That looks a bit blocky.
If you are already overloading the CPU with 16x16 "pixels" then I am wondering if you are using loads of multiplications or divisions per pixel?
Essentially, a scanline should be rendered by computing the x/y source steps, and then reading the source data with that steps (ie. using only step additions for the source coordinates, no multiplications or divisions within scanlines).
For the separate lines, I think you could re-use the same x/y steps, multiplied by a scaling factor for the distance. So there isn't too much complicated maths required, the main bottleneck would be reading source pixels, merging them to bitplanes, and writing to VRAM.
When using a huge ROM you could store the source data as uncompressed bitmap with 1 byte per pixel - of course that would have been expensive in 1985, and the required bank switching could also slowdown things, so you might find a better & cheaper way.


Top
 Profile  
 
PostPosted: Wed Jan 02, 2019 6:23 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 2510
Location: DIGDUG
Quote:
16x16


8x8. It just doesn't use the whole screen. The final picture is 20x20 tiles. I tried 22, but it was too slow.

Quote:
loads of multiplications or divisions per pixel


Pre calculated LUT of sine and cosine for every 3° at 10 different distances. Each pixel is added to a base x,y (2 16-bit adds), and then indexed on a map.

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Wed Jan 02, 2019 7:01 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 11357
Location: Rio de Janeiro - Brazil
dougeff wrote:
Pre calculated LUT of sine and cosine for every 3° at 10 different distances. Each pixel is added to a base x,y (2 16-bit adds), and then indexed on a map.

I have considered doing floor casting that way in my raycaster, but combined with wall texturing that would've been insanely slow. So I settled for blocky floors instead, because instead of doing calculations for every screen pixel, I only need calculations between block boundaries in the map.

If you don't need too much detail on the floor (based on your test map it doesn't look like you do), you might be able to get away with checking only grid boundaries too. That should result in a decent speed bump, probably enough to increase the resolution.


Top
 Profile  
 
PostPosted: Wed Jan 02, 2019 7:33 pm 
Offline

Joined: Fri Feb 24, 2012 12:09 pm
Posts: 900
No, I meant 16x16 tiles, aka 16x16 low-resolution pixels. Oh, or is it even 20x20? Excluding the sky, that would be 20x10, or 200 pixels per frame.
So you would need 400 additions, and indexing for 200 pixels and a few dozen multiplications per frame.
I think you could reach maybe around 100 frames per second at that resolution.
But the framerate would drop rapidly when increasing the resolution, unless you drop the per pixel texturing.
With filled shapes you might get similar quality as what you have now, but at much higher resolution.

Not sure about NES, but home computers did have some 3D games, like Elite, Mercenary, Driller. And I think there's also Doom for the Spectrum.
The advantage on NES is that it's about twice as fast as C64, so I am wondering if it could render some impressive graphics at not so bad framerate.


Top
 Profile  
 
PostPosted: Thu Jan 03, 2019 2:42 am 
Offline
Formerly WheelInventor
User avatar

Joined: Thu Apr 14, 2016 2:55 am
Posts: 2019
Location: Gothenburg, Sweden
I think this is pretty cool! Honestly, the resolution is enough for it to be playable. If you somehow can get it up or smooth the edges with diagonal boundary tiles to make it seem like it has better resolution (the smoothing doesn't need to be meticulous either as long as it doesn't lie about the position of the boundary too much), that's a bonus. But you could probably work with this.

The obvious advantage of this method is that you can create tracks very freely, including sharp turns and intersecting paths. It offers something you can't do for the game design with raster effects alone.

It could also work for maze crawlers and tank games (with seethrough walls). I mean you could simply avoid the natural ideal and go for something more TRON-y, or assume the player has a birds eye viewpoint above hedges/walls.

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Thu Jan 03, 2019 3:15 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 4077
Location: A world gone mad
Surprised not a single person here has mentioned RoadBlasters from Tengen/Beam Software. Like Rad Racer, it also uses MMC1 (in this case, 128KB PRG + 128KB CHR). I'm going off of memory so there's a large chance I'm remembering things wrong, but I think it used precisely-timed PPU writes and reads and/or certain bits in in HBlank, combined with palette cycling and a lot of CHR swapping to give the impression of road movement, plus providing a horizon. There's similarities in the implementation model to Rad Racer and Rad Racer 2, but the result is a lot more impressive given all the other stuff going on. Consider that it's an arcade port as well (and yes, the surrounding environment does have that palette cycling effect even on the arcade).

If you haven't played this game (or at least checked it our in general), I recommend doing so.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 44 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group