Jump to content

Photo

Atari Moria, testing needed!

VBXE Moria Rogue CRPG

28 replies to this topic

#1 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • 1,987 posts
  • Location:Victoria, Canada

Posted Sun Apr 12, 2015 12:26 AM

I've got almost the entire Mines of Moria rogue-like game ported to the Atari, using VBXE and an Atarimax Flash 8Mbit cartridge.  The only gameplay thing left to port is the "look" command.  I will be adding joystick control, and a few other cosmetic things, and I will look into prerendering some levels and depacking from cartridge, as the random level generation is still around 30 seconds per level.

 

I would appreciate any testing and bug reports though!  Especially when it comes to the various spells, prayers, wands, staffs and potions and monsters.  '?' brings up the help screen.  CTRL-W enters wizard mode, which lets you cheat.  CTRL-directions work in Altirra too, so you can use your direction keys (for up, down, right and left anyway.)

 

A good page for Moria information:

http://beej.us/moria/

 

The cart image is an Atarimax 8Mbit old style banking (cart 42 in Altirra).  You need VBXE.  The current colors are set for PAL.

 

A couple of questions:

 

What about colors of objects?  I have some objects colored white and some blue.  I couldn't decide whether to color all objects blue or white... monsters are currently red, which I think works fine.

 

In some of the inventory screens there is a solid line below the inventory listing and in some there isn't.  Which looks better?

 

I restored some of the things I had initially changed (the history of messages are at 20 now), but monster recall/memories are currently not implemented.  They will take a lot of memory and further cartridge banking, which may slow the game a bit.  Are they important to the game play or not?  (old moria players this question is for you.)

 

Any questions or comments welcome.

 

Attached Files



#2 phaeron OFFLINE  

phaeron

    River Patroller

  • 2,734 posts
  • Location:Bay Area, CA, USA

Posted Sun Apr 12, 2015 2:28 PM

Never played Moria, and it's been a long time since I played NetHack:

 

doh.png

 

It's a lot more playable than I would have expected, though.

 

The level generator seems to be spending some huge amount of time in a division routine at $136A. Might be able to speed it up.

 



#3 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • Topic Starter
  • 1,987 posts
  • Location:Victoria, Canada

Posted Sun Apr 12, 2015 7:21 PM

Thanks! There are still a few bugs, found one today when you max out your inventory.

That routine at $13xx is in the C runtime.... I'll check it out and see what I can do to optimize it a bit more. The random generator was never designed to run on a 1.79Mhz machine with only 64k. :)

 

update: using the profiler in your great emulator, Altirra, with my debug symbols loaded, it was easy to see that the function is the cc65 runtime udiv32, called by the random number generator that moria uses.  This is a 32-bit pseudo random number generator, and I didn't want to touch it too much, since important parts of the game rely on it (for instance in a single game the town always looks the same because the seed is saved and always generates the same random numbers.)

 

It seems though that if I can replace this code with something faster on a 6502 it will really make a difference in the dungeon generator.   Here's the code:

 

Spoiler

 

PS. In the original Moria code, the random number generator is seeded from the clock, but since the Atari doesn't have a clock, I was using the RANDOM ($D20A).  Is there any initialization that needs to be done first?  I noticed that with Altirra at least, the code is not as random as I'd have thought (upon initially running the game... it's like it's generating the same seed from RANDOM deterministically, maybe due to power on state?)


Edited by Shawn Jefferson, Sun Apr 12, 2015 7:51 PM.


#4 phaeron OFFLINE  

phaeron

    River Patroller

  • 2,734 posts
  • Location:Bay Area, CA, USA

Posted Sun Apr 12, 2015 8:15 PM

Ouch. Yeah, calling straight 32-bit mul/div routines is overkill for that routine. cc65 also may not be merging the divide and modulus operations to take advantage of division routines producing both.

 

Regarding RANDOM: this is a common mistake. On the real hardware, the value you get from RANDOM is fully deterministic in the number of machine cycles since the shift register was last initialized via SKCTL. This means that if you use it, you always want to have a nondeterministic delay in between the last reset and when you start pulling random numbers. People unintentionally tend to rely on the initial disk load for this, which is why they're surprised when they see this behavior in an emulator, but you can get the same effect with a cartridge start. The best solution is to wait for the user to press a key or button before pulling random numbers for the first time. As far as I know there is no other good source for this -- not even uninitialized memory will work, as the cold start pattern is actually quite deterministic.



