Another Raycasting Demo

A place where you can keep others updated about your NES-related projects through screenshots, videos or information in general.

Moderator: Moderators

Celius
Posts: 2158
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Re: Another Raycasting Demo

Post by Celius »

Bregalad wrote:Now please don't hate me for this I was just trying to be realistic. For a tech demo this is awesome, in a game it'd be really terrible.
I definitely understand. Come to think of it, I had a hard enough time playing Doom 1, and that was on PC, and went way beyond normal raycasting. Perhaps it'd be entertaining for like 1 level, but sitting down to a full blown game could be exhausting. Probably the only people that would want to play it are really hard core, old school FPS players. And masochistic gamers who like to be tortured by insanely hard games.
...or that 3D train minigame in Final Fantasy 6 when exiting the magitek factory, that also looked absolutely terrible
OK now, both of our demos look way better than that piece of shit! =) The game had no excuse displaying something that awful; they could have done much better.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Another Raycasting Demo

Post by Bregalad »

tokumaru wrote:None of us expects to make the ultimate NES game, but bringing something new to the platform is always fun, even if it's not perfect.
I absolutely agree with you. It's really great you guys can bring something new, I am not denying that. I'd just that that the idea to base an entiere game in those graphics mode would be a terrible idea.
OK now, both of our demos look way better than that piece of shit! =) The game had no excuse displaying something that awful; they could have done much better.
Well I don't remember exactly but I remember it was looking absolutely terrible. Even back in 1994 it would not have been impressive I think.
Probably the only people that would want to play it are really hard core, old school FPS players. And masochistic gamers who like to be tortured by insanely hard games.
I don't think the usage of such a pseudo-3D raycasting is automatically restricted to FPS. Think how it could just be that "different" level in an otherwise 2D game. Even if it was just a room to explore or something. It could suit lots of different games, RPG, platformers or even investigation games.

In Portopia (that investigation game Enix made before Dragon Quest) there is a giant 3D maze, and you have to traverse it at least once entirely to beat the game. Because you can only advance one "section" at once and do 90° turns, this part has aged extremely badly and looks terrible. However, if it was remade with a raycaster, this part of the game would be much better.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Another Raycasting Demo

Post by tepples »

Or do outdoor scenes in an overhead view and indoor scenes with the raycaster, like in Phantasy Star for Sega Master System or Jurassic Park for Super NES.
Celius
Posts: 2158
Joined: Sun Jun 05, 2005 2:04 pm
Location: Minneapolis, Minnesota, United States
Contact:

Re: Another Raycasting Demo

Post by Celius »

Bregalad wrote:I don't think the usage of such a pseudo-3D raycasting is automatically restricted to FPS. Think how it could just be that "different" level in an otherwise 2D game. Even if it was just a room to explore or something. It could suit lots of different games, RPG, platformers or even investigation games.
You know, this could make a lot of sense in something like my Castlevania style game (not yet in development). While it's normally a platformer, it could be cool for the player to have to go through some catacomb style maze to get to another area. I had wanted to put some other fake 3D effects in the game, so it would lend itself well to this.
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Another Raycasting Demo

Post by Bregalad »

I really want to play that game, even if you didn't start yet to develop it :)
tomaitheous
Posts: 592
Joined: Thu Aug 28, 2008 1:17 am
Contact:

Re: Another Raycasting Demo

Post by tomaitheous »

I saw this in the side link bar: https://www.youtube.com/watch?v=ZQRFBmGdvUQ
Might be able to do something like that (an adventure game or 3D town for an RPG, etc).
__________________________
http://pcedev.wordpress.com
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Another Raycasting Demo

Post by tokumaru »

tomaitheous wrote:I saw this in the side link bar: https://www.youtube.com/watch?v=ZQRFBmGdvUQ
This looks surprisingly good... I'd expect the cardboard cutout effect to be more distracting, but it actually feels like you're walking around in a town. What is distracting though is that it feels like you're a giant, because the textures are all centered on the horizon. I know it needs more computation, but the walls really need to be shifted up according to their distance so that the player doesn't appear to be so tall.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Another Raycasting Demo

Post by tepples »

What takes more CPU time: casting the ray for each pixel column or drawing the textures? Because if the ray casting itself takes a lot of time, I think I know how to speed it up with a run-length technique related to portal engines. Ray casting itself is just a special case of portal casting.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Another Raycasting Demo

Post by tokumaru »

