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

Path csiph.com!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <frednotbob@hotmail.ca>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.059
X-Spam-Evidence '*H*': 0.88; '*S*': 0.00; '"as': 0.07; 'level,': 0.07; 'mentioned,': 0.07; 'subject:Getting': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; 'static': 0.13; 'generate,': 0.16; 'guessing': 0.16; "shouldn't": 0.17; 'creates': 0.18; 'define': 0.20; 'all,': 0.21; 'trying': 0.21; '(all': 0.22; 'clock': 0.22; "i'd": 0.22; 'cc:2**0': 0.23; 'player': 0.23; 'random': 0.24; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; '(as': 0.27; 'subject:list': 0.28; 'initial': 0.28; 'participant': 0.29; 'seed': 0.29; 'served': 0.29; "i'm": 0.29; 'point': 0.31; 'room': 0.32; 'running': 0.32; 'could': 0.32; 'another': 0.33; 'entry': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'next': 0.35; 'really': 0.36; 'but': 0.36; 'generation': 0.36; 'totally': 0.36; 'level': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'where': 0.40; 'from:no real name:2**0': 0.60; 'save': 0.61; 'first': 0.61; "you'll": 0.62; 'back': 0.62; 'between': 0.63; 'close': 0.63; 'different': 0.63; 'levels': 0.66; 'sounds': 0.71; 'saving': 0.72; 'competition': 0.74; 'encounters': 0.84; 'entry,': 0.84; 'floors': 0.84; 'lays': 0.84; 'room).': 0.84; 'subject:value': 0.84; 'treasure': 0.84
Newsgroups comp.lang.python
Date Mon, 19 Nov 2012 21:45:55 -0800 (PST)
In-Reply-To <mailman.17.1353367913.29569.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=207.6.153.42; posting-account=XDBuBQoAAAA6sjyktzNtjBLLoDr_CyRH
References <SNT139-W8C22F3D436702B17D7803A3560@phx.gbl> <mailman.17.1353367913.29569.python-list@python.org>
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-IP 207.6.153.42
MIME-Version 1.0
Subject Re: Getting a seeded value from a list
From frednotbob@hotmail.ca
To comp.lang.python@googlegroups.com
Content-Type text/plain; charset=ISO-8859-1
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Message-ID <mailman.29.1353390359.29569.python-list@python.org> (permalink)
Lines 44
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1353390359 news.xs4all.nl 6874 [2001:888:2000:d::a6]:47388
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:33586

Show key headers only | 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