#5 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • Topic Starter
  • 1,987 posts
  • Location:Victoria, Canada

Posted Sun Apr 12, 2015 8:33 PM

Thanks!  I quickly switched the rnd functions to use the 16-bit version supplied by the C runtime, and it looks, at least so far that it's about three times quicker and still provides what the game requires.  I'm going to tidy it up a bit more and remove the not required int32 variables.  The game only ever tries to generate an int16 anyway.

 

On the RANDOM front, I will add that into the project.  I was going to put up a VBXE graphics title page anyway, so I'll wait for the user to press a key there and generate the seed after that!  I figured it was something to do with power on state.

 

Update: Wow, removing that routine and going with a 16-bit one without all the divisions has seriously sped up the generation of dungeons, on average it only takes 2-3 seconds now.  I think I can remove the "Generating level..." message even!  It also speeds up other parts of the game slightly too, which is also nice.

 

I'll post another version when I have added joystick control.


Edited by Shawn Jefferson, Sun Apr 12, 2015 9:24 PM.


#6 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • Topic Starter
  • 1,987 posts
  • Location:Victoria, Canada

Posted Tue Apr 14, 2015 7:31 PM

Joystick control is a little more complicated that I had hoped, and I wanted to get this much faster dungeon generation version uploaded.

 

Level generation is in the order of 2-3 seconds (!) now, with the simple swap out of that random number generator.  Also fixed:

 

- added a message if VBXE is not detected

- added bypass to boot if option is held at boot (to flash another image onto cart)

- added a line at the bottom of inventory and other message pop-ups.

- fixed a bug where you could pick up more items that you should have been able to (causing a crash or video corruption.)

 

 

Attached Files



#7 remowilliams OFFLINE  

remowilliams

    Quadrunner

  • 10,608 posts
  • Location:Detonation Boulevard

Posted Tue Apr 14, 2015 7:48 PM

Oh my...  finally a reason to take the VBXE out of the enormously dusty shelved project area?    :D



#8 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • Topic Starter
  • 1,987 posts
  • Location:Victoria, Canada

Posted Thu May 14, 2015 12:16 AM

Beta1 just posted on the blog, with a few screenshots.

 

http://atariage.com/...ry-12012-beta1/

 

Game play is fully ported now.  Highscores, monster memory, character and game are all being saved to flashcart.  Highscores and monster memory persist across multiple games. 

 

Give it a try and please report any bugs!

 

PS. Adding the cartridge image here too:

 

Attached Files


Edited by Shawn Jefferson, Thu May 14, 2015 12:17 AM.


#9 Centurion OFFLINE  

Centurion

    Chopper Commander

  • 186 posts
  • Location:USA

Posted Fri May 15, 2015 1:18 AM

Makes me want a VBXE :)

#10 Goochman OFFLINE  

Goochman

    Quadrunner

  • 6,988 posts
  • Moongates to the Past

Posted Fri May 15, 2015 5:18 AM

Just curious - any particular reason this couldnt be done on the stock XE video?  Youd need to use the 1/2 size char fonts which arent as pretty but I imagine it would work?



#11 pirx OFFLINE  

pirx

    Moonsweeper

  • 451 posts
  • Location:Poland

Posted Fri May 15, 2015 9:15 AM

Why not use RANDOM $D20A entirely in place of the software generator? Of course after user input delay.

As far as I have tested it is really good in terms of randomness and you can't beat it's speed :)



#12 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • Topic Starter
  • 1,987 posts
  • Location:Victoria, Canada

Posted Sat May 16, 2015 12:19 AM

Just curious - any particular reason this couldnt be done on the stock XE video?  Youd need to use the 1/2 size char fonts which arent as pretty but I imagine it would work?

 

One reason is memory.  I'm using the VBXE memory itself from $4000-9FFF to bank in the various structures.  It would be much more complicated to do it only in the 16k extended memory bank, and add on top of that the memory it takes to do 80 columns in software.  I don't think you could port the code and get the entire thing to fit, or at least it would be much more work.

 

I do plan on trying to get it working with 40 columns, extended memory and the flashcart only... but I will need to make changes to the game, eliminate some items for instance, and maybe re-arrange the screen layout slightly.

 

 

Why not use RANDOM $D20A entirely in place of the software generator? Of course after user input delay.

As far as I have tested it is really good in terms of randomness and you can't beat it's speed :)

 

Well as I said above, the game makes use of the PRNG to generate levels, unique towns, etc... I was worried that the game would either not be as true to the original code, or the ability to restore a seed and get the same random numbers wouldn't work.



#13 Android8675 OFFLINE  

Android8675

    Moonsweeper

  • 439 posts
  • Incognito'N
  • Location:Prunedale, CA, USA

Posted Mon May 18, 2015 9:52 AM

Makes me want a VBXE :)

I'm running on Altirra. Worth it, it is a great port of a classic Roguelike. I kindda want a VBXE, but i'm lazy at the moment.



#14 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • Topic Starter
  • 1,987 posts
  • Location:Victoria, Canada

Posted Tue Oct 13, 2015 7:27 PM

Atari Moria v55 beta2:

 

- added joystick control (joystick is only read if at least two vblanks have passed, which seems to provide the right feel.)  Joystick button can be used for most any key prompts.  Joystick button and direction digs a tunnel.

- fixed a few bugs, many are probably still there (report them if you see any!)

- added a pause at startup to get better randomization.

- added creating items to wizard mode (you'll need the source, or some of the information on Moria websites to do this properly.)

- added a player structure display to wizard mode (Ctrl-C), to aid in debugging.

- added the rest '*' command to rest until healed and mana restored

 

The game is playable and should even be able to be completed in the state it's in.  It seems to work well with CPU accelerators (in Altirra anyway!)

 

PS. My hat's off to anyone who takes an original game or port and brings it past the finish line.  Play testing and bug hunting at the 80%-90% done mark is absolutely not fun.  Especially a game like Moria that can take hundreds of hours to finish, with so many items, monsters, and spells. :(

 

Game Requirements:

- VBXE

- AtariMax 8mb flashcart (currently old style banking, bank 127 active at boot.)

- 64k (uses RAM under the OS)

Attached Files


Edited by Shawn Jefferson, Tue Oct 13, 2015 7:28 PM.


#15 MrFish ONLINE  

MrFish

  • 5,471 posts

Posted Wed Oct 14, 2015 11:02 AM

...absolutely not fun.

 

Maybe it'd be a little more fun to test, and to play in general, if you started enhancing the graphics some at this point. icon_smile.gif  Isn't that part of why you're using VBXE functions in the first place (for enhanced graphics), or are you just interested in the resolution/80-columns (which is of course a graphics enhancement itself)? What are the exact capabilities of this mode, is it any two colors per character region?


Edited by MrFish, Wed Oct 14, 2015 11:03 AM.


#16 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • Topic Starter
  • 1,987 posts
  • Location:Victoria, Canada

Posted Wed Oct 14, 2015 7:18 PM

It's definitely for 80 columns... and extra memory. It's more difficult than it first appears to go from aacii to graphics with this game. Quite a bit needs to be changed.

At this point my to do list:
- finish the port
- convert to 40 columns and extended memory (losing some game elements due to lack of memory)
- look at adding graphics

#17 greblus OFFLINE  

greblus

    Moonsweeper

  • 270 posts

Posted Thu Oct 15, 2015 1:55 AM

Hi Shawn.

 

It's great to see such progress in development, i'm really curious about joystick support. I tested Moria some time ago in Altirra, but would it be possible to compile the game as xex file, or in a way allowing to run it on real hardware (without Atarimax cart, eg using Side's SDX)?

 

Thank you and keep up the good work. It's really cool project and last item from your todo list: "look at adding graphics" is making it even more interesting ;).

 

Cheers,

W.



#18 Frankie OFFLINE  

Frankie

    Moonsweeper

  • 482 posts
  • Location:St. Augustine, FL

Posted Sun Oct 18, 2015 8:14 PM

Ok, this pushed me over the edge to get my vbxe installed.

#19 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • Topic Starter
  • 1,987 posts
  • Location:Victoria, Canada

Posted Sun Oct 18, 2015 10:51 PM



Hi Shawn.

 

It's great to see such progress in development, i'm really curious about joystick support. I tested Moria some time ago in Altirra, but would it be possible to compile the game as xex file, or in a way allowing to run it on real hardware (without Atarimax cart, eg using Side's SDX)?

 

Thank you and keep up the good work. It's really cool project and last item from your todo list: "look at adding graphics" is making it even more interesting ;).

 

 

Unfortunately, it's not going to see any release that doesn't involve a cartridge format.  The problem is that the game is too big.  It was never designed to run in 64k, and trying to squeeze it down would mean changing the game from Moria into just a "rogue-like", and we already have those on the Atari.

 

Currently there is:

 

~ 24k for the cave itself

~ 14k for the monster tables

~ 24k for the object tables

~ 20k for the spell tables and other assorted tables/information

~ 50 x 8k banks with code (quite a bit of duplicated code to cut down bank switching)

 

oh, and the C runtime, some data and variables and all the banking functions and game save code is in RAM.

 

To squeeze it all in, I'm cheating.  I'm using VBXE for the 80 column mode, and I'm using it's ability to overlay 32k of its ram at $4000.  All the data is in VBXE ram and I'm banking that in depending if I'm accessing the cave, monster data, object data or spell/assorted data.  Then all code is running out of the cartridge at $A000-BFFF with quite a bit of banking going on.

 

I do think it's possible to cut the game down slightly so that it runs with an Atarimax cartridge and extended memory ($4000-7FFF), without the VBXE.  You can see that this will probably involve cutting some of the objects from the game (how many broken daggers do you need anyway? ;)  ), and probably making the cave smaller too.


Edited by Shawn Jefferson, Sun Oct 18, 2015 10:53 PM.


#20 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • Topic Starter
  • 1,987 posts
  • Location:Victoria, Canada

Posted Sun Oct 18, 2015 10:59 PM

double post

Edited by Shawn Jefferson, Sun Oct 18, 2015 11:00 PM.


#21 FifthPlayer OFFLINE  

FifthPlayer

    Moonsweeper

  • 430 posts

Posted Sun Oct 18, 2015 11:24 PM

I don't have a VBXE, but I have a RAM 576XE and wonder if a version that uses the extended memory on an expanded Atari could retain all the gameplay as the VBXE version, albeit with a 40-column display.



#22 greblus OFFLINE  

greblus

    Moonsweeper

  • 270 posts

Posted Mon Oct 19, 2015 12:39 AM

I do think it's possible to cut the game down slightly so that it runs with an Atarimax cartridge and extended memory ($4000-7FFF), without the VBXE.  You can see that this will probably involve cutting some of the objects from the game (how many broken daggers do you need anyway? ;)  ), and probably making the cave smaller too.

 

No, it'd be disrespectful to all your work and the game itself. I'll buy the cart version ;).

 

Cheers,

W.



#23 Android8675 OFFLINE  

Android8675

    Moonsweeper

  • 439 posts
  • Incognito'N
  • Location:Prunedale, CA, USA

Posted Mon Oct 19, 2015 10:04 AM

Played a couple characters this weekend and like all my rogue-like experiences I made it to level 4-5'ish before being eaten by a grue. (kidding, I forget how I died)

 

I'm playing on Altirra though I burned the game on a Atarimax cart and verified that it did not work on my 800+Incog because, no VBXE.

 

I gotta say I love the game, please don't change the graphics, it's a rogue-like, the best are ASCII only anyways. If you can figure out a way to make a 40col version or a version that runs with software 80col drivers I'd love to play test further.



#24 Shawn Jefferson OFFLINE  

Shawn Jefferson

    Stargunner

  • Topic Starter
  • 1,987 posts
  • Location:Victoria, Canada

Posted Tue Dec 22, 2015 10:57 PM

Here's beta3... a few small bugs fixed and I decided to add some things to the game (don't worry, classic mode still available.)  At this point I have added the Tavern and the Guild to the town level.  More detail here:

http://atariage.com/...gs-to-the-town/

 

I wonder especially how the Guild might affect game play.  Currently you have to be level 3 or higher to join, and it also costs 1000 gold, although a character less than level 3 is unlikely to have enough gold to join anyhow, so maybe that's an artificial constraint that doesn't add anything.

 

Still requires VBXE... haven't started the 40-column conversion, still planning what needs to be changed.

 

 

Attached Files



#25 _The Doctor__ OFFLINE  

_The Doctor__

    Flux Capacitor Master Craftsman

  • 6,703 posts
  • Location:10-0-11-00:02

Posted Tue Jun 26, 2018 10:12 AM

and of course you just knew this BUMP was coming!







Also tagged with one or more of these keywords: VBXE, Moria, Rogue, CRPG

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users