It is currently Tue Nov 21, 2017 2:31 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 61 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
PostPosted: Wed Oct 18, 2017 6:00 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10117
Location: Rio de Janeiro - Brazil
tepples wrote:
If you want to do something like Mario Kart, make it more like Rad Racer along the lines of Sonic Drift for Game Gear.

That's been done before, so... not nearly as fun to make.


Top
 Profile  
 
PostPosted: Thu Oct 19, 2017 12:08 am 
Offline

Joined: Sun Mar 19, 2006 9:44 pm
Posts: 919
Location: Japan
There have been a couple F-Zero/MarioKart-like homebrew games on the MSX and Megadrive/Gen that do a blocky sort of "raycasting":

https://www.youtube.com/watch?v=B_towiGufz4

https://www.youtube.com/watch?v=7Nw3OL4-tw4

https://www.youtube.com/watch?v=Yt_He0Ep02o

_________________
http://www.chrismcovell.com


Top
 Profile  
 
PostPosted: Thu Oct 19, 2017 6:37 am 
Online
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1017
Location: Gothenburg, Sweden
Quote:
On an unrelated note, I thought of a way to make Mario Kart on the NES. It involves using less than 50% of the screen, CHR-RAM, much slower frame rate (maybe 15 fps), and raycasting. It would look crappy, but I think you could simulate mode7 style perspective.


Would chr-ram page toggling be helpful in this regard?

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


Top
 Profile  
 
PostPosted: Thu Oct 19, 2017 8:11 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10117
Location: Rio de Janeiro - Brazil
If I were implementing Mario Kart on the NES (there goes the topic...), here's what I'd try first:

- Use 4x4 software pixels, so that all possible pattern combinations fit in a constant set of 256 tiles, eliminating the need for slow CHR-RAM manipulation;

- CHR bankswitching to separate the distant parallax layer from the road itself;

- Create look-up tables indicating the map coordinates of the contents of every on-screen pixel, relative to the player position, for all possible angles. That could end up being well over 100KB, but would eliminate the need for complex math: for each on-screen pixel, you'd add the relative coordinates to the player's position and use the result to read a color from the map, which may use tiling to save space;

- Objects/sprites would be drawn exactly like in a raycaster, possibly using logarithmic division and an arctangent look-up table to find the horizontal position of on-screen objects, and a multiplication is used to calculate their distances, and from that, their size.


Top
 Profile  
 
PostPosted: Thu Oct 19, 2017 10:23 am 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2136
Location: Minneapolis, Minnesota, United States
tokumaru wrote:
Use 4x4 software pixels, so that all possible pattern combinations fit in a constant set of 256 tiles, eliminating the need for slow CHR-RAM manipulation.


I wonder if it would work to use 2x8 software pixels and use timed code to reset the scroll every 2 scanlines to increase resolution... I think we had discussed this idea, or a similar one for raycasting a while back.

