Raycaster Experiment

Use this forum to share and discuss Uzebox games and demos.
Post Reply
blue_knight
Posts: 48
Joined: Sun Dec 06, 2009 8:08 am

Raycaster Experiment

Post by blue_knight »

I've been up all night, two people in my family have the flu. Anyway I decided to spend this time and take a break from my other projects and try out my raycasting experiment on the Uzebox. I decided to start by running mode 8 and get the raycasting and column building done itself. This limits the resolution, color depth and takes up a lot of memory that I don't need, as well as extra overhead (putpixel for example) - but I can get the raycasting working before actually working on the column renderer. Anyway due to the overhead and memory limitations, I couldn't quite fill the screen but with a custom video mode I'm convinced that it is actually practical. Here is some early, test screenshots:

Image Image

I can save an extra 30+ cycles per pixel, 3K ram and do work in the 11 cycles per pixel that is currently done in C in the app. So I should be able to render the entire screen, add the full color range back, depth cueing, independent wall colors and maybe even add texturing. :)

Just to be clear, this already supports smooth rotation (256 angle increments) and smooth movement. It also supports looking up and down (using the fake skewing/translation effect as seen in Dark Forces and Duke Nukem 3D) and could easily support jumping and crouching. Each wall (even column) can be a different color, except for the mode 8 color limitations which will be fixed by the custom video mode - which is why there are only 2 wall colors (the other 2 colors are used for the floor and ceiling).

I'm still going to finish Zelda 2, this is just me getting to know the hardware better. If this goes well, maybe I'll do an FPS or maze game/RPG next before doing the Zelda 2 sequels. :)
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Raycaster Experiment

Post by D3thAdd3r »

Nice! Very cool and ambitious concept. If you can pull off texture mapping I will likely pee a little. But failing that what about using some kind of alternating stippling on the walls/floor with spacing in relation to distance? That might work well to convey distance plus no texture look up. Please post a hex, then immediately finish Zelda 2 :P
blue_knight
Posts: 48
Joined: Sun Dec 06, 2009 8:08 am

Re: Raycaster Experiment

Post by blue_knight »

D3thAdd3r wrote:Nice! Very cool and ambitious concept. If you can pull off texture mapping I will likely pee a little. But failing that what about using some kind of alternating stippling on the walls/floor with spacing in relation to distance? That might work well to convey distance plus no texture look up. Please post a hex, then immediately finish Zelda 2 :P
I already plan on "depth cueing", which is basically fading a column based on distance - essentially a fog effect. Stippling instead of textures might be useful as well if full textures are too slow.

As for a hex, I'll wait on that until I finish the video mode and get it rendering to the entire screen. That will also allow me to make walls different colors and get the depth cueing in.
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Raycaster Experiment

Post by uze6666 »

Awesome work! Funny, I was fiddling too with raycasting principle before Christmas and considered a custom video mode, but then I could not find any fast way to add "sprites"... I'm curious to see you progress o this one.

-uze
blue_knight
Posts: 48
Joined: Sun Dec 06, 2009 8:08 am

Re: Raycaster Experiment

Post by blue_knight »

I was cleaning up some precision issues and decided to try out texture mapping. Textures are 16x16, for the test I just made some cheesy checkboard textures because I'm still using Mode 8. Notice perspective and scale is handled properly. You can see the textures in action below:

Image Image

And this image shows looking up:
Image

Fortunately I was able to add the texture mapping without reducing the screen area. This bodes well for the final video mode. I might even be able to get floor and ceiling textures! (no promises).
Anyway, next up is the video mode work. So next time you'll hopefully see much fuller and more colorful images. :)

Edit: I decided to modify the textures so they weren't pure checkboards, to help illustrate that they are real textures:

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

Re: Raycaster Experiment

Post by D3thAdd3r »

Texture mapping on Uzebox and it's good, this really amazes me! Do you have some kind of system/idea to handle wolfenstein type doors? In the new video mode if there was some advantage to not drawing some top and bottom pixels that would look really good in a wide screen setup. Can't wait to see it in motion keep up the good work.
blue_knight
Posts: 48
Joined: Sun Dec 06, 2009 8:08 am

Re: Raycaster Experiment

Post by blue_knight »

D3thAdd3r wrote:Texture mapping on Uzebox and it's good, this really amazes me! Do you have some kind of system/idea to handle wolfenstein type doors? In the new video mode if there was some advantage to not drawing some top and bottom pixels that would look really good in a wide screen setup. Can't wait to see it in motion keep up the good work.
Thanks. :)

I'm planning on having a status bar on the bottom, like Wolfenstein and Doom, so that will save me some time. Honestly, though, all the "vram" data is stored per-column, so the number of rows is less important than the number of columns. The raycasting work is done per column as well so saving rows won't actually help much. As for doors, I haven't looked into that yet, I think I'll tackle sprites first.

The plan is to put together a demo and release the source when the video mode is done. Then Uze6666 can make it an official video mode if he wants. I think the demo will have a single level with a dungeon theme, sort of like Arena, and you'll play a wizard that casts fireballs at simple enemies like bats, spiders and skeletons. The most challenging part will be sprites, but I have a plan for that too. :D

Once Zelda 2 is done, I'll probably do a full blown 3D RPG (like Arena) or FPS (like Wolfenstein). Then I'll go back to the trilogy, but with a much better understanding of the technology so I can probably make the next zelda games much better. :twisted:
User avatar
D3thAdd3r
Posts: 3221
Joined: Wed Apr 29, 2009 10:00 am
Location: Minneapolis, United States

Re: Raycaster Experiment

Post by D3thAdd3r »

Now I want to see a doom shotgun on the bottom of that screen :lol:
User avatar
paul
Posts: 457
Joined: Sat May 02, 2009 8:41 am
Location: Brisbane, Australia

Re: Raycaster Experiment

Post by paul »

Awesome, can't wait for the demo!
User avatar
uze6666
Site Admin
Posts: 4801
Joined: Tue Aug 12, 2008 9:13 pm
Location: Montreal, Canada
Contact:

Re: Raycaster Experiment

Post by uze6666 »

:shock:

Wow, if you can pull that one off, I'll make it a standard mode for sure!!!

-Uze
Post Reply