Skip to content

Conversation

@idbrii
Copy link

@idbrii idbrii commented Jan 10, 2022

There are three parts to this PR:

  • cleanup
    • Maybe subjective, but the first few commits make the project easier to work with and fix some bugs.
  • Add AsTileLayout
    • This is useful for using the maze output in a game.
  • Add cave generation
    • Allows you to take the AsTileLayout grid and modify it to create caves from the maze. This part might be out of scope for LuaMaze, but I used it in a game I made recently and wanted to share.

When building a world in a game with a tileset, it's often easier to get
each tile as a boolean for "is solid collision". Add AsTileLayout for
this use case.
Implement cave generation functions from mazes as described in
[Using Prim’s Algorithm to Generate Continuous Cave Maps][1].

Users can call the new functions in a specific order to implement the
cave generation:

* RemoveDeadEnds
* ExpandRooms to expand maze walls for large cavernous rooms
* RemoveDeadEnds again to remove corridors
* ExpandRooms with a higher threshold to remove thin wall protuberances

[1]: https://kairumagames.com/blog/cavetutorial

These functions are visible in the demo when using the tilelayout
rendering. Added controls so you can see your options.

Include tests that pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant