In the WorldWeaver client rewrite I have taken a completely different approach from my first go at it. The largest departure is the use of a general Element class. This is sort of a poor man's generics of sorts. Generics for a non-guru like me.
It has completely changed how everything is being done! I can now walk up through the tree of nested game elements, completely ignorant of what the parent type is. I have no idea how rough it is on the CPU etc yet, at this point it loads games, does the initial game message and properly handles Look Events/ActionSets, but it loads Rooms far faster than its predecessor.
On a side note, some things are now obsolete. This new iteration leaves the original game DB intact. When a game is played for the first time, an 'in progress' copy of it is created. To resume a game, simply load the in progress game. So I no longer have to worry about trying to restore the game database to its original state. When a game is over that in progress DB goes away. Currently it's still a bit basic - only one in progress DB at a time, so if you start a new game the in progress is overwritten. I'll improve this later.
No comments:
Post a Comment