My ray casting engine

A general chat area, here you can post anything that doesn't belong in another forum.
Post Reply
User avatar
K1n9_Duk3
Vorticon Elite
Posts: 913
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

My ray casting engine

Post by K1n9_Duk3 »

I wrote a little raycasting engine similar to the Wolf3D engine, and I'd like to know if this implementation runs fast enough to actually make a smooth little game out of it.

It would be nice if you could just check it out and tell me if it runs smooth on your pc or not (it's a win32 executable). I guess I won't use textured floors and ceilings in a game, because that really slows things down, but I'd like to know if it's stays around 55 fps or higher with textured walls and shading but no textured floors.

http://home.arcor.de/k1n9duk3/files/raycast.zip
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net
User avatar
_mr_m_
Vortimaestro
Posts: 432
Joined: Mon May 11, 2009 23:14
Location: Quetzalacatenango

Post by _mr_m_ »

I'm always skeptical of stuff like this, but when my virus scan came up clean I gave it a try.

Looks great!

It works perfectly on my system, with shading and floor/ceiling textures on.

I got 60fps the whole time running, and I had Outlook and Firefox running at the same time.

Although the CPU usage varied between 33-38%
Around a 30MB RAM usage.

I tested it on my laptop, with the following specs (That apply here):

Core2Duo T7500 @ 2.2GHz
Mobility Radeon 2600HD
2GB RAM (PC5300 @ 667 MHz)
"I just drew this stupid little fish." -- Tom Hall
Genius314
Vorticon Elite
Posts: 843
Joined: Thu Nov 01, 2007 0:13

Post by Genius314 »

Looks cool so far. I got 60fps, running in Ubuntu through WINE.
User avatar
K1n9_Duk3
Vorticon Elite
Posts: 913
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Post by K1n9_Duk3 »

First of all, thanks for the feedback.

It's good to hear that it works OK.

For the textured floors and ceiling, I tried to just go ahead and draw each pixel directly to the screen. But that turned out to be incredibly slow. I guess that's just the overhead that calling the function for almost every single pixel (around 64000 for this resolution) creates.

I am using a pixel buffer now, so that I can directly write the pixel data without calling any functions. But converting and then drawing that buffer takes some time, too.

I guess I could optimize this stuff a bit by using shift operations instead of division...
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net
Galaxieretter
Arachnut
Posts: 891
Joined: Thu Nov 01, 2007 2:35
Location: Lancaster PA
Contact:

Post by Galaxieretter »

I could of sworn I saw this somewhere before...
User avatar
K1n9_Duk3
Vorticon Elite
Posts: 913
Joined: Mon Aug 25, 2008 9:30
Location: Germany
Contact:

Post by K1n9_Duk3 »

Galaxieretter wrote:I could of sworn I saw this somewhere before...
What do you mean with this? The engine itself or a thread like "Hey, look what I've done!" ? :dopekeen
Hail to the K1n9, baby!
http://k1n9duk3.shikadi.net
Post Reply