January 26th, 2017


#1

Continuing on the Game Planner, this week I started to implement high-level Plan Features in the game engine. This includes things like ORE, OBSTRUCTION, TREES, and so on. I’m also adding the high-level parameters for the different areas. So for instance, I can now change the Clay seam in the forest at the planner level …

attributes.forestSeamMaterial = B_SOIL;
attributes.forestUnderForestStoneMaterial = B_HUSK;
attributes.forestCaveStoneMaterial = B_MOSS;

Some areas, like the forest, support multiple features of the same type. For instance to add a few different ores, including a rare silver ore that appears in the lowest level of the forest, I can write something like…

std::vector<OreSpec> ores = {
	OreSpec{ RP_FOREST_UNDERFOREST, OT_IRON_ORE, OD_COMMON },
	OreSpec{ RP_FOREST_UNDERFOREST, OT_COAL, OD_LESS_COMMON },
	OreSpec{ RP_FOREST_UNDERFOREST, OT_SALT_ORE, OD_LESS_COMMON },					
	OreSpec{ RP_FOREST_CAVE, OT_SILVER_ORE, OD_RARE },
};

Each area supports different sets of features, and offers different implementations. The tunnel, for instance, supports at most one Ore feature and deposits the ore in a completely different way to the forest. (This is because of the differing approaches to area generation.) Other features to support include MobGroups, NPCs, Containers, and World Objects. A lot of this work is just in writing the interface between the Planner and the world specification stuff. It’s boring technicalities, but once it’s done I’ll have a separate high-level layer at which the global game structure is laid out.

:moonman:

Happy Australia day!