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


Groups > comp.lang.python > #34514 > unrolled thread

Re: Issue with seeded map generation

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2012-12-08 18:03 -0700
Last post2012-12-08 18:03 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Issue with seeded map generation Ian Kelly <ian.g.kelly@gmail.com> - 2012-12-08 18:03 -0700

#34514 — Re: Issue with seeded map generation

FromIan Kelly <ian.g.kelly@gmail.com>
Date2012-12-08 18:03 -0700
SubjectRe: Issue with seeded map generation
Message-ID<mailman.640.1355015036.29569.python-list@python.org>
On Sat, Dec 8, 2012 at 2:32 PM, Graham Fielding <frednotbob@hotmail.ca> wrote:
> Hey, all!
>
> I've managed to get my project to a semi-playable state (everything
> functions, if not precisely the way I'd like it to).  One small issue is
> that when the player movs from one level to the next, the items and monsters
> in the previous level all 'reset' and return to the positions they had when
> the level was seeded.
>
> I've puzzled over (and attempted) quite a few workarounds, and had no
> success.  I don't want to pickle the entire level (that would be overkill
> for what I need), but I want to update the item/monster locations so the
> player can drop an item and come back to it later.

Make the level generation process two-step.  Step 1, build the map.
Step 2, populate it with items and monsters.  When the level is left,
save the state and positions of the items and monsters in it along
with the seed.  When re-entering a level, do only step 1 of the
process, and then repopulate it with the saved items and monsters.

Of course, if you ever want to introduce features that can actually
modify the map, then you'll need to save and reload the modifications as
well.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web