Skip to content

Dungeon generation!! #14

@aelmosalamy

Description

@aelmosalamy

ASCII Combat currently needs a "generate_dungeon" function, I will be adding a new attribute to all rooms called "gen" and basically this attribute is an array with 2 elements, the first element is the "generation method" it can be a specific number (This room can be found n times in the dungeon), it can be a percentage (This room have n/100 rarity to be found in a dungeon), or maybe it can be a room which unique (only once) or a room which have a special interaction (this can give chance to introduce new room ideas: Arena, Puzzle Room, etc.. I got some plans in mind ...

Anyway, generate_dungeon pseudo code

  • Loop through all room types in the ROOMS dict and use the gen attribute to calculate how many instances of this room should be in the array available_rooms array
  • Move rooms from the available_rooms array to the dungeon_rooms array while connecting them by automatically setting the NORTH, SOUTH, EAST, WEST, UP, DOWN for each room, Keep adding rooms until there is nothing in available_rooms

This is the next step after implementing combat!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions