Sanctimonia: Depth Testing and Persistent World Objects
The latest monthly report from Kevin Fishburne’s Sanctimonia project is fairly short and to the point, but it contains a pair of developments that are fairly significant to the game’s development:
The first is the implementation of OpenGL depth testing:
Depth testing is an OpenGL method of displaying geometry such that all or parts of it are occluded by geometry that is closer to the camera. When depth testing is disabled, objects are rendered completely in order from first rendered to last, like dealing from a deck of cards. When depth testing is enabled a depth mask is modified as each object is rendered which represents the distance of each rendered pixel from the camera, and subsequently rendered objects are occluded if their “depth” is farther than that of the corresponding pixels in the depth mask. The additional functionality provided by enabling depth testing complicates rendering logic and was not anticipated at the time I created the initial design document for the game.
Of equal (or perhaps even greater) importance is the addition of a particular class of persistent world object – blocks:
One of the core activities players will be engaging in is the construction of buildings, whether fences for livestock, simple huts, comfortable manor homes or impregnable castles. Buildings are to be comprised of specialized PWOs called “blocks”, much in the way a building may be constructed of Lego bricks. I began the rendering infrastructure for displaying blocks by creating the procedures Block and BlockQuad. Block is called when a particular block needs to be rendered. Block then sets the OpenGL texture(s) and makes multiple calls to BlockQuad to construct the individual block. Unlike normal PWOs, blocks are always oriented along the cardinal directions and their position is snapped to a resolution of one foot squared.
After some initial brainstorming I decided there will be a dedicated interface players will use to construct buildings due to the inherent complexity and potential for costly mistakes. Essentially players must possess parchment and a writing utensil and will be presented with a full-screen canvas upon which they will design the building. Options will exist to survey the surroundings and sketch them in as a point of reference and to change the scale of the “grid” into which the blocks will be penned. Players will be able to choose the wall type (horizontal, vertical, cross intersection, T intersection, etc.), material type (stone, brick, cob, wood), flooring, windows, doorways and roofing. Once the design is finished players will be able to initiate construction by themselves or with the help of other players. The raw materials for use in construction (as the design plan requires) must be within a certain radius. I plan to implement construction AI so players may sit back and watch as it happens, mostly to alleviate the tedium and complexity of players having to construct a building manually.
This being the good Mr. Fishburne, there is (of course) a video demonstrating the block system in its rudimentary state:
He has also been tweeting about the blocks a fair bit of late:
The infrastructure and logic for creating blocks (architectural PWOs) began tonight and went well. http://t.co/g2LnDh0zVo More to come!
— Eight Virtues (@eightvirtues) June 29, 2013
Good work on block construction tonight. I'm having to resort to pencil and paper to keep the quad vertex and texture coordinates straight.
— Eight Virtues (@eightvirtues) June 30, 2013
Working on getting block textures to wrap around the edges. Not my forte, but acceptable results so far. I'm pretty excited about buildings.
— Eight Virtues (@eightvirtues) July 2, 2013
Brutal and torturous work tonight on getting block textures to wrap properly. Not quite there yet, but when it drops it will be outstanding.
— Eight Virtues (@eightvirtues) July 4, 2013
As always, it’s great to see such significant progress being made on this project!