Xygax, how did you do it?

Started by mansa, April 10, 2006, 09:01:36 AM

Hey Buddy.

How'd you do it?  How'd you update ol' Ginka to remove the Saturday Downtime?  What progress is different, immside?

Curious mansa wants to know...


***


Added after the Halaster remark


***

Does this mean that there may be an introduction of a 'save room' feature, for when i strip all my clothes items off and change into a different pair, and not have to worry about losing them?  Or loading up a wagon with special items and travelling to another city, and then having to save the contents of the wagon, as well as the wagon itself in a new city?
New Players Guide: http://gdb.armageddon.org/index.php/topic,33512.0.html


Quote from: Morgenes on April 01, 2011, 10:33:11 PM
You win Armageddon, congratulations!  Type 'credits', then store your character and make a new one

In order to make a change to a room that involved npc's/objects, the entire zone had to be cleared, reset, and frozen, then the changes got made, then the zone had to be saved and unfrozen.  So, if I wanted to add a new soldier to the gates of Allanak, I had to basically purge all of Allanak, and reset it, and so on.  Obviously this isn't something we could do during normal play.

Xygax made a new way for us to do this, wherein we can make those changes on a room-by-room basis and not have to reset a whole zone.  We -can- still reset a zone, but don't have to.
"I agree with Halaster"  -- Riev

Quote from: "mansa"Does this mean that there may be an introduction of a 'save room' feature, for when i strip all my clothes items off and change into a different pair, and not have to worry about losing them? Or loading up a wagon with special items and travelling to another city, and then having to save the contents of the wagon, as well as the wagon itself in a new city?

This is obviously a top thought on our mind, we don't like doing reimbursements any more than you guys like loosing items.  Currently wagons automatically save with every room they move.  Figuring out some way to trigger a room save at the appropriate time is the trick to this issue.  Hopefully future changes will make this decision easier.
Morgenes

Producer
Armageddon Staff

I'd like to add that a lot of the credit for this can be given to Eniriah, who during a moment of featherbrainedness, accidentally deleted several of the major rooms in the T'zai Byn compound, and re-strung them as Salarri quarters.

After giving her a solid kick in the pants, she went back to fixing the issues...where she discovered some odd bug which prevented her from saving the NPCs and objects properly in the rooms which I made her rebuild (and which earned her a few more kicks in the pants by me). The bug fix for this turned out to be (or lead to) Xygax's change.

So: Hurray Eniriah! We plan on orchistrating a way for her to accidentally delete Allanak, so we can put in that hyper-inteligent, self-aware crime-code change everyone wants.
Tlaloc
Legend


I have actually been wrestling with the zone save code for a while trying to achieve this functionality.  The end result was approximately 1700 lines of code changed across several files, and the real work is still not complete.

Since the game runs with multiple threads now (a separate I/O thread currently handles I/O intensive functionality, like DNS and our file-system punishing character search -- this is something I added a little over a year ago, iirc, and it could easily become a pool of threads, if need-be), it would be possible for us to mark rooms "dirty" whenever you drop something in them or pick something up, then save the rooms that have changed on every pulse by passing off the serialized data to our I/O thread(s).  Unfortunately, the per-room saving code is also relatively CPU intensive, due to a relatively poor choice of data-structures in the original implementation, which I did not change in my recent wrestling match with it.

The code that I did change seemed like a reasonable "bite"-sized task, low-risk with potentially huge rewards -- like no downtime -- so I started with that.  It turned out to be less bite-sized than I had hoped, and I engaged in a lot of cleanup-refactoring also, but it was still a smaller job at ~1700 lines than the REAL fix, which is to rewrite all of the serialization routines from scratch.

We'll do that when we start using a real database, and that will both resolve the CPU-load issue, AND lessen the I/O burden (and the risk of synchronizing save-I/O incorrectly).  We're waiting for MySQL 5.0 for that, since I'd like to take advantage of prepared statements, rather than building SQL strings.  Once that happens, it will be much simpler to put save-rooms in any zone (right now, we implement this through a kludge where we periodically save a few special zones in their entirety), and to handle room-saving much more responsively than the current 30-minute save cycles.

The side-project of helping builders track down errors in placing NPCs became drastically easier about half-way through this rewrite (I had added a feature to track where NPCs spawned to aid in scratching them out of room-saves when a room got saved without them in it), so I did that at the same time.  Builders are now notified when the act of saving a room or zone has left an NPC "orphaned" or duplicated.

-- X