Shop OBEX P1 Docs P2 Docs Learn Events
90's style 3D (Now with USB keyboard scancodes) — Parallax Forums

90's style 3D (Now with USB keyboard scancodes)

RaymanRayman Posts: 14,553
edited 2021-02-07 21:00 in Propeller 2
See attached pic.

Update: Now working on P2 Eval. Source code posted here.

Getting ~37 fps using just one cog on 250 MHz P2 Eval.
But, speed can be dramatically improved (by using more cogs).

Features background, textured walls and textured floor.
Far away walls now a bit darker.

You can see where I got this idea from here: https://permadi.com/tutorial/raycast/demo/5/

I've made some notes on the coordinate system, attached here for reference.

Update: Rev. Main3b now uses USB keyboard scancodes for movement
«134

Comments

  • Oh wow, you simply have to tell us more
  • Looks great. :)
  • This definitely requires a video!

    j
  • roglohrogloh Posts: 5,750
    edited 2018-12-06 02:25
    Love it! Looks like P2 Doom is on the way... :smile:
  • RaymanRayman Posts: 14,553
    If you want to see where I got this from, just look here:
    https://permadi.com/tutorial/raycast/demo/5/

    there's a pretty good tutorial and demos...
  • Looks a little like "Way Out" ... one of my favorite ATARI PC games ...
  • That's very cool!

    I'm guessing you converted the Javascript to something that will run on P2? If so, did you have an automatic tool for it, or did you have to do it by hand? Either way I'm impressed :).
  • rogloh wrote: »
    Love it! Looks like P2 Doom is on the way... :smile:

    Maybe Marathon instead, so that we could look up and down ;)
  • Hey Rayman! Fun stuff!

    :D
  • cgraceycgracey Posts: 14,134
    edited 2018-12-06 05:54
    Wow! At 240MHz, you'll be able to get 33 frames per second.
  • Beau,

    Reminds me of Bard's Tale which was one of my favorite games.
  • RaymanRayman Posts: 14,553
    Actually, I ported first to MFC C++ and then to P2ASM...
    Windows test exe attached. It's very slow, but you can move with WASD
  • RaymanRayman Posts: 14,553
    The frame rate can be dramatically improved. I haven't made any attempts to speed it up yet, just fixing some bugs...

    The floor is what's really making it slow. Background too. Wall drawing is super fast.
    But the author has this note on drawing the floor:
    FLOOR CASTING at the simplest!  Try to find ways to optimize this, you can do it!
    

    So, I think it can be improved...
  • Looks a little like "Way Out" ... one of my favorite ATARI PC games ...

    That's rocking, the little music jingle reminds me of Pink Floyd On The Run.
    Some one should make a remake for the PropII. : ]
  • RaymanRayman Posts: 14,553
    It's done!

    Well, at least it's fully operational.
    Now, need to work on speed and precision...

    Download the binary from the first post to try it out.
  • Cool! : ]
    If I had a way to run it, I would.
    gotta' wait until I get a sample board.
  • ColeyColey Posts: 1,110
    edited 2018-12-09 23:23

    Prop 1 96MHz

    Why not PM Baggers and see if he can share his Wolf 3D Demo with you ?
  • RaymanRayman Posts: 14,553
    I remember that... It was part of my inspiration to do this...
  • roglohrogloh Posts: 5,750
    edited 2018-12-10 00:25
    Just imagine what the P2 will be able to do if P1 can do this. Probably just memory will be its main limitation.
  • rogloh wrote: »
    Just imagine what the P2 will be able to do if P1 can do this. Probably just memory will be its main limitation.

    I'm impressed with the fact Baggers was able to get Wolf 3D to work in under 32k.
    I mean you need a screen buffer, place to store textures. That's impressive!

    P2 should be able to pull off a lot more!
    Compression on the fly should help with the small amount of storage. That and there is a lot of talk about using HyperRAM for frame buffers.
  • No screen buffer on that one, it's dynamically drawn.
  • Ym2413a wrote: »
    P2 should be able to pull off a lot more!
    Compression on the fly should help with the small amount of storage. That and there is a lot of talk about using HyperRAM for frame buffers.

    Yes the P2 has so much internal memory bandwidth now. It's 1GByte/s at 250MHz per COG! A '486 at 33MHz back in the day running Doom had nothing like that. So it will mainly just be the external memory latency that holds it back but people will be inventive as usual. All sorts of things will become possible. Gonna be great.

  • Rayman's demo does floors and a background sky, not just the walls.
    I am also confident he will be able to make it faster on the P2 given time to optimize.
  • rogloh,

    Comparing a SoC (System on a Chip) P2 to a multichip 486 is not quite apples to apples.

    Also remember that there were clock doubled, tripled, and quadrupled versions on the 486 as well as Vesa Local Bus.
    I think VLB ran at double the system speed.
  • I know they are different beasts, and it was not meant to be a direct comparison however it is still interesting to see the raw (internal) bandwidth the P2 now offers us. I think lots of things are going to be possible with it now.
  • That's great! Thanks for sharing, getting excited for the P2! Though I'm going to have to learn some serious programming. :blush:
  • Rayman used just a single COG. One optimization could be to divide the screen into regions and have multiple COGS render.

    This chip is fast enough to potentially draw that scene dynamically, using only a handful of line buffers.

  • RaymanRayman Posts: 14,553
    One thing I haven't totally figured out is how to do shading like the JavaScript source.
    They are working in 24-bit color mode, so it's easy.
    But, in 8-bit mode, it's more of a challenge.

    I was able to make 2 additional copies of the brick wall, each a bit darker. This works OK.

    For a real game though, you are probably going to want several different wall bitmaps and then memory usage might become a problem.
    I'm toying with the idea of using tricks with the palette to do this instead.
    But, the palette is limited too...
  • Do 3-3-2 color encoding, 8 shades of red, 8 of green, 4 of blue
  • RaymanRayman Posts: 14,553
    Interesting idea... I just looked into it.
    Problem is that there are only 2 shades of gray.
    Won't work for this gray wall very well..
Sign In or Register to comment.