Topic Development / Scenario & Object Development / Random Thought of the Day: Prettier Placement of Plants
..or 'The Story of the Monte Carlo Cave' RFC.
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.
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.
Good thoughts. A forum posting will definitely not be forgotten and drop off the list after a few months.
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.
Just another thought:
The rectangle fitting might be very nice for plants with a broad, flat bottom that looks stupid on slanted surfaces. Thinking of wheat here.
The rectangle fitting might be very nice for plants with a broad, flat bottom that looks stupid on slanted surfaces. Thinking of wheat here.
The wheat could also just be rotated to fit the ground, though :)
If you offset the bone rotation by the negative amout so that it still points up, this could be a nice approach.
Problem is, you have to put a lot of effort into making the plants customisable. Like what Matthi suggested, bone rotation and so on. You can't just rotate the whole plant because even if on a slope, plants grow straight up.
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.
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.
Yes, okay. That would not be covered by the original idea in this thread though, because I guess that would need to only estimate the landscape to be useable performance-wise.
I suggest adding a
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