Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #34503 > unrolled thread
| Started by | Graham Fielding <frednotbob@hotmail.ca> |
|---|---|
| First post | 2012-12-08 13:32 -0800 |
| Last post | 2012-12-08 23:53 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
Issue with seeded map generation Graham Fielding <frednotbob@hotmail.ca> - 2012-12-08 13:32 -0800
Re: Issue with seeded map generation Hans Mulder <hansmu@xs4all.nl> - 2012-12-08 23:53 +0100
| From | Graham Fielding <frednotbob@hotmail.ca> |
|---|---|
| Date | 2012-12-08 13:32 -0800 |
| Subject | Issue with seeded map generation |
| Message-ID | <mailman.633.1355002410.29569.python-list@python.org> |
[Multipart message — attachments visible in raw view] — view raw
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. Should I add something to the 'drop_item' function, or call soemthing in make_map?
[toc] | [next] | [standalone]
| From | Hans Mulder <hansmu@xs4all.nl> |
|---|---|
| Date | 2012-12-08 23:53 +0100 |
| Message-ID | <50c3c4ec$0$6887$e4fe514c@news2.news.xs4all.nl> |
| In reply to | #34503 |
On 8/12/12 22:32:22, Graham Fielding 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 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
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web