• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Ways to create a world with premade biomes (Terraria similar)

RedP

Member
Hi, i am trying to understand the best way to create a random map generated with premade biomes, and be able to separate the map into biomes and each of them always have certain features like dungeons or ores, similar with the idea of Terraria. My idea is to create predefined features and every time the map is generated, these areas will be organized in different places of this map, just changing the way the map is created.
I thought of some ways to work on it, but I would like to hear other opinions and ways of organizing this kind of map, I appreciate any ideas and thoughts.
 
Last edited:

Simon Gust

Member
Terraria doesnt have anything premade. Everything is generated. By premade I assume you mean for example a biome at fixed size and every tile is at the exact same place everytime. Only the positioning of the whole biome changes, is that correct? You could draw something in an editor (gimp/ paint.net) load it as a surface in gamemaker, convert it to a buffer and then to a grid or array (or objects). Does that sound like what you want? A better comparison would be games like gungeon.
 

RedP

Member
Terraria doesnt have anything premade. Everything is generated. By premade I assume you mean for example a biome at fixed size and every tile is at the exact same place everytime. Only the positioning of the whole biome changes, is that correct? You could draw something in an editor (gimp/ paint.net) load it as a surface in gamemaker, convert it to a buffer and then to a grid or array (or objects). Does that sound like what you want? A better comparison would be games like gungeon.
Yes, I meant this idea of biomes, the idea of Terraria I mean is already creating a whole map that you stay until the end of the game, unlike gungeon where you switch rooms and just the dungeon is a random map
 

Binsk

Member
Can you be a bit more specific on what exactly you need help on? I'm not quite sure what to address. Do you have your biomes pre-designed and you just want to shift their entire position? Are you attempting to procedurally generate biomes first? Or are you only concerned with the "features" being randomly placed while the actual biome shape is constant? And by constant can you clarify if you mean things stay the same session-to-session or player-to-player?

If you could answer some of those that would greatly help. Now, even without knowing any of this I can still state something about any random generation. If you plan to randomly generate something, no matter what it is, then you should know this:
Computers cannot actually produce random numbers! The best we have is, essentially, an algorithm that produces a series of "random" numbers from a base starting number. This base starting number is called a "seed". Because things are not truly random, as long as you start all your random generation with the same seed number then every random call will be the same as the previous time (assuming they are called in the same order) since they are starting at the same place in the algorithm. You can find out how to do this by looking up random seeds in the manual.

This results in two options for your random generation.
1) Have a seed that you always reuse to re-generate the world every time the player starts playing. This seed can be in the user's save file or something. Often the system clock is used to initially "generate" the seed upon game start.
2) Use a random seed to generate everything and save the result into a file that gets loaded upon revisiting the game so you only have to perform the random generation the one time.
 

RedP

Member
Can you be a bit more specific on what exactly you need help on? I'm not quite sure what to address. Do you have your biomes pre-designed and you just want to shift their entire position? Are you attempting to procedurally generate biomes first? Or are you only concerned with the "features" being randomly placed while the actual biome shape is constant? And by constant can you clarify if you mean things stay the same session-to-session or player-to-player?

If you could answer some of those that would greatly help. Now, even without knowing any of this I can still state something about any random generation. If you plan to randomly generate something, no matter what it is, then you should know this:
Computers cannot actually produce random numbers! The best we have is, essentially, an algorithm that produces a series of "random" numbers from a base starting number. This base starting number is called a "seed". Because things are not truly random, as long as you start all your random generation with the same seed number then every random call will be the same as the previous time (assuming they are called in the same order) since they are starting at the same place in the algorithm. You can find out how to do this by looking up random seeds in the manual.

This results in two options for your random generation.
1) Have a seed that you always reuse to re-generate the world every time the player starts playing. This seed can be in the user's save file or something. Often the system clock is used to initially "generate" the seed upon game start.
2) Use a random seed to generate everything and save the result into a file that gets loaded upon revisiting the game so you only have to perform the random generation the one time.
Sorry, my English is a bit limited, so sometimes I can't develop what I'm thinking, but I'll try to explain to you exactly my idea, which is just to create a very large map, being generated only once at the beginning of a new game. , and from that I have certain biomes with certain characteristics that I will assign and these biomes are arranged in different regions each time a new map is created, that's all. Thank you.
 

Simon Gust

Member
Sorry, my English is a bit limited, so sometimes I can't develop what I'm thinking, but I'll try to explain to you exactly my idea, which is just to create a very large map, being generated only once at the beginning of a new game. , and from that I have certain biomes with certain characteristics that I will assign and these biomes are arranged in different regions each time a new map is created, that's all. Thank you.
It would be even easier for us if you made a concept drawing. Because I'm still a bit confused.
 

GMWolf

aka fel666
Sorry, my English is a bit limited, so sometimes I can't develop what I'm thinking, but I'll try to explain to you exactly my idea, which is just to create a very large map, being generated only once at the beginning of a new game. , and from that I have certain biomes with certain characteristics that I will assign and these biomes are arranged in different regions each time a new map is created, that's all. Thank you.
This is a HUGE topic!
What have you tried?
What do you have functioning now?
What issues are you having specifically?
 
So the problem with these "how do I do proc-gen X" questions is that the answer is usually fairly unique and specific to your circumstances. There are some ideas in proc-gen that are generalised (for instance, using heightmaps for terrain), but a lot of the other features are going to depend on exactly how you want things implemented within your gameworld. Do you want your biomes to be separated by large areas and to be unique (i.e. how I assume Terraria works, the desert biome and the grass biome are separated by a large walking distance and you won't hit another desert biome if you keep on going), do you want each biome to be similar (i.e. if you have multiple desert biomes, are they the same in general?), etc. If you can explain exactly how you want the features to work, maybe we could help you in more detail, but otherwise we'd just be suggesting random proc-gen techniques that simulate what we imagine you are looking for and those, very likely, will not be transferable if your idea is different.
 
Top