Wednesday, May 4, 2011

More details

The Physical World

The physical world is the simulation of the world and the objects that exist within it. Terrain is considered part of the physical world, as are objects and mobiles.


The world will, initially, consist of “blocks”. These blocks represent a 1x1x1 meter cube. Terrain will consist of blocks of terrain strung together. Blocks will have two fundamental properties for interacting with the physical world: that of opacity and solidity.

Opacity will determine if the block actually blocks line of sight, just as in real life. Opacity will be able to be set to various percentages, to allow for partial visibility.

Solidity determines if the block is something like air, or if it is a stone. A solid block will prevent other items from existing in the same coordinate triplet as it, while a non-solid block will not. We can use non-solid blocks to represent effects like air, water (which might be semi-solid), by changing how fast people can move through it.

Ambient Descriptions

Blocks are also going to be able to provide ambient descriptions. For example, a forest block, (or a block making up one of the trees, whatever) could provide a descriptive line of text as the player walks over it. It could even gather ambient descriptions from other nearby blocks and combine them all into one description.


The world will exist on a 3D Cartesian Grid, with 0,0,0 being the origin. The entire world will be contiguous; no areas, no zoning. However, the goal is to hide as much of coordinate system as possible.


Rather than exposing the user to the coordinate system directly, navigation will be by a Landmark system. Players will be able to memorize the location of certain structures (perhaps a building, mountain, store in a town, whatever), and then just type go landmark, and we’ll automatically pathfind them a route there (for a game, this could be influenced by skills, I suppose).

Alternatively, you could give people the option of walk “heading” and let them specify a degree parameter, if they just want to wander.

Line of Sight

LoS will be handled rather simply, at least at first. Blocks (and thus objects) will have an opacity factor. To start, fully opaque or fully transparent. LoS will be checked using a modified version of bresenham’s algorithm to check for occlusion.

The real challenge is going to be combining the descriptions of all visible objects into one coherent text paragraph.

For example, if Bob is standing at 1,1,1, and there is a building, 30x30x30 building at 25,1,1 but also a, let’s say...a cow standing at 5,1,1, we have to incorporate the descriptions from both. One possibility would be:

Approximately 25 meters ahead of you stands.... 5 meters in front of you stands a .

It would basically be a matter of keeping a list of all objects in a AxBxC radius and checking each for visibility and sending the descriptions.

Descriptions of Objects under various conditions

So, one of the advantages this system has is the ability for an object to be viewed from different perspectives. A building, represented as a cube, has 6 faces. Theoretically, a player could be viewing it from any side, above, or below. And a player viewing it from one side could not very well see the face on the opposite side. With a 3D system, we have the ability to determine what face they are viewing.

Assume we have a 25x25x25 building. On the Eastern face, we have the main entrance. Bob is facing the Eastern face, and sees...

You see the main entrance here.

But if he moves around to the West face, where the loading/unloading docks are, we might see:

You see the loading/unloading docks here.

Not only can we change descriptions based upon the face being viewed, but we can change it based upon other conditions. If it is dark, then it might have another description. If it is foggy, we could have a partially obscured description.

So, building becomes less creating an endless series of rooms and typing descriptions as it does constructing objects and describing it from various perspectives.


I've got more, but it is getting into tl;dr territory. More later.

No comments:

Post a Comment