On Sun, May 30, 2010 at 2:51 PM, James Paige <[email protected]> wrote:
> So seeing as I will be soon working on NPC and map state saving as a NEW
> feature, (since the limited support that was already present was broken
> for 11 or 12 years and nobody noticed (and why should they? Nobody but
> me knew it was supposed to be a feature))
>
> I digress.
>
> Suppose you release your first demo. Everybody plays it, and then saves
> their game at the end.
>
> Then a few weeks later you release your second demo, which among other
> things includes heavy revision of the NPCs on the same map where the
> previous demo ends.
>
> Everybody who continues from their old save says "the NPCs are all
> crazy! They are in the wrong place! Some of them are missing"
>
>
> How do we resolve this situation?
>
> For a while I was thinking we should have a version number of some kind
> on each map that the game author could manually incremment, which would
> invalidate old saved state for that map.
>
> So that is one option.
>
> Another option is that each NPC would have a timestamp tracking when it
> was placed/edited in the map editor. That could be compared to a
> timestamp on the save game to determine if the NPC's saved position
> should be restored.
I have been thinking a lot about this one. I have a plan that I am
pretty happy with. I have written it up on the wiki, but I am going to
reproduce it here for discussion:
=Restoring NPC locations on the current map=
* Add data to each NPC instance that indicates whether or not it's
location should be saved/loaded from the RSAV file.
* Add an edit counter to each npc instance slot
* Add the ability to mark an NPC instance to be saved in the NPC
location editor.
* Add data to the NPC definition for a default unsaved/saved setting
* Use the default from the NPC definition when placing an NPC on the map.
* Write the NPC location's edit count into the RSAV file.
* Make NPCs on the current map restorable from the RSAV file
* Add a plotscripting command that can retrieve an NPC's starting
state as defined in the map editor (in cause game authors want to use
NPC location saving normally, but override it sometimes)
=Restoring NPC locations on other maps=
* Update the current implementation of NPC off-map saving to use a
RELOAD format similar to the saved NPC locations in RSAV
* Add an option to the choices for NPC state saving that allows
them to be stored in the RSAV file.
o This will only apply to individual NPC instances that
allow saving, just like in the current-map saving.
* At load-time, re-create the saved NPC location files using
behavior consistent with the curent-map saving.
=File format to replace L lumps=
A RELOAD document. The filename would probably be something like
npcloc-#.reld where # is the map id.
* npcs - stores NPC locations
o npc int - for each npc instance. value is instance slot id
number 0-max. Nodes exist for any slot that has ever been used.
+ id int - npc id number 0-max (only saved if NPC exists)
+ x int - x position in pixels (only saved if NPC exists)
+ y int - y position in pixels (only saved if NPC exists)
+ d int - direction 0-3 (only saved if NPC exists)
+ save - node exists if NPC can be saved/loaded in the
RSAV file (only saved if NPC exists)
+ edit int - counts edits of this NPC instance slot.
Can exist even if the slot is empty (but does not exist if the NPC
slot has never been used)
_______________________________________________
Ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org