yellowstonegames / SquidLib

Useful tools for roguelike, role-playing, strategy, and other grid-based games in Java. Feedback is welcome!
Other
448 stars 46 forks source link

Exploding dice notation in bestOf() does not alter the state of the RNG when "1" is omitted #190

Closed Rakaneth closed 6 years ago

Rakaneth commented 6 years ago

The dice notation accepted by the Dice module states that "!6" is a synonym for "1!6", but if I use this shortcut, the state of the RNG does not change: image When I change the code to "1!6" instead, the RNG behaves normally: image Further notes: I am using a single StatefulRNG to control randomness. I am using the number 0xDEADBEEF to seed it for testing.

tommyettinger commented 6 years ago

Hm, this may be a mistake I made in the parser. It looks like that's considering only the 6, and ignoring the preceding !. I'll get right on this, should be a quick fix.

tommyettinger commented 6 years ago

Should be fixed now. I thought it was a one-char change by making the initial digit optional... but that made the whole dice notation optional, which had some effects on spaces I think. So that needed some small tweaking as well. Now there's more tests to try to detect this kind of thing.

tommyettinger commented 6 years ago

Also, I see some room-like shapes with right angles in your screenshots -- if you're going for a cave theme for some or all levels, maybe consider FlowingCaveGenerator to generate map layout; it starts with a mix of cave-like and room-like shapes (like in your screenshot) and smooths all the edges, imitating erosion by groundwater in caves. It would be pretty awesome to have some level or group of levels that aren't cave though, where wolves completely took over a mining area and left lots of precariously-balanced equipment (and miner remains) lying around.

Rakaneth commented 6 years ago

The plan here is to have the player visit a series of regions ravaged by a group of militant beings called the Wolflords. As such, there will be all kinds of terrain and dungeon types.