Open World ~ Generation Module Design layout - uchicago-cs/chiventure GitHub Wiki
Generation Module Design/layout
The Generation module is the logic, it makes sure rooms stay consistent.
Generation Module will use the following files:
- Adventure: When the player is outside exploring
- Indoor: When a player is in a building
- Battle: When player is in a battle tournament
- AI: Sorts items randomly according to player level and room type (if indoors, then randomly put indoor type items). **All excluding AI files listed consist of structs of items, short descriptions, and long descriptions specific to the file.
What Generation Module Contains:
- A boolean function called boolean different_room() that determines whether the player wants to step from the adventure rooms to an indoor or battle room. Returns true if the player wants to step out and false if it wants to continue in the same type of rooms.
- This matters because if a player that currently is in a library (indoor room) wants to go outside, then this would translate as a player wanting adventure like items and rooms.
- A function that will generate a room
- Will utilize WDL’s load_item and load_room
- A function that differentiates the level the player is in *Will need to wait until we have WDL ++ support for this.
- Module will hold new/init/free, and other convenience functions.
AI Module:
- Will include the items.h file from WDL and use functions like
- add_item_to_room(item_room, item);
- Int load_items(obj_t *doc, game_t *g)
- Will use random()
- Will consider player level and weapon level when making using random function.
Note: Currently there is …
- Support for rooms and items and actions for those
- No player definition: no specific player status
- No support for distinguishing level description
- No distinction between a non-hostile and hostile NPC **The WDL team informed us that they are considering implementing this in WDL++. Moreover, they are thinking about creating the potions and weapons as a special items category.
Things to consider:
- How many rooms shall there be in adventure? How many are indoors and in battle?
- How should we implement weapons and potions when they aren’t yet supported?
- How should we organize this Generation module to consider for hard-coded rooms other teams may have created?