Getting a seeded value from a list

Hans Mulder hansmu at xs4all.nl
Mon Nov 26 20:01:10 EST 2012


On 26/11/12 21:17:40, Prasad, Ramit wrote:
> Chris Angelico wrote:
>>
>> On Sat, Nov 24, 2012 at 3:27 AM, Prasad, Ramit
>> <ramit.prasad at jpmorgan.com> wrote:
>>> Steven D'Aprano wrote:
>>>>
>>>> On Wed, 21 Nov 2012 14:41:24 +1100, Chris Angelico wrote:
>>>>
>>>>> However, this still means that the player will see the exact same level
>>>>> regenerated every time, absolutely fresh. As previously stated in this
>>>>> thread, that's not usually a good thing for encounters, treasure, etc.
>>>>> Once some nasty critter has been killed, he should STAY killed! :)
>>>>
>>>> Why? That isn't true in real life, why should it be true for games?
>>>>
>>>
>>> It is not true in all games. I have seen games where treasures
>>> regenerate in the same location except for key items. Same goes
>>> for enemies (where only "bosses" do not regenerate). It really
>>> just depends on the type of game you are playing--designing
>>> in this case.
>>
>> Perhaps they regenerate, but do they regenerate from the exact same
>> random seed? For instance, in Murkon's Refuge, the maps are
>> handcrafted and thus constant every time you enter a particular level
>> - but go downstairs and upstairs, and the monsters and treasure
>> regenerate, different from last time.
>>
>> Of course, if the idea is that you're rewinding time, then it makes
>> good sense for you to see the exact same pattern of enemies.
>>
> 
> Hmm. I guess most of the games where I remember "regenerating"
> enemies are a bit older. Chrono Trigger had enemies that 
> would regenerate if you left a map screen and came back, but
> then again it seems more likely that the enemies were hard
> coded and not "generated" at all. Either that or they [games] are
> like Diablo/Castlevania where monsters are constantly "generated".
> 
> I still hold the opinion that the seeding behavior depends on the 
> game. I wonder what Nethack does?

When you leave a level, Nethack saves it to the hard disk.
When you return, the level is reloaded from disk, so monsters
and objects appear where they were when you left the level.
The map is also saved, so if you had dug an extra corridor
on your first visit, it'll be there when you return.

The random level generation only happens if you go to a level
you haven't visited before in that game (and sometimes not
even then).

-- HansM



More information about the Python-list mailing list