Author Topic: My first ray caster.  (Read 3638 times)

0 Members and 1 Guest are viewing this topic.

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
My first ray caster.
« on: September 27, 2010 »

Hello again!

I wrote my first ray casting engine yesterday. It is very slow and I plan to do a heavy overhaul on it.

Use the arrow keys to move around Fisheyecubeland. I actually like the fish eye distortion so I will probably not correct this.

The .exe is about 60 kb - Windows only right now.
Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: My first ray caster.
« Reply #1 on: September 27, 2010 »
It seems to be runing plenty fast on my computer. It could use some collision detection, but you probably already have that on your to-do. It has some serious fish eye when close to the outer walls, not sure if I like it or not, but it is different.

I just tried to compile it without having the console window and then upxed it. It came down to 48kb. I also tried to compile with console window and upx, and it came to the same. So I might be using another version of upx, or you could be using some other kind of exe compression software.

Offline LittleWhite

  • Senior Member
  • Amiga 1200
  • ********
  • Posts: 418
  • Karma: 31
  • It's me!
    • View Profile
Re: My first ray caster.
« Reply #2 on: September 27, 2010 »
Nice thing :)
I didn't see any weird effect at first glance, but after some time I saw it :D ( I always had problems with perspective )

After, on my computer, is not running slowly ... maybe you have a FPS counter, and that you see that you are slow for this number of materials, but otherwise ... it's not slow.

I hope you will continue on this, and send us how it is going :)
The demoscene will never die, never!

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
Re: My first ray caster.
« Reply #3 on: September 27, 2010 »

I might continue to toy around with this. I like that I can set the viewing angle to something absurd and it will render it with curves and such which is hard to model with standard polygons.

I guess it is not really slow for a computer program but my coding is pretty crude and it can defiantly be sped up. It is probably slow by ray casting engine standards. It is drawing 480 vertical scaled lines after all.

I may load a texture and create 64 -1 pixel slices of it and replace the lines with scaled 1 pixel wide textures.
Challenge Trophies Won:

Offline Jim

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 5301
  • Karma: 402
    • View Profile
Re: My first ray caster.
« Reply #4 on: September 27, 2010 »
It's colourful!  Are you using the 'tiny step so I don't miss any walls' method, or are you correctly skipping across the grid cells?
http://www.permadi.com/tutorial/raycast/rayc7.html - excellent tutorial.
It's not fast on my netbook (1.6GHz Atom).

Jim
Challenge Trophies Won:

Offline Pixel_Outlaw

  • Pentium
  • *****
  • Posts: 1382
  • Karma: 83
    • View Profile
Re: My first ray caster.
« Reply #5 on: September 28, 2010 »

I'm looping through all the walls and checking which sides need to be checked for collision. REALLY bad idea. I plan to depart from the traditional blocks however. I'm going to scrap my current "block" styled walls in favor of single lines that can be rendered from any angle. I'm going to break away from the grid soon. This was mostly to see if I have the concept right. 480 rays doing up to 2 exact collision checks per wall "cube" is a very very bad thing. This I realize.  :stirrer: I should have textures working soon. There is much to be done! I want to add some of those rotating scaled sprites too that always face the player. Mayhaps some pretty autumn trees?
« Last Edit: September 28, 2010 by Pixel_Outlaw »
Challenge Trophies Won:

Offline relsoft

  • DBF Aficionado
  • ******
  • Posts: 3303
  • Karma: 47
    • View Profile
Re: My first ray caster.
« Reply #6 on: September 28, 2010 »
Looking good!
 :clap:
Challenge Trophies Won: