Been working some more on the editor. I've implemented the ability to tweak the lighting parameters of the level, including the Front (main) light color/brightness, the Back light color and brightness, as well as ambient and fog colors. A couple sliders allow me to control the fog distance and attenuation factors. I have also implemented tools to edit water. I can edit water directly, using a brush like the other editing tools, or I can control it via a filter to fill to a given level. I can also output to the water layer from a function node graph, and the water tools respect mask settings so that gives further ability to control water placement.
I have also started work on object spawning.
The way it works at the moment is that on application load I scan the Doodads folder. Inside this folder are a number of sub-folders, one for each doodad. A doodad has a specific setup in that each folder must contain a thumbnail image and an XML editor object definition that defines the structure of the object that will be imported into the editor. Another XML file defines the object as it is to be imported into the engine. The editor object is typically just a graphical placeholder, absent all the various game-play related componentry of the official object.
After the Doodads directory is scanned, a master list of doodads is displayed on the left when the Doodads tool is selected, showing a scrolling list of all available doodads. On the right is a group window from which you can create and delete groups of doodads. When a group is created, a window appears above showing the currently selected group of doodads. Select a doodad from the master list and click Add to add it to the current set. In the doodad set, each doodad is associated with a Weight that determines the probability of selecting that doodad when applying the doodad brush. By adjusting the weights, I can make some doodads in the set spawn more commonly than others.
After a doodad group is assembled, I can use a standard brush to 'paint' doodads onto the terrain. Applying a brush iterates the radius of the brush, and generates a random number per cell, then compares the roll against a probability factor adjusted by the brush hardness and power settings, to determine whether to spawn a doodad at the given location. If a doodad is to be spawned, one is randomly selected from the set based on the probability weights then instanced and added to the map.
In addition to brush-based doodad painting, I can also run a filter to fill the entire map from a set. Both brush and filter respect mask settings, allowing me to use masks to constrain doodad placement to specific areas.
Currently, only the Doodads folder is scanned. These are non-blocking, non-interactive scene decoration elements only. For game-play-enabled objects, I will likely use a similar system but with finer controls for single-object placement. Don't really want to paint Boss enemy spawns with a large-radius brush, I reckon. Or... maybe I do....
After I implement the object spawning system, I plan to clean up and semi-finalize the savefile format, then I need to make the necessary modifications to the game itself to load these levels. That shouldn't be difficult, since most of the pieces are already there.