This document outlines how the new MOHPA scatter tool will be used by artists.
First you need to generate a snapshot of the map that need to be scattered.
In Radiant, with map open, select menu �file->Reference Snapshot�. This will generate a snapshot of the top view of the map and ask for saving to a �.tga� file. Make sure the terrain texture is enabled by clicking the �Ter in 2d� button on the toolbar.
Then you open the snapshot file with Photoshop. For each group of models, you create a layer, give it a proper name like �trees�, �rocks� etc. Then you paint in that layer. The image in that layer will later be used as the density map by the scatter. The actual color doesn�t matter, the scatter tool only care about the alpha channel. The area with less transparency will result denser objects in the map. You may use some filters to generate a smooth gradient from different alpha areas. After painting the dense image to all the layers, save the file as a �.psd� file.
Go back to Radiant. Select the menu �Scatter->Configure Scatter�. This will bring a dialog like this
The rules file and the density map file controls how the scatter tool put the models in the map. Set the �rules file� field with whatever rule file (�.rul�) you need.� If you do not have a rules file for this map, then entering the name of a file which does not exist will force scatter to create a new �empty� rules file.
Set the �Density map file� field with the psd file you created in last section. Fill in proper values to other fields:
The density scale setting is a mechanism for manually scaling the density of scattered objects, without having to modify the density map.
Scatter units per game unit:
Scatter always deals with measurements in meters (except for gradients, which are measured in degrees).� This field is a scale value for manually converting map measurement units into meters.
The vertical scale field is a method for manually converting the values held in the .R32 heightmap file (created from the terrain editor) to meters.� (Note: when running a set of scatter rules, the debug output window will display the min and max values found in the .R32 when it gets loaded.� This can be used to help you calculate the correct setting for this value.� It defaults to 1000, but this may not be correct for the map that you are generating.� If you have any doubts, then contact the artist/designer who generated the terrain, and find out what the min and max heights for the terrain were designed to be)
If you have loaded in a new rule, or you want to do some changes to the rule, click the �Edit rules� button. It will bring in this dialog box.
One rule file contains multiple rules with different name. Use the pull down menu to choose which rule you want to edit, or create new rules, or delete the current rule.
- Layer name: Is the layer you put in the density map with Photoshop.� When a rule is executed, it uses this exact name to look up the correct layer in Photoshop.� The layer name is case sensitive, so the layer name here MUST exactly match the layer name in Photoshop.
- Model/Class: Is the model you want to scatter. This can be either �.gr2� or �.hag� file.� Use the filespec drop down menu in the file open dialog to select either .gr2 or .hag. You can also put the class name here. For example, put �info_pathnode� without quotes will make the scatter tool scattering pathnodes.
- Regular Distribution: There are three options: none, square, and hexagon. If set this to square or hexagon, the objects will distribute regularly in square shape or hexagon shape. The distance between adjacent objects will be �Exclusion min� value (see below). This option was designed for scattering path nodes, but can be used for other model/class as well.
- Sub Rules: You can leave it blank or choose one rule in the rule list as the sub rule. If you set a sub rule, after the scatter tool places a model with main rule, we call it �main-model�, it will place some models using the sub rule around this main model, we call them �sub-models�. This is useful for example when you want to put some small bushes around a tree. The distance between the sub-models and the main-model will be within the �min distance� and �max distance�; the total sub-model count will be with in the �min object count� and �max object count�.� Note, however, that the min/max object count is not a guarantee.� The program may not be able to place the specified number of objects because of other considerations (gradients, heights, other objects in the way, etc)
- Exclusion: This controls the valid distance between the new placed model and the existing model in the map. For example, with the min set to 1, max set to 2, each model will be at least 1 units away from any other models and be within 2 unites to at least one model.
- Elevation: These values control the distribution of the models regarding to the elevation of the terrain. Consider the �inner value� and �outer value� as the inner and outer radius of a donut shape. Roughly, all the models will be placed where elevation is between �outer min� and �outer max�. See the drawing:
In the area with elevation between inner min and inner max, the models distribute with full density; in the area with elevation between outer min and inner min or between inner max and outer max, the models distribute with density various from 0 to full density.
-���� Gradient: Similar to the elevation but the values apply���� to the gradient of the terrain.�� These values are measured in degrees.
-���� Debug color:� This is used for debugging purposes, and its use is not required.
-���� Start seed: If you are not satisfied with the result of previous running of scatter tool, change this number to any other integer numbers. The scatter tool will then generate the models with another set of random numbers.
-���� Align object with surface gradient: Not implemented yet.�
-���� Light weight entity: Not implemented yet.
-���� Ignore Preexisting objects: If set, scatter tool will ignore the committed objects when scattering new objects. Be sure to alternate the random seeds if you set this option otherwise two groups of the scattered objects will overlap completely.
After you configure the scatter tool, you can run the scatter tool by selecting menu �Scatter->Run Scatter Tool�. This will actually generate the models based on the rules. Or you can select menu �Scatter->Run Scatter Tool (Selected rules)� to select only one rule from the rule list. Depending on the set up, the running will take several seconds to a minute.
- Commit selected entities: Commit the entities so they won�t be removed later by scatter tool. The scatter tool removes all the uncommitted entities before it generate new set of entities.
- Uncomment selected entities
- Select all the scattered entities: Select all the entities generated by the scatter tool
- Select only committed entities
- Select only uncommitted entities