A Pico8 game and a C# Boulderdash compatible cave generator

Everything about the various Boulder Dash tools, and other stuff created by the fans.

Moderator: Admin

Post Reply
Teafortwo
Member
Posts: 2
Joined: Mon Oct 05, 2009 9:31 pm

A Pico8 game and a C# Boulderdash compatible cave generator

Post by Teafortwo »

Hi,
I've been lurking here for years, and a fan of Boulder Dash in so many ways over the years, ways that I can't even explain here without looking crazy.

I have been coding for a long time and my go-to "test app" for new language was always a small Boulder Dash clone. For example, when I tried Pico8 I made this: https://www.lexaloffle.com/bbs/?uid=46153 (you can check ou the code with the 'code' link under the game window)

Levels in that game are generated the exact same way as the original: I curated a list of 36 random seeds for 12 maps. Each map is simply 3 seeds and a set of commands that modify the generated data (lines, boxes and individual tiles, like the original). The "maps" data in the init() fonction has a very small footprint, perfect for the "type and play" concept I was going after, on top of being in the spirit of the original.

(^^ That was my intro... ^^)

I have also built a tool that create Boulder Dash "compatible" levels by itself.

https://github.com/gutterpunk/gendash

The code isn't "production ready" or anywhere near that, and I should update it, so no judging, but it can creates ~15x15 levels without crashing. It could create levels of the original size with some optimisations, but my goal wasn't to create levels for the original, but to create smaller caves for quick daily puzzles (I wanted to call it "Minute Dash" but that's another story).

Which is why I say "compatible": As I explain on the git,
While the caves generated are compatible with Boulder Dash's mechanics, they are not compatible with the game itself. Boulder Dash uses a deterministic random generator for it's cave, but not for gameplay. Two examples comes to mind:

Boulder pushing/grabbing: In Boulder Dash there is a 1 in 8 chance of actually pushing a rock when the player move. This cause the character to "skid" randomly when trying to push a rock, which can't be done in puzzle form, not without some burdensome graphical cues and rules.

Amoeba grow randomly. While I didn't implement them in the puzzle yet, they will likely be completely different than in the base game once I do because of this property.
As I was trying to make puzzles I needed to know the "perfect" score for every levels, and the best paths to achieve that score, to score each paths to find the level's difficulty, and the random boulder pushes make that impossible.

It creates levels like those, with their solutions: https://github.com/gutterpunk/gendash/b ... .xml#L4900

if you check the solutions you can see that it supports the grabs. What is harder to see is that the generator will sometime required the player to push rocks to kill some Butterfly to achieve the goal, which is pretty cool. Also, because the solution is found be a "perfect" player, it will use the precedence of movements rules a lot. It's fun to watch the solutions, you can see the player turn right at the exact frame to "walk" along an enemy, or just take then head on in a game of chicken. All legal moves, but that would give the jitters to most casual players, and the generator uses that to set a "proximity" score that influence the difficulty.

Anyway, without the random boulder push rule the game quickly becomes strategic: Each moves as to be planed with the rules of precedence and the movement rule.

For example, the hardest map in the xml database above:

Code: Select all

...**....>
0M...*0*..
.>*0*.0>**
.#d@..*00M
*M%*%.d*#.
00.%.0M.0.
.*..M...0.
..*.*.*..*
..d.#.*..*
..0*.0*...
***#.0.0.d
The < and M and Butterfly/Firefly. The exit is right beside the start (from the @ at 4,4 to the % at 3, 5) but the critters and the diamonds being at the bottom makes it the hardest of the pack, with 25% of the best solution being a move right beside a critter.
Post Reply