Friday, January 05, 2007

Well Im Back

I know, I know, its been forever. I disappeared for over a month finish up school. Then i've been home for a while but distracted. My brother got Medieval II: Total War for christmas, and like my beloved Shogun: Total War its a decent game. Unfortunately it feels like the game was released on a much rushed schedule, quite disappointing. There are quite a few features that either seem left off or partially done.

On a better note however I started diving into the code again today. My goal for the break is to redo the world stuff. Going to be striping and rewriting a lot of these classes to get this done. The new system is quite complex, and is being designed straight from the persistance point of view. The same way of thinking will spill over to beings and items too when I get to rewriting them. Unfortunately however there will be a lot of code to rewrite to make it all fall into place. It could be several good days of coding before I even have something I can attempt to run.

I'll try to outline the new system briefly here, maybe it will allow me to organize my thoughts for myself and make some progress in design. The world will consist of the same grid as before, but instead of being populated with rooms it will be populated with nodes. The grid will always be loaded null, and as the world tries to retrieve rooms it will check to see if the nodes should be loaded from the database. When it encounters empty nodes it will place an empty node object to represent this, saving search times the second time around.

Each node will then contain a linked list of rooms, representing the rooms at that x/y coordinate. These rooms will have altitudes to differentiate themselves. When the game selects a room to enter in a particular direction it will check the rooms in the node you wish to enter and select one based on enterance type flags, and the room's altitude relative to the player's.

To further facilitate room effects, and persistance saving and caching I plan on including a system of world actions which can be targeted to rooms or nodes, and possibly expanding to beings and items down the road. These actions could be a save or delete room, or also represent the fire or flood effects on a room, which would need to be regularly checked and updated as needed. The world object will store a queue of these actions and execute them, and requeue them as neccesary. The world will be given a set amount of the game's tick time to handle these actions. These actions should probably have a minimum number of ticks that must pass before being allowed to execute to allow things like fire effects for example from taking over and spreading more quickly during light load periods. Another option I suppose I could take would be writing some sort of scheduling tool to schedule particular events for the future, I guess i'll feel it out as I go.

Well, thats about as much as I really feel like explaining tonight, I guess i'll maybe get into more detail tomorrow as I work at this. Hopefully I wont go insane before its all done, it feels quite daunting.

Later,
Toraux

No comments: