Getting a seeded value from a list
frednotbob at hotmail.ca
frednotbob at hotmail.ca
Tue Nov 20 00:45:55 EST 2012
>
> Are you generating the entire level on entry, or as each room is
>
> "opened" (if, "as opened", you have the complication that going down a
>
> level and back up will result in different random numbers vs going
>
> straight to the room).
>
>
>
> Generating on entry only needs the seed for the initial generation
>
> point (as mentioned, first time you could use the system clock and save
>
> the value).
I'm generating the room on entry -- the 'stairs' object calls 'make_map()' which creates the floor and lays out monsters and treasure.
What I'm trying to do is set a persistent state for the levels generated by make_map(), so the player can move between floors without generating a totally new randomized floor each time.
>
> But for a dungeon -- you may be best served by generating the entire
>
> level (all rooms, doors, static encounters [traps, treasure]) when
>
> entering the level, and saving the entire dungeon (after all, after a
>
> treasure is collected, it shouldn't re-appear the next time you start
>
> that same level -- if you only save the starting seed, then all
>
> encounters will also be regenerated). In this scenario, where you save
>
> the entire dungeon, you don't even need to worry about the seed --
>
> you'll never really want to recreate the same dungeon for another party
>
> [unless running a competition in which case you seed every computer the
>
> same so every participant is running the identical dungeon].
That actually sounds close to what I'd like to ?do. How would I go about saving the dungeon? I'm guessing I'd need to define how many levels to generate, first of all....
More information about the Python-list
mailing list