Ray Casting

Alexin

  • *
  • Posts: 3130
http://www.stencyl.com/v10/game/play/2097

I decided to try my hands at a Doom-like game, using ray casting. The initial result isn't very encouraging, even though the engine has no optimization whatsoever.

Use WASD to move the camera around. Moving towards the only wall slows the game down, to the point where it practically stops. I believe this could go somewhere with optimization and more work, but this little experiment tells I don't want to go on with it for the time being.

If anyone wants to develop it further, let me know and I'll share the files.

(I made the engine based on this tutorial: http://www.permadi.com/tutorial/raycast/)
"Find the fun"
alexin@stencyl.com

Alexin

  • *
  • Posts: 3130
Well, it actually runs much, much faster on the browser than the player. I'm reading a maximum of 150 ms in the render cycle, whereas in the player I get 1000 ms!

Good news.
"Find the fun"
alexin@stencyl.com

Masked

  • Posts: 76
This would make one hell of an arcade-style duck and cover old west shooter game. I'm curious enough to want to look into this further. I also have no idea how you made this or how it would be utilized by another person. You, like... modified the engine or something? Would it be possible to "ray cast" only certain elements of a scene? Could the lag issues be covered by limiting the movement range of the player to only going a bit backwards and forwards? Sorry if these are dumb questions. Real cool.

Alexin

  • *
  • Posts: 3130
You, like... modified the engine or something?
I didn't modify the engine, I simply put some AS3 files in the same folder as the behaviors. Then, I created a simple code mode behavior that uses those file (it basically sets the scene and camera up and renders it into a bitmap, which is in place pasted on the screen).

Would it be possible to "ray cast" only certain elements of a scene?
I have total control of what I want to "ray cast".

Could the lag issues be covered by limiting the movement range of the player to only going a bit backwards and forwards?
The poor performance can be improved, but I haven't looked into that. For example, I realized there's a huge performance drop once the wall's height doesn't fit in the screen.

The improved performance I experienced with the browser has certainly encouraged me to develop this further.
"Find the fun"
alexin@stencyl.com

Masked

  • Posts: 76
Quote
The improved performance I experienced with the browser has certainly encouraged me to develop this further.

I'd be willing to do graphics if you wanted to try out a cover based arcade shooter. :o~♪

Alexin

  • *
  • Posts: 3130
Thanks for the offer. A dungeon crawler fits in the style too (think of Dungeon Keeper, for example).
"Find the fun"
alexin@stencyl.com

Darkhog

  • Posts: 1243
I simply put some AS3 files in the same folder as the behaviors. Then, I created a simple code mode behavior that uses those file

Does it mean we can use MochiAPI the same way? If so, that would be great, because I can use MochiScores instead of Stencyl's one (MochiScores let you use any name you want, even if you're not registered mochi user)

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Alexin

  • *
  • Posts: 3130
Does it mean we can use MochiAPI the same way?
I don't know anything about this API, but I suppose you can, yes.

If so, that would be great, because I can use MochiScores instead of Stencyl's one (MochiScores let you use any name you want, even if you're not registered mochi user)
I read this countless times...
"Find the fun"
alexin@stencyl.com

Alexin

  • *
  • Posts: 3130
I managed to keep the frame rate at a minimum of ~30, only with a small change. I'm pretty sure I can keep it at ~50 with another trick.

If it turns out be true, I guess I'll take this more seriously.
"Find the fun"
alexin@stencyl.com

Darkhog

  • Posts: 1243
Alexin, if you'll be able to finish this properly with good frame rate, could you make this into easy to use kit, so everyone could make pseudo-3d games with Stencyl?

There are no impossible things. There is only lack of skills.
Don't click this if your computer has less than 641 kilobytes of RAM.
Stencyl stencyling stencylish stencylers :D

Alexin

  • *
  • Posts: 3130
It don't intend to make a kit if this goes forward. The toolset isn't specialized for ray casting so I'd have to make an extension to handle it.
"Find the fun"
alexin@stencyl.com