Sanctimonia update: terrain layers progressing, video imminent

Kevin Fishburne writes in to let us know that work continues to progress on his Ultima-inspired game, Sanctimonia. In particular, he reports that the terrain megatextures that his engine uses, and the landscape layer blending it will feature, are working well; he still needs to work on the translucent tiles that fade one texture into another, though.

He will also, presumably on the Sanctimonia journal page, be releasing a video in the next little while, which will demonstrate the in-game camera and how it smoothly follows the player. It is, he asserts, “pretty cool.”

He also includes this screenshot…

[singlepic id=847 w=500 h=256 float=center]

Where, oh where, is this?

…and poses a bit of a challenge: “if you look at the minimap in the screenshot you may recognize the location from Ultima IV – VII.” (The final game map will be, I’m told, substantially larger and better-proportioned, such that one won’t easily be able to recognize Britannia “from the ground”.)

4 Responses

  1. fearyourself says:

    Great work on the multi-texturing, is it me or does using that icon for the character seem a bit off.

    Otherwise, it’s looking good, I’d have questions of performance but you talk about it in your post so keep up the good work 🙂

    Jc

  2. Sanctimonia says:

    Thanks.

    The camera eventually centers on the bottom-middle of the icon (feet area), but I took the screenshot while I was running around so the camera hasn’t caught up yet. If you compare the cell grid coordinates with the camera coordinates you’ll see they’re different.

    I want to get the hill shading and water at least partially working before recording a video, so I’ll try to do that today.

  3. darren says:

    Ah! I see what you mean. Something like this could be interesting. I like the transitions between tile types.

  4. Sanctimonia says:

    Yeah, the way it’s done is a little crazy. Basically each tile is 128×128 pixels, but the image used for each tile is blitted from a 2048×2048 seamless texture depending on the tile’s position. The code I use to determine where in the “megatexture” a tile should be blitted from is something like:

    px = (x Mod 16) * 128
    py = (y Mod 16) * 128

    where x,y are the coordinates of the tile on a 96×96 grid of tiles and px,py are the upper-left pixel coordinates of the 128×128 pixel blit taken from the 2048×2048 texture and used for the tile. That works because 128 * 16 = 2048, 96 is evenly divisible by 16 and the 2048×2048 textures are seamless.

    The way the borders between different tile types are made seamless is by treating each tile type as a separate layer. So from bottom to top the layers are bedrock, sand, soil, vegetation and snow. A landscape tile is rendered from all of these layers, starting at the bottom, and choosing the appropriate interconnective alpha tile after each layer is rendered. So it basically goes like this to do one tile:

    Write bedrock tile to tile buffer
    Write tile buffer to landscape buffer

    Write sand tile to tile buffer
    Check pattern of surrounding sand tiles and write appropriate alpha tile to tile buffer
    Write tile buffer to landscape buffer

    Write soil tile to tile buffer
    Check pattern of surrounding soil tiles and write appropriate alpha tile to tile buffer
    Write tile buffer to landscape buffer

    Write vegetation tile to tile buffer
    Check pattern of surrounding vegetation tiles and write appropriate alpha tile to tile buffer
    Write tile buffer to landscape buffer

    Wash, rinse, repeat if necessary. 😉