Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #33586

Re: Getting a seeded value from a list

Newsgroups comp.lang.python
Date 2012-11-19 21:45 -0800
References <SNT139-W8C22F3D436702B17D7803A3560@phx.gbl> <mailman.17.1353367913.29569.python-list@python.org>
Subject Re: Getting a seeded value from a list
From frednotbob@hotmail.ca
Message-ID <mailman.29.1353390359.29569.python-list@python.org> (permalink)

Show all headers | View raw


> 
> 	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....

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Getting a seeded value from a list Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-11-19 18:31 -0500
  Re: Getting a seeded value from a list frednotbob@hotmail.ca - 2012-11-19 21:45 -0800
  Re: Getting a seeded value from a list frednotbob@hotmail.ca - 2012-11-19 21:45 -0800
    Re: Getting a seeded value from a list Nobody <nobody@nowhere.com> - 2012-11-20 08:26 +0000
  Re: Getting a seeded value from a list frednotbob@hotmail.ca - 2012-11-20 18:18 -0800
    Re: Getting a seeded value from a list Chris Angelico <rosuav@gmail.com> - 2012-11-21 14:41 +1100
      Re: Getting a seeded value from a list Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-21 03:47 +0000
        Re: Getting a seeded value from a list Chris Angelico <rosuav@gmail.com> - 2012-11-21 15:00 +1100
        RE: Getting a seeded value from a list "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-11-23 16:27 +0000
        Re: Getting a seeded value from a list Chris Angelico <rosuav@gmail.com> - 2012-11-24 09:32 +1100
        RE: Getting a seeded value from a list "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-11-26 20:17 +0000
          Re: Getting a seeded value from a list Hans Mulder <hansmu@xs4all.nl> - 2012-11-27 02:01 +0100
        Re: Getting a seeded value from a list Chris Angelico <rosuav@gmail.com> - 2012-11-27 07:24 +1100
  Re: Getting a seeded value from a list frednotbob@hotmail.ca - 2012-11-20 18:18 -0800
    Re: Getting a seeded value from a list Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-11-21 03:37 +0000

csiph-web