Hi. As it says it the title, I’m looking for a clever way to implement a large environment completely covered in objects that are somewhat dynamic. Think of it like grass that can be cut and then regrow over time, or a giant canvas that can be drawn on with fading ink. I want it to be fine enough that it doesn’t look like a tilemap. I’m worried about performance: how can I do this without creating millions of objects that all need to be updated occasionally? The best I can come up with is:
- Save some performance by only updating an area’s growth state when the main camera looks at it, or when the CPU isn’t very busy.
- Create a hierarchy of zones which can notify a controlling script to not spend time updating them when all the sub-zones are in a static state. (In other words: ignore the grass areas that are fully grown.)
- Do a sort tilemap of larger grass-splotches, but hide it by making several shapes of grass and randomly rotating them?
I think these are some decent ideas, but they probably won’t be enough when there’s a worst-case scenario of most of the map in the process of regrowing. And even if the growing-updating issue could be solved, I’m still worried about the space required for a large map. Even if I used a byte number to record the state of a unit of grass, and stored the whole thing as a single array, which I’m not sure is even possible, a ten-thousand grass-unit-square map would still be 100Mb. Not ideal. Anybody got any clever solutions?