tepples wrote:What takes more CPU time: casting the ray for each pixel column or drawing the textures?
From my own experience, scaling the textures is slightly slower, but the 2 tasks were balanced enough that casting a long ray and drawing a small wall wasn't that much different than casting a short ray and drawing a big wall, which kept the performance somewhat constant.
Because if the ray casting itself takes a lot of time, I think I know how to speed it up with portals.
I guess it's still worth speeding up, even if it's not the slowest task. I remember reading about how Doom used BSP (binary space partitioning) for rendering its graphics but I never really understood how that worked. What's the portals approach like?
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Another Raycasting Demo

Post by tepples »

RLE ray casting starts with a visible sector with a left and right side. You scan the visible sector in strips from nearest to farthest. When you hit a wall, you schedule the wall to be drawn, and then you divide the visible sector into the interval to the left of the tile and the interval to its right. After you've finished enumerating all walls in this strip, you scan the next farther strip. Repeat until all visible sectors have been cleared.
portalcasting.png
portalcasting.png (1.74 KiB) Viewed 10887 times
  • Orange: Sides of initial visible sector
  • Green: Visible wall segments
  • Blue: Floor within visible area
  • Light gray: Sides of subsectors
  • Light blue: Subsector sides extended toward camera origin
  • Black: Floor areas that are skipped
The difference here is that each cell in the map is visited once, not once for each pixel column that intersects it. And for the typical 90 degree FOV, you'll never have more intervals active at once than max(width, height) of your map.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Another Raycasting Demo

Post by tokumaru »

Sounds interesting, but I didn't quite understand it yet. I'm a little confused when you talk about nearest and farthest strips... Is a "strip" in this case the same as a wall strip, which is painted with a scaled texture in the end? How do I know which one is the nearest before casting a ray? And how would I go about deciding which texture column to use for each screen column if I don't have rays hitting them at coordinates I can check?
tomaitheous
Posts: 592
Joined: Thu Aug 28, 2008 1:17 am
Contact:

Re: Another Raycasting Demo

Post by tomaitheous »

tepples wrote:RLE ray casting starts with a visible sector with a left and right side. You scan the visible sector in strips from nearest to farthest. When you hit a wall, you schedule the wall to be drawn, and then you divide the visible sector into the interval to the left of the tile and the interval to its right. After you've finished enumerating all walls in this strip, you scan the next farther strip. Repeat until all visible sectors have been cleared.
portalcasting.png
  • Orange: Sides of initial visible sector
  • Green: Visible wall segments
  • Blue: Floor within visible area
  • Light gray: Sides of subsectors
  • Light blue: Subsector sides extended toward camera origin
  • Black: Floor areas that are skipped
The difference here is that each cell in the map is visited once, not once for each pixel column that intersects it. And for the typical 90 degree FOV, you'll never have more intervals active at once than max(width, height) of your map.
I think I follow you. But I'm not sure how to implement that, exactly. So once the ray hits that tiled block (wall/edge/whatever), you calculate angle of the wall, and render out that tile for that angle, then proceed to the next tiled block/wall the ray hits? Or at least, something along those lines? I wonder if that's what gasega68k did for his Wolfenstein 3D port for the Genesis.
__________________________
http://pcedev.wordpress.com
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Another Raycasting Demo

Post by tepples »

By "strips", I was referring to horizontal strips of potentially visible tiles in the map, colored dark blue in the illustration. "Nearest" is such a strip of tiles that is closest to the camera position (the intersection of the orange line segments). When facing north, the closest strip is the southernmost strip. The left and right side of each strip is determined by projecting the rays at the corners of already-drawn map tiles backward. When the camera is facing west or east more than north or south, use vertical strips in the map instead of horizontal strips in the map.

The procedure is sort of a hybrid between the ray casting of Wolf3D and the arbitrarily shaped sectors of Build, the Duke 3D engine.

Do I need to expand the illustration to an animated GIF of the entire rendering process, or produce a renderer myself in Python?
Drag
Posts: 1615
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: Another Raycasting Demo

Post by Drag »

I was wondering about the effectiveness of simplifying calculations by restricting angles?

For instance, a 90-degree restriction is fairly straightforward; all walls are box-shaped and you rotate at 90-degree angles. What if we did it at 30 degrees? Everything would turn at 30 degree increments, and all walls could only be at a 30 degree angle.

Maybe this offers no improvements, but it feels like you'd be able to calculate things a little faster and have smaller tables, or higher resolution tables.

Also, an animation would be helpful, Tepples. :P
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Another Raycasting Demo

Post by tokumaru »

tepples wrote:Do I need to expand the illustration to an animated GIF of the entire rendering process, or produce a renderer myself in Python?
Coding an example seems overkill if you don't plan on using it for a project of your own... but I'll definitely take you up on that GIF! =)
Post Reply