All graphical rendering for kingdom is managed through OpenGL.  Actors are represented as colored spheres, and objects as colored cuboids.


The engine is written entirely in Java, with OpenGL calls through JOGL. All object tracking is handled through a basic tree system, where each node holds three types of information: the type of object to draw, pointers to its children and parent, and the transformations to apply. The tree is structured so that any transformations applied to one node are also applied to all its children. So, for example, if we have a node that holds a desk and has a child node that holds a chair, we can move them as a group by translating just the desk. The root node holds no specific object, but is the parent of all other objects in the scene. Because of this, transformations applied to the root allow us to easily rotate, zoom, and move about the space.

The rendering logic is kept almost entirely separate from the game engine logic, with the one exception being that each entity holds a pointer to its node in the scene. During each update the scene graph reads the spatial information from each entity and alters that entity's node accordingly.