
Now that the scripting is somewhat in place I've begun to make the server work again. About a month ago I decided to restructure the class hierarchy on the server and at the same time move all policy specific code into scripting. The restructuring is nearing completion and is in a workable state. Yesterday I succeeded in making the first Actor class from scripting world, namely the Player actor. The player actor is quite essential since it's the one that you can control. You can currently control the player, but the collision stuff is not working right now. This is mostly because I've decided to move the terrain model onto a class of its own. The old way was to have it embedded in the Shard class, but since the shard class should just be a kind of container for all actors etc. in the "world" I think the terrain should just be another kind of actor. No special treatment there. This also opens the possibility of paginated terrains which I've had in mind all along (And discussed with Bue, one of the other contributors to the game). I should be fairly easy to get collisions up and running again though.
There is just one thing that I've not decided upon yet: The old way of handling collisions from script was to register a handler on an actor that would be called when the actor collided. Now that we have actors derived in scripting world, we get a callback automagically since all collidable actors have their 'collision' method called. Thus, you can just override the collision method and do your logic here. This of course makes the collision logic per class and not per object as ealier. I quite frankly don't know what model is the best. The the new 'collision' callback method will be available under all circumstances. I just have to figure out if I can omit the other way of handling collisions, but still have a nice scene description format (xml) without to much code and as much declarative stuff as possible. This will make it easier to create the planned editor later on.
1 comment:
Cool.. keep up the good work
Post a Comment