Client-server design

Server side

The server provides a number of remote interfaces that can be used externally to access the White Orb world.  Here is a summary of these interfaces and how they are used.

Client side

Now you know how the server provides access to the world.  Note that the server doesn't really know anything at all about which type of client is logged on - it could be a text terminal or pretty much anything for all the server knows.  That's good - it means we can create whatever crazy clients we want in the future, without having to touch the server code.  Now I will describe my particular client design.

Image and graphics handling - now and in the future

The ClientContext provides methods for retreiving the actual Image object for any given image filename.  On the whole the image handling is very simple right now and will be improved in the future.

First of all, images will be referred to by ID instead of filename.  The server will contain a global ResourcePool or something like that which will map the IDs to the actual images.  The client will get access to this resource pool, probably by maintaining a copy of it's own that is updated by the server.  In the long run the resource pool will also provide access to things like sounds, animations, and other fun stuff.

Right now each item is associated with a single .gif file containing it's icon.  In the future this will be expanded so that the .gif file can contain many different icon representations of the same item in different situations (chest open, chest closed, Orc sleeping, Orc dead, etc).  All in all the whole concept of how an item is graphically represented will be encapsulated in higher-level display managers.  No filenames will be directly referenced, each file will be provided via the ResourcePool and the contents of each file will also be indexed using some kind of FileInformation object - so that .gif files can contain more than one image without complicating the game.

This means the client will be able to dynamically update the graphical representation of an item, and will also perform animations when certain events happen.  As usual, the client itself will be pretty "dumb".   Instead, the display managers provided by the items on the server will listen for events and request animations to be performed when necessary.


Henrik Kniberg

Last updated: