Author Topic: FB Raycaster  (Read 5980 times)

0 Members and 1 Guest are viewing this topic.

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
FB Raycaster
« on: May 22, 2009 »
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

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17409
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: FB Raycaster
« Reply #1 on: May 23, 2009 »
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:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: FB Raycaster
« Reply #2 on: May 24, 2009 »
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
« Last Edit: May 24, 2009 by Jim »
Challenge Trophies Won:

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: FB Raycaster
« Reply #3 on: May 24, 2009 »
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.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: FB Raycaster
« Reply #4 on: May 27, 2009 »
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:

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: FB Raycaster
« Reply #5 on: May 28, 2009 »
Yeah, me too. It would be fun to make a look-a-like.

Offline antarman

  • ZX 81
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: FB Raycaster
« Reply #6 on: August 19, 2010 »
All links is dead!  :vangry:

Offline Moroboshisan

  • Senior Member
  • Amiga 1200
  • ********
  • Posts: 454
  • Karma: 18
  • C=64
    • View Profile
Re: FB Raycaster
« Reply #7 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.
« Last Edit: August 19, 2010 by Moroboshisan »

Offline antarman

  • ZX 81
  • *
  • Posts: 3
  • Karma: 0
    • View Profile
Re: FB Raycaster
« Reply #8 on: August 23, 2010 »
Thank you!  :updance:

Offline Moroboshisan

  • Senior Member
  • Amiga 1200
  • ********
  • Posts: 454
  • Karma: 18
  • C=64
    • View Profile
Re: FB Raycaster
« Reply #9 on: August 23, 2010 »
Thank you!  :updance:

you're welcome! ;-)

just my 2 cents... ^_^