I have some questions about how to best manage resources in games. For example, let’s say that I would like to spawn treasure chests in random locations that players can then find to earn rewards.
1. Spawning Resources On The Ground
For either smooth terrain or block maps, the ground has varying elevations. So how do I spawn the treasure chest so that it sits on the ground (instead of under or over the terrain)? The chest is anchored.
2. Not Spawning Resources In Restricted Areas
I don’t want the resources to spawn in trees or on top of houses, for example. So how would I exclude the spawning from such parts or areas?
3. Keeping Track Of Spawn Population
I don’t want to over populate an area with treasure chests, so how should I keep track of my resource population and density?
Thank you for any suggestions that you can share.