Topic Development / Scenario & Object Development / Random Thought of the Day: Prettier Placement of Plants

Currently, we place plants by randomly sampling 10'000 points of the landscape and hoping for a good position. Aaand we do that for every plant.
I'd like to do that once initially to create some sort of meta information database about the map.
For example, we could sample points (either grid sampling or monte carlo), categorize the points (cave, surface, water, lava, bla..) and then cluster them by fitting rectangles to them.
Those rectangles could be hold in some sensible datastructure (quad-tree and a simple list for every material, or whatever might help) that allows scripts to quickly find candidate positions for some landscape type.
During the game, every X frames a new random position could be sampled and used to update the rectangles so that we have continually updated information.
Especially once we have much more plants and/or bigger landscapes, this might turn out to be very useful.
I just wanted to write this down somewhere before I forget it.

I came across the same problem when I did my OpenClonk Classic stuff. I'll share my code, which is a modification of Tyron's GZE-Code shortly.

The rectangle fitting might be very nice for plants with a broad, flat bottom that looks stupid on slanted surfaces. Thinking of wheat here.



This isn't limited to wheat. Take Matthi's new tree design (for anyone who's not on Trello, see attachment). Broad, flat trunk that doesn't look good when on a slope.

I suggest adding a
FindLocation
criterion like Find_Flat
that can allows only non-slope ground/walls/ceiling? If you have an idea what "flat ground" is, that should be rather easy to add

> If you have an idea what "flat ground" is, that should be rather easy to add
Something like PathFree between x1 of (supposedly) flat surface and x2 of flat surface where y is ground-y - 5 (or so). You defined the distance between x1 and x2.
Topic Development / Scenario & Object Development / Random Thought of the Day: Prettier Placement of Plants
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill