BrogueCE icon indicating copy to clipboard operation
BrogueCE copied to clipboard

Multiple game modes (Rapid & Lite)

Open tmewett opened this issue 1 year ago • 3 comments

I would like us to be able to implement much of RapidBrogue and Brogue Lite in CE.

This could be as whole alternative modes; or as modifiers, so one could have both a rapid and lite game (though this could be more complex).

Roughly, we need:

  • New main menu button "Custom game" which opens dialog with seed input plus radio buttons or check boxes for the modes. Replaces Ctrl + New game.
  • Sufficient flexibility to describe rapid and lite changes at runtime.
  • New code, probably in initializeRogue, to configure the selected mode(s).
  • Additional data in replay header for mode.

tmewett avatar Jul 25 '22 18:07 tmewett

Disambiguation in high scores too, as it wouldn't make sense to mix these games in high scores. In saved games perhaps just an indication which flavour.

simesy avatar Aug 01 '22 04:08 simesy

It looks like it should be reasonably straightforward to do something like this to handle different dungeon depths:

#define AMULET_LEVEL (gameMode.amuletLevel)
#define DEEPEST_LEVEL (gameMode.deepestLevel)
#define ADJUST_DEPTH(depth) (((depth) * mode.deepestLevel + 39) / 40)
// Or maybe: #define ADJUST_DEPTH(depth) (max(((depth) * mode.deepestLevel) / 40, 1))
// This one works slightly better: #define ADJUST_DEPTH(depth) (((depth-1) * mode.deepestLevel / 40) + 1)

The gameMode struct would specify amuletLevel and deepestLevel, and would be configured at initialization. Then, given a depth from 1-40, ADJUST_DEPTH will adjust the depth value to account for the new range. E.g. if deepestLevel is 10, it approximates the behavior of Rapid Brogue: ADJUST_DEPTH(26) = 7 (not quite like RB but close), and if the function is applied to the depths specified in Globals.c, it approximates the monster distribution from that variant without needing to change the numbers in that file. I have a very early prototype of this, which uses a command line option to set the dungeon depth (but it doesn't adjust most things other than spawn depths). For this to work well will probably require applying ADJUST_DEPTH to a bunch of other depth numbers too, as well as many of the other changes made by Rapid Brogue. @flend do you see any problems with this approach, that might result in it not working well for something like Rapid Brogue?

I think we should consider supporting 3 different game lengths, maybe with the amulet on floor 6 (like Rapid Brogue), floor 16, and floor 26. To me, 6 levels seems too short, and 26 seems too long; 16 floors might even make a good default (not sure about that though, and it would need a lot of work to make sure it's balanced).

nstoddard avatar Sep 01 '22 08:09 nstoddard

I added some improvements to my prototype. So far, it supports a command line argument to set the dungeon depth (from 6 to 40), it doubles the value of enchanting scrolls and gives the player a potion of detect magic when the depth is small, and it has a separate high scores file for each dungeon depth. It also tries to adjust the frequency of life/strength/enchanting potions/scrolls (though this isn't perfect yet), as well as adjusting many of the other things that Rapid Brogue adjusts (though in a more general way that can adapt to any depth). It's probably still missing several things that need to be adjusted with depth.

You can run this with ./brogue --depth 10, to approximate Rapid Brogue, or ./brogue --depth 25 for a slightly shorter dungeon than usual, etc. --depth 40 (the default) should be compatible with saves/replays made without this commit.

The code isn't great right now and will likely need significant refactoring if we want to use it.

nstoddard avatar Sep 04 '22 00:09 nstoddard

done by #555

tmewett avatar Nov 05 '23 19:11 tmewett