eolesen, on 22 February 2024 - 02:28 PM, said:
For a developer..... How hard would it be to take the following boundary and populate a forest within it?
PolyForest ( UiD ( 132 ) TreeGroup ( JP2AutoTree1.ace, JP2AutoTree2.ace, JP2AutoTree1.ace ) ScaleRange ( 0.9 1.1 ) Population ( 10 ) TreeSize ( 16 20 ) StaticFlags ( 00000000 ) Position ( -92.0677 0.87081 -118.481 ) QDirection ( 0 0 0 1 ) Points ( 6 Point ( -92.0677 0.87081 -118.481 ) Point ( -108.81 0.894868 -73.4293 ) Point ( -104.485 1.51015 -190.919 ) Point ( -78.2488 -1.51429 -122.839 ) Point ( -95.0944 0.857233 -144.572 ) Point ( -95.5375 0.855669 -147.224 ) )
This looks like a great idea!
In terms of the data:
- Position - could be skipped if the "Point" values were absolute within the tile
- QDirection - could be skipped as any rotation in the editor can update the "Point" values instead
- Point - could be just 2 values, as forests always follow the terrain, you don't need a vertical position
Either way, none of these are major issues, just suggestions that could simplify the data and the code in Open Rails.
As for tree placement itself, probably the simplest option is to work out a bounding box (easy by doing min/max on the "Point" values) and place trees into that box using the same algorithm as currently except also checking if they are inside the polygon defined by "Points". I believe checking inside/outside of a single polygon is a pretty easy thing to do.
Looking forward to seeing the first poly-forest!