Hello! I’ve been working on a project with a few others, it’s similar to Age of Empires, Stronghold, and so on. Right now I’m working on randomly generating a map for players to play on. Now, in both of those games above there are no random maps, obviously due to balancing issues… In this game, there is an overworld map (already done), which contains several smaller regions, and each of those regions has its own map (the ones were working on right now), which will only be used by one player each. So again, 2D overworld shows the relations between the 3D regions. Each region only has only player on it.
So far, using Perlin noise generation and terrains, there’s a nice rolling plains look going for the map. The next step of course is to populate that map with trees, grass/plants, and other resources such as iron and gold. The gold and iron will just be textures on the ground with some rocks sticking out, and the trees will be Unity trees. More specifically, these are some things I need help with:
What is the best way to place and keep track of textured resources like gold?
What is the best way to place and keep track of trees?
There is no grid system, so players will be building structures freely. It might also be inefficient to have new buildings check every frame if its a good place to build there or not, so perhaps calculating that somewhere else would be nice too. I’m also planning on just flattening out the terrain below a building, so angles wont matter there, nor will terrains be that harsh.
Currently my best lead is to create a grid system of ints that goes over that map, and says where what resources are where. 0 for empty, 1 for iron, 2 for gold, 9 for obstructed, etc. Check if all of the squares the building is in are 0, if not show that you can build here. Is there a better way to do this? Would this also work for trees?