Results 1 to 10 of 12

Thread: Every story ends somewhere...

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Every story ends somewhere...

    Hello. I'm working on an text adventure game in Lazarus. Pros are that I don't have to worry about collisions (which made Super Heli Land and some earlier unannounced projects fail). However I don't want it to be any ordinary text adventure game. I want to incorporate procedural generation into this so every playthrough would be different and theoretically could go on forever unless player dies (plan to have permadeath).

    Actual room, npc and object descriptions and parameters would be stored in some kind of DB, that is solved (decided on SQLite). What I don't know is how I could stitch together zones in a believable way (eg. cave shouldn't lead to the throne room, at least not directly). Since this problem borders on AI I am posting it there. I also may have problems with saving and restoring "layout" of rooms and what's in there (first version probably won't have save feature because of that). though I thibk solution is near, still thinking about that.
    Last edited by Darkhog; 11-08-2014 at 08:01 PM.

  2. #2
    Quote Originally Posted by Darkhog View Post
    What I don't know is how I could stitch together zones in a believable way (eg. cave shouldn't lead to the throne room, at least not directly).
    You can simply define which rooms can connect to specific room type by whitelisting/blacklisting posible room connections. For instance:
    - throne room can connect to main hall, kings chambers, castle squire room
    - cave can connect to plains, underground tunnels, etc.

    So then you only make sure your procedural world algorithm folow these rules.

  3. #3
    Like SilverWarrior said, I'd create a classification of room types and only allow specific types to connect to each other. You must also take into account how the room exits must be aligned for everything to work properly. Then come the corner cases of no matching tiles - keep a dead end, or try to replace one of the neighbouring rooms? Also, if your maps are to serve some purpose (like a dungeon where you must find a certain chests) there must be a path from the start to the chest room.

    I think it would be simplest to have a set of rooms - each room may have a different size, type, and a list of exits. You start generating the map with an exit/entrance tile, and then try to add neighbouring tiles to the existing map.

  4. #4
    Quote Originally Posted by Super Vegeta View Post
    I think it would be simplest to have a set of rooms - each room may have a different size, type, and a list of exits. You start generating the map with an exit/entrance tile, and then try to add neighbouring tiles to the existing map.
    Yes using of predefined map chunks is also a good idea especially if you wan't to join multiple rooms into a whole map.
    If you wan't to see this implemented in another game check out UFO Enemy Unknown, UFO Terror From The Deep, UFO Apocalipse or UFO Alien Invasion how they have implemented base map generation where each rom is prebuild and you are simply placing these rooms on your base layout.
    There are probably other games which use similar approach but I can't remember any of them at the moment.

  5. #5
    Well, I think it probably will be even simpler than you make it out to be as game is a text adventure (lookup Zork for example of one). So all rooms are largely "imaginary" and exits (north, south, east and west) are perfectly aligned - it's just case of whether or not two rooms have exits on the opposite sides (e.g. room that is connecting to one with exit at west MUST have exit on the east).

    Also instead of "room types" (though those are still used e.g. so dragon won't spawn in middle of house or somewhere as much insane) I've devised system that I think is more flexible.

    I've call it disposition system for some reason (dunno why anymore it is called that way, don't ask me at the time it made sense now it doesn't). The room can connect to other room when difference between disposition values of those is smaller than 3. The rooms that you spawn in at the beginning of the game always have disposition of 0 and aren't considered for spawning when going to another room (i.e. in whole playthrough you'll see only one room with disposition of 0, at the very beginning).

  6. #6
    Is this "disposition" something like room dificulty where room with disposition of 0 is the safest one?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •