- Home /
Making a map of your terrain (Physical Map)
I have been looking for a while at how to make a map for my game, on google, unity answers, etc but to no luck. If you have ever played the game "Rust" you would know that if you hold G a map of the island comes up. I am trying to find a way to do that in my game, I want to make it a physical map (https://www.worldatlas.com/aatlas/infopage/physical.htm) so it shows rivers, mountains, and other defining feature of the terrain. I am also wondering how i could use this with procedural generation, would i generate the map off of the terrain or the terrain off of the map? I have honesty been looking for a solution for this for a good month so any help would be appreciated!
Answer by Magso · Jan 30, 2019 at 12:20 AM
If you're using set models, you can procedurally generate an array of integers and use them to assign the models for the map and textures for the map view. If your using perlin noise for the terrain, it could be tricky to map out rivers. I'm not sure but it might be possible to create a shader that cuts out darker areas of the perlin noise texture.
I don't really know how to do that but I will try and find a way to use this! Thanks!
You could do something like this,
int[] numID;
int mapSize;
float xPosition, zPosition;
GameObject[] mapSection;
void Start()
{
for(int i = 0; i < mapSize; i++)
{
numID += [Random.Range(0, mapSection.Length)];
}
for(int part = 0; part < numID.Length-1f; part++)
{
Instantiate(mapSection[numID[part]], Vector3(xPosition, 0, zPosition), Quaternion.identity);
xPosition += 10;
if(xPosition > 100)
{
zPosition += 10;
xPosition = 0;
}
}
}
Your answer
Follow this Question
Related Questions
Assigning UV Map to model at runtime 0 Answers
Suggestions about creating a big map 1 Answer
Can I make an open world with this engine? 1 Answer
Drawing an overlay mini-map 6 Answers
Terrain normal map. 1 Answer