Controls: D-Pad: [Arrows / WASD] - A: [J] - B: [K] - Menu: [U] - Home: [I]
Enjoy games at full speed with sound and lights on the Gamebuino META!
Emulator by aoneill

Hi, I have been working on a Raycaster project for the Arduboy and decided to port it to the Gamebuino META. It currently has the following features.


Movement

Move Forward

Move Backward

Turn Left

Turn Right

Strafe Left

Strafe Right


Interaction

Wall and door collision with a nice sliding effect

Doors that open when you stand in front of them


This version includes texture mapped walls, doors, ceiling, and floor. The Wolfenstein 3D textures are placeholders I used for testing.


I hope you enjoy this preview.

Last comments

avatar
gamebuino-admin
5 months ago
avatar
gamebuino-admin
5 months ago
Author :

 Alban


I have not studied this piece of code thoroughly, but this is a very “classic” problem, and the implementation looks as “basic” as this type of problem can be.

This looks 3D, but this is a 2D problem :

  • imagine you are in a place with a fixed ceiling and a fixed floor, every wall has the same height
  • More interestingly, at every angle you can look at, you can see one and only one wall.
  • Thus, to draw this "3D" scene, you "just" have to determine 2 things per view angle (i.e. per pixel column) :
    • Which wall you are looking to, and which part of the wall -> this gives you a texture coordinate
    • How far it is -> this gives you a scale factor
    • -> this is a problem of finding the intersection of a view line and a list of walls

Angles and scale factors are stored in look-up tables, to make things faster.

My 2 cents, I hope this is clear enough. I can invite you to read "Game Engine Black Book : Wolfenstein 3D" by Fabien Sanglard if you want to know more (there is much more than raycasting in this book).

avatar
gamebuino-admin
5 months ago
Author :

 jicehel


If you analysis code maybe you could do a fork with your comments. I’m not developping atm but it was not easy to understand when i have had a look on code. It’s a really good project and i think it’s could be great to have a good study of the code and explain to all how to use it, personnalize and use motor for any imaginable game (or adaptation) or be able to use other methode technics explained by bfx in Affine3D or methods explained in Affine.  I don’t think that metohds explained by Steph here could be easy to use with this motor but maybe i’m wrong