How iForest Works









iForest is a big, self-organising, multiplayer game, written completely in Java.

Everything is stored as a big pile of XML documents. When you enter a location, the XML file for that location is parsed and Java objects are created to represent everything in the location. For example, the location might contain a description, several exits, a couple of objects, and a few players, who each are holding some objects. 

When you make a move you interact with the XML file in your location, and the XML is then saved back. The XML is handled through a custom-made generator/ parser to keep it nice and fast. There's no reason why the game has to use XML- the design's modular, so it could quite easily be made to use a database. I just like the idea of everything being in XML, as I can get at it with a text editor if I need to.

The game is self-stabilizing, so doesn't need someone keeping an eye on it. Every now and then a location will reset itself to its initial state, tidying up any objects that are lying around, and replacing objects that have been taken away. This means that you may get some objects being duplicated, and some disappearing, but it all averages out to a stable state.

It would be very easy for the iForest world to get quite crowded, especially as players fall asleep when they're not being used. For this reason a player will only remain visible for a short while after falling asleep. After this they disappear until the player next logs in. If there are lots of players in a particular location, the game doesn't give you a list, it just says "lots of players are here". This is because WAP screens are generally the size of a postage stamp, and a list of 50 players to scroll through wouldn't be very helpful. 

The "fairies" in the game are actually special characters who can perform housekeeping tasks to keep the game in order. There are also a few Bots around, which should provide a bit of movement even if no one else is playing. They are fairly easy to spot, as they have pretty dull names and won't attack you.

The iForest game engine is quite general, and should be applicable to lots of different scenarios, not just running around forests with sticks. If I get the time, I might make a sci-fi version. 

Back to techy details

wap.useeverything.com