• Welcome to Dark Bit Factory & Gravity.
 

FB Raycaster

Started by rdc, May 22, 2009

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rdc

I thought I would compare the C++ raycaster on Lode's site to the same prog in FB and I was actually surprised. The FB version is smaller than the C++ version. So much for thinking that the C++ version would be smaller. Here are the files in case you want to look at them. This is a straight conversion from the C code.

Pics:





Source file:

http://www.file-pasta.com/file/fbcaster.zip

Shockwave

The FB compiler is surprisingly efficient Rick.

Thanks for the link to the raycaster source too. This is a routine I have never ever written in my life, thought I have seen a few.
Shockwave ^ Codigos
Challenge Trophies Won:

Jim

#2
The fb compiler is good, but I also would think most C++ compilers would be able to beat it.

There could be two reasons for the code size difference.  One is that the C++ version is using SDL for its graphics library which is huge where the fb one is using fbgfx.bi which is tiny.  The second is what compiler options were used - fb doesn't really have many options so you get what you're given, but gcc and other C++ compilers have hundreds, including optimising for speed instead of optimising for size, removing debugging symbols, etc.

Was the C++ code compiled by you Rick - did you used Codeblocks?

<edit>Do they run about the same speed?  I suspect they do.

Jim
Challenge Trophies Won:

rdc

I did compile the code. I have Codeblocks setup to use GCC and I used whatever settings they already had in there, so I am sure that there are switches that could improve the C++ size.

The C++ version is a tad faster, probably due to the buffer updates. I am using just a for-next for the buffer update in the FB code. I am sure putting the screen code inline with the raycast would probably speed things up considerably.

Clyde

Ive tried the fb version, and it utterly rocks rdc.
memories flooding back of Wolfenstein.

Nice one.
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

rdc

Yeah, me too. It would be fun to make a look-a-like.

antarman

All links is dead!  :vangry:

Moroboshisan

#7
Quote from: antarman on August 19, 2010
All links is dead!  :vangry:

original sources still lives http://www.student.kuleuven.be/~m0216922/CG/index.html... You'll find the FB conversion by rdc attached here (src & bin).

Cheers.

antarman


Moroboshisan

Quote from: antarman on August 23, 2010
Thank you!  :updance:

you're welcome! ;-)

just my 2 cents... ^_^