If I took a stab at it, I would do polygons with XOR filling in a window centered in the screen. My thought is that a wireframe racer would be doable; adding XOR filling could just be a step beyond (it's not always that simple to add filling, but if we assume just a single flat road, it should be rather simple). I wouldn't try to have too much detail on the road itself to increase frame rate. Could be pretty decent, or pretty terrible.


Top
 Profile  
 
PostPosted: Thu Oct 19, 2017 10:38 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1825
Location: DIGDUG
Quote:
There have been a couple F-Zero/MarioKart-like homebrew games on the MSX and Megadrive/Gen that do a blocky sort of "raycasting":

https://www.youtube.com/watch?v=B_towiGufz4

https://www.youtube.com/watch?v=7Nw3OL4-tw4

https://www.youtube.com/watch?v=Yt_He0Ep02o


Sadly, this is what I had in mind, and it does look kind of bad.

I don't like the 4x4 pixel idea, but I suppose it would fill the screen, whereas my idea of having rendering off for 50% of the frame to write 240 tiles worth...3840 writes, over 4 frames is 960 writes per frame...is a bit crazy.

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


Top
 Profile  
 
PostPosted: Thu Oct 19, 2017 10:56 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19238
Location: NE Indiana, USA (NTSC)
The third option is to prerender each frame of movement around the track and then have the camera move on rails. Toy Story Racer for Game Boy Color does this.


Top
 Profile  
 
PostPosted: Thu Oct 19, 2017 11:02 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10117
Location: Rio de Janeiro - Brazil
Celius wrote:
I wonder if it would work to use 2x8 software pixels and use timed code to reset the scroll every 2 scanlines to increase resolution... I think we had discussed this idea, or a similar one for raycasting a while back.

Yeah, that could probably be done to improve the resolution, but it may impact the performance quite a bit. Using a lower resolution not only makes things easier to display on the NES, but it also reduces the amount of calculations you have to do in order to render a scene and the amount of data that has to be transferred to VRAM. 4x4 software pixels would look like the second video Chris posted, which is more than acceptable considering it's the NES doing it in software. Drawing interesting tracks using only 4 colors would be a challenge, though... more colors could be simulated with dithering, but then the combinations won't fit in 256 tiles anymore. Maybe the maps can be designed to not have more than 4 colors visible at a time, so the palette could change on the fly.

I feel like a higher frame rate is more important then resolution in a game like this, and since this is the NES we're talking about, there will have to be compromises.

dougeff wrote:
my idea of having rendering off for 50% of the frame to write 240 tiles worth...3840 writes, over 4 frames is 960 writes per frame...is a bit crazy.

The problem is not so much transferring that data to the PPU, but calculating those 4KB of data. You most likely won't get a playable frame rate if you need to generate and transfer a full pattern table for every game frame.


Top
 Profile  
 
PostPosted: Thu Oct 19, 2017 1:17 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1825
Location: DIGDUG
Quote:
The problem is not so much transferring that data to the PPU, but calculating those 4KB of data. You most likely won't get a playable frame rate if you need to generate and transfer a full pattern table for every game frame.


TG16/PCE could do it. Its processor is much faster.

Of course the "cool factor" is getting a worse system to do it.

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


Top
 Profile  
 
PostPosted: Thu Oct 19, 2017 3:51 pm 
Offline
User avatar

Joined: Wed Feb 13, 2008 9:10 am
Posts: 582
Location: Estonia, Rapla city (50 and 60Hz compatible :P)
PCE also has no restrictions to VRAM access, you can write stuff as fast as you can and anytime during the display. CPU is unable to use of all of the available VRAM bandwidth and there's no DMA device to do it either, similar problem to SMS/GG which have much more bandwidth than CPU can use up on its own. MD and SNES add DMA that can use up all the bandwidth available.

_________________
http://www.tmeeco.eu


Top
 Profile  
 
PostPosted: Thu Oct 19, 2017 6:31 pm 
Offline

Joined: Sun Mar 19, 2006 9:44 pm
Posts: 919
Location: Japan
dougeff wrote:
TG16/PCE could do it. Its processor is much faster.


Well, I did program my own simplified version for the PCE. :)

https://www.youtube.com/watch?v=HEp7niIP4Qw

_________________
http://www.chrismcovell.com


Top
 Profile  
 
PostPosted: Thu Oct 19, 2017 8:41 pm 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1825
Location: DIGDUG
See, that proves my point. That looks beautiful. An NES version would look like Space Invaders by comparison.

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


Top
 Profile  
 
PostPosted: Fri Oct 20, 2017 9:31 am 
Offline
User avatar

Joined: Sun Jun 05, 2005 2:04 pm
Posts: 2136
Location: Minneapolis, Minnesota, United States
tokumaru wrote:
I feel like a higher frame rate is more important then resolution in a game like this, and since this is the NES we're talking about, there will have to be compromises.


I would agree about frame rate being a higher priority. I would try to find a balance between resolution and complexity of textures to increase speed. I'm not a fan of complicated textures at low resolution anyway (that's why I think a lot of games on PS1 looked so bad). If you did some sort of polygon method, you could make basic shapes with solid colors, like the road with gray, grass with green, water with blue... Essentially if you can find where to draw the corners of the shapes on the screen, just connect those points with line drawing code and XOR fill.

The nice thing also about filling polygons with XOR filling is that it simplifies the line drawing code. You don't need to draw a line like this:

Code:
-------X
-------X
------X-
------X-
-----X--
-----X--
----X---
----X---


It only requires 1 pixel to be set per column of pixels:

Code:
-------X
--------
------X-
--------
-----X--
--------
----X---
--------


This speeds up line drawing tremendously. The more I think about this, the more I want to try this out and see how it looks!


Top
 Profile  
 
PostPosted: Sun Oct 22, 2017 4:12 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3950
Split the mario kart stuff?

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Sun Oct 22, 2017 5:31 pm 
Offline
User avatar

Joined: Sat Feb 16, 2013 11:52 am
Posts: 223
feels like the discussion got derailed away already, nesdev style, but here's a compilation of Family BASIC games video(s):

https://www.youtube.com/watch?v=AD0DNX1RIkA

No idea if they're from the time period or new stuff though

_________________
This is a block of text that can be added to posts you make. There is a 255 character limit.


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: Garth and 5 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