Shop OBEX P1 Docs P2 Docs Learn Events
Rogue game running on P2 with FlexSpin C (now in 1080p with USB keyboard) — Parallax Forums

Rogue game running on P2 with FlexSpin C (now in 1080p with USB keyboard)

RaymanRayman Posts: 13,860
edited 2021-02-01 20:39 in Propeller 2

I think I have Rogue mostly working on P2.

Still a bit of things off, due to my still trying to figure out how curses works...

But, seems at least playable now.


update: Can now output to VGA in 1080p and take input from USB keyboard.



Comments

  • RaymanRayman Posts: 13,860
    edited 2021-02-06 20:45

    To run with FlexProp, unzip the attached somewhere and open main.c and run it.

    Game runs in terminal window (for now :))...


    Update: Fixed a bug with rooms with no lights.

    Update: Added more heap to hopefully fix out of memory error as you play longer...

    Update: Finally fixed memory leak so can play forever without running out of memory. (oops, needed more heap, fixed now.)

    Update: The "Rogue_VGAandKB.zip" version optionally displays on VGA at 1080p and takes input from USB keyboard

  • Oh, that is very very cool @Rayman! That's one of the games that I was thinking would be nice to try out, but I never had the patience to port curses.

    It should be pretty easy to get it working on VGA with my ANSI vga driver. Combine that with a USB keyboard and we'd have a pretty nifty game to run on the P2...

  • RaymanRayman Posts: 13,860
    edited 2021-01-31 22:02

    I just remembered that I have the random seed set to zero, for troubleshooting...

    This version of main.c (in post #2) uses real P2 random and should give a different game every time (updated to use _rnd() instead of rand()).


    One very useful resource for getting this to work was this Rogue Collection:

    mikeyk730/Rogue-Collection: Retro Rogue Collection: Six versions of the classic Rogue game with customizable retro graphics. Now with Rogomatic support! (github.com)


    It has a Visual Studio solution that actually worked with Visual Studio 2019 and let me see what was going on inside...

  • RaymanRayman Posts: 13,860

    The basic movements are with h,j,k,l keys as described here:

    Rogue (video game) - Wikipedia


    You can type ? and then * to see a list of all commands.


    Type i to see inventory.


    BTW: I'm not sure I ever played this particular game, but I played a bit of NetHack in the day...

  • RaymanRayman Posts: 13,860
    edited 2021-02-06 20:42

    I added some extra heap to hopefully fix the out of memory error I was getting at around level 5.

    Just made it to level 8, so hopefully it's fixed. Unfortunately, the only way to know seems to be to play longer... I've updated the zip above with this.


    There are just a few bugs that I know about now, neither is really all that bad:

    1: The inventory list is orientated at bottom of screen instead of top.

    2: When a new monster appears in a room that you are not in, a non-printable character is added to the display buffer. I've sorta fixed that by changing these to spaces. But, this has the effect of you being able to see where a monster has appeared. think fixed.

    3: Need to implement top 10 score list when you die.

  • RaymanRayman Posts: 13,860
    edited 2021-02-01 20:37

    Added in the 1080p text driver. Want to add USB Kb/Mouse next, but binary is now up to 408 kB... Guess this includes the heap though, just need to leave room for the stack...


    Update: Posted this version in #2 above. Now, with USB keyboard input too.



  • Oh, HECK yes!!! Well done!

  • Yeah looks great Rayman. Brings back memories from late 80s

  • Awesome Sauce in a Jar!

  • That's awesome @Rayman :D will have a play tomorrow :D

  • How about Hunt the Wumpus...

  • RaymanRayman Posts: 13,860

    Never heard of Hunt the Wumpus, but I think I found some C source here: https://github.com/mad4j/Hunt-the-Wumpus

    Compared to Rogue, it's microscopic... I'd think that would compile, no problem.

  • @Rayman said:
    Never heard of Hunt the Wumpus, but I think I found some C source here: https://github.com/mad4j/Hunt-the-Wumpus

    Compared to Rogue, it's microscopic... I'd think that would compile, no problem.

    Yes, I just removed the code that expected command-line options and it compiled & ran. Hunt the Wumpus was originally written in BASIC and I first saw it in David Ahl's "BASIC Computer Games", cookbook of games. I typed it into the DEC PDP-11 that I worked on in the 70's... Just a bit of nostalgia!

  • I think most of the "BASIC Computer Games" programs should work with FlexBasic. You might have to add #include "classic.bi" at the top to get the environment set up for classic BASIC.

  • Yes, hunt the wumpus is based on a dodecahedron.

    Mike

  • RaymanRayman Posts: 13,860
    edited 2021-02-04 23:58

    How's this look? Too crowded?
    Also, I think I got save and restore from file system working.

Sign In or Register to comment.