Randomly Generated Map

Hello! So I am making a game, and the map is supposed to be fairly large (seemingly infinite). Originally I was going to make the entire map by hand because I didn’t know what else to do, however, that would take quite a while. So I thought of an idea but don’t know how, or even if it is possible. So I just wanted to know if this would be possible, and if it is: is it even efficient and how would I even go about starting that?

The idea is that to have the map randomly generate, I will make small square sections of the map and then when the game starts load them in like 50 by 50. Kinda like how doors and scp-3008 do it. Problem is, my map is not just models and parts. I want the map to be made of terrain. I have an image below depicting my idea. Maybe I could just have it generate infinitely, but then I would have to deal with optimization and I don’t know how to do that either.

So is this possible, or should I try something else.

Obviously the in game squares will be much larger I just made this in a second.

1 Like

You would need to use a noise function to get not only elevation for the terrain, but also ‘biomes’ such as town, or forest, or grassland, and then build the map like that.

You can have the map generated on the client, only creating what is around the player in a certain distance, then removing it when it is out of distance.

If it is in a certain biome, such as a town, you can force the terrain to be flat, and using noise get the random chunk of city scenery to put down, or if its in a forest biome, you can use raycasting or terrain height values to place trees and plants.

1 Like

Ah I see. Well the map would really only be repeating hills of grass so it would be fairly simple. Also it would kinda need to keep the previous areas loaded because its multiplayer. Would it be hard to make what you suggested? Honestly I might just make the map instead then.

i’ve done this multiple times, unload things optimally to save as much memory as possible

You can have multiplayer while still generating on the client.
Check out this place where I was experimenting with endless terrain.

The terrain is created in chunks, that are destroyed when you move too far away.
It is all client side.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.