• De-lurking for assistance (item generation and placement)

    From Fred notbob@21:1/5 to All on Sat Feb 27 03:52:05 2016
    I've been following the libtcod C++ tutorials on Roguebasin, and one thing that I haven't managed to get a handle on is preventing items on a given floor from randomizing every time the player moves between floors.

    I'd like to allow the player to return to items that he's had to leave behind, but I'm struggling with exactly how to do that.

    I've been trying to use an already-programmed function that saves all of the actors on the map, but no matter what I do, the game crashes or (thanks to the way the levels are generated) the items from the previous floor don't get deleted and end up in
    the walls on the lower levels.

    Any helpful suggestions for a clueless amateur?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From ootiib@hot.ee@21:1/5 to Fred notbob on Sat Feb 27 18:35:08 2016
    On Saturday, 27 February 2016 13:52:10 UTC+2, Fred notbob wrote:
    I've been following the libtcod C++ tutorials on Roguebasin, and one thing that I haven't managed to get a handle on is preventing items on a given floor from randomizing every time the player moves between floors.

    The tutorial seemingly contains page about persistence and about
    dungeon levels.


    I'd like to allow the player to return to items that he's had to leave behind, but I'm struggling with exactly how to do that.

    So you need to save level that you left from like that persistence
    suggests and if you return to it then reload it.


    I've been trying to use an already-programmed function that saves all of the actors on the map, but no matter what I do, the game crashes or (thanks to the way the levels are generated) the items from the previous floor don't get deleted and end up in
    the walls on the lower levels.

    Any helpful suggestions for a clueless amateur?

    It sounds that you put things of several levels together.
    When you move between levels then:
    1) save map and actors that you leave,
    2) erase, clear and delete things that you left behind,
    3a) if you have been on map that you enter then load it and its actors,
    3b) otherwise generate those.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)