[W.i.P.] Lua RayCast3D - 3D Game Engine for lpp-3ds

Discussion in '3DS - Homebrew Development and Emulators' started by Rinnegatamante, Dec 30, 2015.

  1. Rinnegatamante
    OP

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    Lua RayCast3D

    Lua RayCast3D is a 3D Game Engine for Nintendo 3DS which runs under Lua Player Plus 3DS (lpp-3ds).
    It uses Ray-Casting algorithm (https://en.wikipedia.org/wiki/Ray_casting) to generate a 3D world starting from a 2D map.
    It runs fullspeed on N3DS with any accuracy value but runs smooth on O3DS only with accuracy values >= 3.

    At the moment these are the Features Lua RayCast3D offers:

    • Different tile size maps
    • Automated camera and player position management
    • Support for huge maps (pratically there aren't limitations)
    • Support for sky rendering and floor rendering
    • Automated minimap renderer with player position
    • Textured walls support
    • Wall Collisions check
    • Shading support
    What this engine needs to be finished is listed in this TODO List:

    • Player collisions with walls
    • Sprites support for animations
    • Bullets physic
    • Editable FOV
    • Support to textures for walls, sky, floors
    A cool TechDemo recorded by @ihaveamac can be watched here:


    Screenshots:
    [​IMG]


    Credits:


    Repository:
    https://github.com/Rinnegatamante/Lua-RayCast3D/tree/master


    Download:
    Here you can download the first alpha version (v.0.1) with a sample tech demo and a short documentation for the available functions: https://github.com/Rinnegatamante/Lua-RayCast3D/releases/tag/0.1
     
    Last edited by Rinnegatamante, Jan 8, 2016


  2. Uziskull

    Uziskull Picture may not be real

    Member
    265
    178
    Nov 15, 2015
    Somewhere, probably
    The 3DS scene is quickly having some amazing homebrew! Nice work :D
     
  3. Voxel

    Voxel Clumsy Coder

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,148
    5,780
    Jun 27, 2015
    United Kingdom
    England, UK
    God dammit, you beat me to some sort of 3D engine for 3DS homebrew! >_<

    Good work, though! :)
     
  4. Rinnegatamante
    OP

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    Added collision checks with walls right now.

    Next step will be to add textures support for walls.
     
  5. piratesephiroth

    piratesephiroth I wish I could read

    Member
    2,839
    1,387
    Sep 5, 2013
    Brazil
    Now I'm pretty sure SmileBASIC destroyed the 3DS homebrew scene, hue

     
  6. Jwiz33

    Jwiz33

    Banned
    2,654
    1,523
    Jun 5, 2014
    United States
    in the illuminati headquar—I have said too much!
    Hah, I found this on ihaveamac's YouTube today, and I thought it was some old dead unfinished homebrew, but then I find it here and that it is still being updated.
    Thanks for this and good luck!
     
  7. Rinnegatamante
    OP

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    I started working to this engine like 2 or 3 days ago just to learn how Wolfenstein 3D works (i needed it to understand why it uses such coordinates system which make difficult to implement stereoscopic 3D) but when i seen the results, i decided to make this project public.

    Technically this is not a real 3D engine but a fake-3D ones :P
     
  8. Megalegacy98

    Megalegacy98 ( ͡° ͜ʖ ͡°)™

    Member
    505
    259
    Aug 11, 2015
    United States
    Just around the corner™
    Awesome! Can't wait to use this! Thanks a lot!
     
  9. Rinnegatamante
    OP

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    Added support on camera movement to look up and down (tricky way but works quite good).

    Texture support is also quite finished but it seems lpp-3ds (and so sf2dlib) have some problem with image scaling + cropping. Anyway here's a quick screenshot with the work in progress texture support (minimap is correctly textured):
    Warning: Spoilers inside!

    It will be also extremely easy to use textures and you can also use different textures for different walls (this code is what generated the map of the screenshot):

    Code:
    W = Graphics.loadImage(System.currentDirectory().."/wall.png")
    map = {
       W,W,W,W,W,W,W,
       W,0,0,0,0,0,W,
       W,0,W,W,W,0,W,
       W,0,0,W,0,0,W,
       W,0,0,W,W,0,W,
       W,W,W,W,W,W,W
    }
    
    Next thing i'll add after texture support are shading effects (for fog, underwater, night, depth of field effects)
     
    Last edited by Rinnegatamante, Dec 30, 2015
    AtlasFontaine and ihaveamac like this.
  10. Jwiz33

    Jwiz33

    Banned
    2,654
    1,523
    Jun 5, 2014
    United States
    in the illuminati headquar—I have said too much!
    Github isn't updated?
     
  11. Rinnegatamante
    OP

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    I'll update it after solving textures problem.
     
  12. keanutah

    keanutah GBAtemp Regular

    Member
    173
    130
    Sep 18, 2015
    United States
    Dude you're insane. This is awesome!
     
    Rinnegatamante likes this.
  13. Ripper00420

    Ripper00420 GBAtemp Advanced Fan

    Member
    740
    224
    Nov 5, 2013
    United States
    Whoot! whoot! I can't wait for your finished Wolfenstein 3D. I lost so much of my childhood locked in my room to this game, Descent, and 7th Guest... Lol!
     
    Last edited by Ripper00420, Dec 30, 2015
  14. Rinnegatamante
    OP

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    Fixxed texture walls, now they work correctly :D

    Updated also GitHub repository.
     
    Jwiz33 likes this.
  15. Jack_Sparrow

    Jack_Sparrow Ruthless Pirate

    Banned
    855
    477
    Nov 17, 2015
    United States
    The Black Pearl
    Great work! When can we expect documentation and a .3DSX ??
     
  16. Rinnegatamante
    OP

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    3DSX with working Tech Demo is already available on GitHub repository.
    For the documentation, it will arrive quite soon but the engine is really simple to use (look at the tech demo code: https://github.com/Rinnegatamante/Lua-RayCast3D/blob/master/index.lua)
     
    Jack_Sparrow likes this.
  17. Jack_Sparrow

    Jack_Sparrow Ruthless Pirate

    Banned
    855
    477
    Nov 17, 2015
    United States
    The Black Pearl
    Wow, once again i'd like to say thanks. I have a game i'm coding in LOVEPotion for 3DS right now (Which is based on your work) The 3DS homebrew scene would be much different without you! :)
     
    Rinnegatamante likes this.
  18. Jwiz33

    Jwiz33

    Banned
    2,654
    1,523
    Jun 5, 2014
    United States
    in the illuminati headquar—I have said too much!
    When going into a corner I get:
    Error: [string "?"]: number (local 'wh') has no integer representation.
     
  19. ihaveamac

    ihaveamac GBAtemp Guru

    Member
    5,339
    5,752
    Apr 20, 2015
    United States
    Tigard, OR
  20. Rinnegatamante
    OP

    Rinnegatamante GBAtemp Psycho!

    Member
    3,127
    3,260
    Nov 24, 2014
    Italy
    Bologna
    First alpa version released!

    Download:
    Here you can download the first alpha version (v.0.1) with a sample tech demo and a short documentation for the available functions: https://github.com/Rinnegatamante/Lua-RayCast3D/releases/tag/0.1

    Note that the engine is in a early stage, it's not very much accurated (some graphical glitches with textures and models generation) but it's fully working and usable for homebrews creation.
     
    Last edited by Rinnegatamante, Dec 30, 2015
    Jack_Sparrow likes this.