MV3D Development Blog

August 7, 2006

Enter The New Multiverse3D

Filed under: Uncategorized — SirGolan @ 4:53 pm

So I decided to throw out the hundred thousand lines of code in the old MV3D and start over. Sounds silly, I know, but taking the old code and fixing it would be much more of an effort. For this version, I have a pretty strict plan of how I want to go about programming. For each feature, there should be four phases: plan, document, impliment, and test. They should happen in that order. I feel that if I stick to that method, I’ll have some pretty good code and will hopefully reduce the amount of refactoring or redesigning I will have to do. I will say that so far, I’ve been doing poorly on the ‘document’ side of things. I’ll have to remedy that. On the flip side, what I have so far is well planned out, written, and tested code. My other ideas on how to make this effort be more successful are to use 3rd party libraries wherever possible, use Python as much as I can, and to concentrate on getting the hard/unfun parts (which basically comprise the foundation of the game) done before moving on to anything.

Did I mention that the new version of MV3D will be open source?

Now I’ve been working on the new MV3D for a few weeks now. It’s at about 5,000 lines and the part I’ve written is all Python. It currently uses Twisted and PyODE (a Python interface to ODE). There are about 70 unit tests written as well (which are included in the 5,000 lines and are almost 3,000 lines). I’m not writing the Client part of things at all right now. I want to get a very stable server with most of the functionality it needs finished before working on the client. The unit tests have been used to make sure everything is doing what I think it is doing. Here are just some of the cool things the 2000 lines of server code can do:

  • Run as many servers on a system as you want. You can even run multiple servers from within the same program! That’s something I never would have dreamed of in the old MV3D. It’s also what allows me to do very complex unit tests with ease. (I.e. dropping an object and making sure it lands at the same time on two servers)
  • Security system. Most things have security permissions associated with them. When a remote user attempts to do anything on a server, his account is checked against the permissions for the object he is accessing/modifying. The permissions are extensible, so for instance, areas can disallow players from entering them.
  • Player accounts are almost fully functional. They allow the player to connect to one of several PCs. Players can belong to groups (which can be used in the security system)
  • Physics Integration. I just finished testing collision detection and response.
  • Multiple servers can talk to each other and can do basic load balancing. You can log into any server and as long as you have an account on a registered Account Server, your login will work. Servers can be primary, secondary, or caching servers for areas, objects, and realms (new name for regions). When you add an area to a realm, it finds the simulation server with the lowest load to simulate it on.
  • Objects, Areas, and Realms are extensible. By subclassing the Object class, you can create an object that does anything.
  • Everything is a container. You can put an area inside of your bag of holding.

    I could go on, but in short, the functionality I can get out of ~2,000 lines of Python is pretty amazing. There are some things left to do before I can start working on the client:

  • Asset tracking system. Currently, there is no concept of an asset. This needs to go through all the phases (plan,document,etc)
  • Factories. Things that generate other things. This ties in to the modular models approach. It’ll probably be similar to Siegium, but still needs to be planned.
  • InterArea collisions. Objects on the edge of two areas need to be tested for collision between the areas. Planned, but not documented.
  • Server executable. Currently, only exceutables exist for the unit tests. There needs to be a server executable.
  • Server configuration. Some sort of config file for servers would be nice.
  • Object persisting. Would also be nice to allow objects to persist. I have decided that I’m not going to harp on this one because when the game is really running, we will almost never need to grab an object off of disk or whatnot because it’ll be in a constant state of being simulated.
  • Player Interface. Got to figure out how the Player Interface works. Plan phase
  • Player Movement. It’s that physics control issue again. Steering like a four wheeled catapult won’t be very helpful here. (maybe marginally though)
  • Terrains. Plan phase

    A short term goal of this project is to get a server up and operational that will stay online 24 hours a day. The current server is very solid and doesn’t crash or error out (as would be more likely in python). The unit tests abuse it pretty well, too. Once there is a server up all the time and the Windows client is stable and usable, I’ll start asking around for alpha testers. It’ll be a boring job– especially at first. Because there won’t be much to do. But if you like QA and finding software bugs, maybe it’ll be fun. :)
    One of the other things I’m going to try is to go it alone. As I mentioned in my previous post, adding team members kept me from working on the game while training them and they generally didn’t contribute much. Unless I find an insanely good programmer or artist who can devote 15-20 hours a week to this, I’ll continute to work on things on my own for the forseeable future.

  • No Comments »

    No comments yet.

    RSS feed for comments on this post. TrackBack URL

    Leave a comment

    You must be logged in to post a comment.

    Powered by WordPress