Issue with seeded map generation

  • Thread starter Graham Fielding
  • Start date
G

Graham Fielding

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 theyhad 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. Should I add something to the 'drop_item' function, or call soemthingin make_map?
 
H

Hans Mulder

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

Should I add something to the 'drop_item' function, or call something
in make_map?

I think pickling the entire level would be the sensible thing to do.

The alternative would be to keep track of everything that changed
on the level and redo all those changes of the player returns to
the level. That's a lot of work. Moreover, everytime you add a
feature to the game, you'd have to extend your keep_track() and
redo() functions, so they can redo the new thing, too.


Hope this helps,

-- HansM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top