It looks like you're using an Ad Blocker.

Thank you.

Some features of ATS will be disabled while you continue to use an ad-blocker.

# A Guide to Procedural World Generation

page: 1
5
share:

posted on Nov, 19 2015 @ 06:57 AM
This is a topic I've been wanting to write a thread about for quite a while but just never got around to it. To start with I should probably explain what procedural generation actually is. Essentially it is the method of creating something by writing an algorithm to create it instead of actually hand-crafting it. This technique is often used in high budget animations because they don't have time to hand design the entire scene all the time. For example they might use an algorithm to determine where each blade of grass is located instead of placing each blade themselves. Now obviously the algorithm used must not be extremely predictable because then it might just place all the grass blades into a predictable pattern and it will look very fake. Basically what we need is a deterministic pseudo-random algorithm.

It needs to be deterministic because it needs to produce the same output every time when given the same input. In a video game we don't want the level to look different each time we load the game, which means the output needs to be deterministic. The input (aka the seed value) is what will really determine the output. So if the player starts a new game the world is generated using a new seed value. This technique is already implemented in games such as Stranded Deep, in which you play a person who is stranded on a remote island after a plane crash. Each time you start a new game the world will look entirely different, your starting island will be different and the islands around you will look different and be in different locations. There are even mods which do things such as modify the average size of the islands and the distance between islands.

You can also travel in any direction for as long as you want and you will keep finding new islands because the world is virtually infinite. I personally find the concept of procedurally generated worlds very exciting because it means we can explore entire worlds that no one has ever seen before, not even the people who created the game. On top of that, it saves a lot of time and energy because artists no longer need to hand craft everything. One of the things I really hope to see in the future is a powerful engine which can generate entire landscapes with the click of a button. The user would tweak a few settings and then it would generate an entire world based on those settings, including rivers and lakes, vegetation and wildlife, even buildings and people. This may seem like a pipe dream but I will now attempt to convince you it's very possible.

Lets begin with terrain generation because that's really the starting point for everything else. The simplest approach to this problem is to simply start with a flat surface and then apply different types of noise to distort the surface until you have something that roughly looks like terrain. If done well this method can work quite well but there are more robust approaches will produce more realistic results. We can use real models of the way water flows and erodes the land in our algorithms to produce better results. By making use of principles in hydrology and similar fields it's possible to create very realistic terrain, even more so than what artists could make by hand, because they simply don't have time to focus on all the little details, whereas procedural algorithms can recreate those small details if they are based on realistic models.

The following video demonstrates the use of such techniques to create quite a realistic looking landscape with rivers running through it. And once you have your landscape with your rivers running through it, you can then start to think about vegetation. For example many plants and trees like to grow close to a water source but other might prefer drier conditions, some like to be close to see level while other prefer higher altitudes, etc. So you can start to create models of where different types of vegetation should occur. If you really enjoy the video below you can find other similar videos by searching "procedural terrain generation" on YouTube. Some people have made quite a bit of progress in this area of research and they have built terrain generation engines which can generate landscapes on par with AAA games.

Procedurally choosing the location of trees and plants is good, but there's a lot more we can do. Have you ever played a game and been annoyed how every single tree looks the same? That is the main problem with hand-crafted vegetation, the artists can only create a limited number of objects because they have a limited amount of time. But if we were to model the way trees grow, we could create a procedural algorithm for generating trees which look different every time. The following video demonstrates exactly that. They are even able to simulate different species, so you can have a wide variety of trees all of the same species, so they look similar but they are shaped differently like real trees of the same species. To be honest this is probably the most impressive procedural algorithm I've ever seen.

edit on 19/11/2015 by ChaoticOrder because: (no reason given)

posted on Nov, 19 2015 @ 06:57 AM
Then once we have our terrain with our water and vegetation we can begin to think about the wildlife. Different types of wildlife prefer different types of environments. Certain types of vegetation attract different types of animals. The density and layout of the vegetation also effects where animals live. The altitude, the temperature, all these things and many more can be taken into consideration to create a realistic wildlife model. Humans are also animals when you get down to it and we have certain preferences about where we choose to live. What is more complicated is the structures we build, but even that can be procedurally modeled. Entire cities can be procedurally generated by modeling the way cities are built.

We start by choosing a few points which will be the densest points in our city, so we generate a road network which emphasizes a connection between these core points, which is much how real road networks are structured. We can then divide the road layout into different zones: residential, commercial, industrial, etc. That will allow us to decide which types of buildings should go where. If you've played SimCity then you know it's a bad idea having industrial zones right near residential zones, so we try to avoid things like that, but make sure all buildings are close enough to water and power plants, etc. Basically you just keep adding ideas like that until it looks real enough. The following video demonstrates some of the ideas I just mentioned to procedurally generate an entire city (keep in mind this was made back in 2008):

One of the downfalls you may notice about that demo is that the buildings it generates are rather simple and they all look very similar. Just like trees though, it is possible to procedurally generate a wide range of different buildings. You could start by defining some basic building shapes, square, rectangular, triangular, round, oval, etc. You can then get a lot of variation just by changing things like paint style, window style, roof style, number of floors, etc. You can even get tricky and combine different smaller buildings to create larger ones. The following video demonstrates some of these techniques and although it seems to use only square and rectangular shapes, the amount of variation it achieves is still very impressive. There are other interesting videos on procedural building generation if you search for it.

If we wanted to go all out we could even fill our procedurally generated buildings with procedurally generated furniture, so that every chair looks a bit different, every table a bit different, every lamp a bit different, etc. How on Earth could furniture be procedurally generated you ask? Well we must take a slightly different approach in this case because you cannot really generate furniture from scratch like other things. The solution is to blend together existing hand-crafted models to create entirely new models which contain aspects from all the models which were blended together. This can provide a huge amount of variation with only a few models.

Having said all that, many video games would still need to have their own hand-crafted buildings, which is totally fine. The beauty of procedurally generated worlds is that you can tweak them after they have been generated. If something looks a bit funny you can adjust it to your liking. Of course this means the game would have to use a single seed value which never changes so adjusting stuff by hand does have that downside. You could have hand-designed buildings with procedurally chosen locations, that is definitely a good option if you don't need every building to look different.

Another thing to keep in mind is that once we have a well designed procedural world engine, it then becomes possible to create a truly awesome procedural universe engine. We could make it so that every planet you visit is different because they would all be procedurally generated using different parameters and different seed values. The universe its self would be procedurally generated so it could be virtually infinite in every direction, meaning it would be impossible for one person to explore every planet. This has already been done to some degree but it's not yet at the level of complexity I'd like to see.

So that about sums up everything I wanted to talk about. The final goal is to combine all these ideas into a single procedural engine which can generate entire worlds based on a few input parameters and a seed value. Imagine how much easier it would be for indie game developers to create awesome games if the hardest design part was done for them. If they can create the game world with little effort they have more time to focus on game mechanics and other important things which often don't get enough attention. Hopefully someone found this interesting, I look forward to your feedback.
edit on 19/11/2015 by ChaoticOrder because: (no reason given)

posted on Nov, 19 2015 @ 07:16 AM
Not so long ago I had been reading about how the video game Elite: Dangerous was using real world scientific algorithms to generate the game's planets and the rest of it's universe.

posted on Nov, 19 2015 @ 07:27 AM

Yeah like I said multiple games already makes use of procedurally generated content to some degree. I believe No Mans Sky is another game which does it but I have yet to play it. None of them really do it to the degree I'm talking about here though. Where I would really like to see these ideas implemented is in open world games such as the ones made by Bethesda, so every single tree in the game looks different, and stuff like that. I don't know maybe I'm just picky, but it's little things like that which really improve immersion for me.
edit on 19/11/2015 by ChaoticOrder because: (no reason given)

posted on Nov, 19 2015 @ 07:37 AM

I understand what you are saying. When eventually quantum CPU's and motherboards become more cheaply produced, like a desktop D-Wave, then such finely concise environments can be constructed as to replicate our reality in totality in photo/video realism. And more than likely in a holographic module as well as the monitor screen.

posted on Nov, 19 2015 @ 08:02 AM

When eventually quantum CPU's and motherboards become more cheaply produced, like a desktop D-Wave, then such finely concise environments can be constructed as to replicate our reality in totality in photo/video realism.

It's not really about photorealism, that's mostly a rendering issue. Our current computers can generate procedural worlds using the concepts I'm talking about, the only issue would be really long loading screens while you wait for the world to be generated. The game would be extremely small in size because the meshes and textures would be mostly procedurally generated, so instead of needing to store the entire mesh and texture you just need to store the algorithm for generating the mesh and texture, and the size of that algorithm will usually be extremely small. One guy generated an entire 3D city with animations and all of that was contained in a 180KB file. That is smaller than a single texture from a modern game. Here's a demo of it in action:

EDIT: I should also point out that you can't do things like make every single tree in a game look different if you use hand-crafted meshes and textures because it would take up way too much space. The only real way to get the wide range of variety that I'm talking about is to use procedural methods.
edit on 19/11/2015 by ChaoticOrder because: (no reason given)

posted on Nov, 19 2015 @ 11:52 AM

originally posted by: Tindalos2013
Not so long ago I had been reading about how the video game Elite: Dangerous was using real world scientific algorithms to generate the game's planets and the rest of it's universe.

I've played around with fractal planet generators; start with an icosahedron or octahedron, then keep subdividing each triangle into four smaller triangles and randomize the height of the new vertices by a small amount. At the same time, cull those vertices that are outside the viewport. Keep going until a complete landcape is created. Color the vertices based on height.

posted on Nov, 21 2015 @ 03:38 AM
I just came across a very interesting lecture from an artist involved in No Mans Sky. I skipped over the topic of procedurally generated animals because I didn't really have any good ideas. But in this lecture he goes into quite a bit of detail on how they generate animals in No Mans Sky and it's absolutely brilliant. As he mentions at the end of the lecture, it's basically just like doing modular character creation but for animals instead of people. And we can even extend those concepts into other things like trees and plants, which he also briefly talks about.

posted on Mar, 5 2016 @ 07:57 AM

Lets say you have a game, were information is
crucial. Like were everything is. Cities, roads,
lakes, forests, mountains and so on and on.
BUT
There are other gamemechanics that needs to
be "ingame", like AI, damagesystem, weapons
physics. Ah he** ill just come out and say it.
ArmA3
The MilSim of a lifetime. With endless possibilities.

Would it be possible to get PG in the world/mapcreating
of the ArmA world. When you create a map you need to
build the map from scratch, with satmask, hightmap and
so on. But then you need to populate that map with items.
THATS were id like PG to come in. If i didnt need to manually
poplate the whole map with trees and lakes and cities, maybe
the map could be made BIGGER. I think the biggest map
in ArmA is about 270km2 and i think that is the landmass.
What if you could make a map 10 times that... Would be
EPIC.... And as i understand would take a lot
of stress of cpu.
I would like to have a map preset to certain standards.
Rules that specifies were everything is, every time at
the EXACT same spot. So its easy enough to build
missions on.

Soo, would it be possible??

Oh have a
edit on 2016/3/5 by Miccey because: (no reason given)

edit on 2016/3/5 by Miccey because: (no reason given)

posted on Mar, 7 2016 @ 01:59 AM

Would it be possible to get PG in the world/mapcreating
of the ArmA world. When you create a map you need to
build the map from scratch, with satmask, hightmap and
so on. But then you need to populate that map with items.

Yes that should be very possible and it's actually a pretty good idea to procedurally generate a game world using a simple map representation of that world. The hard part will be designing an algorithm which understands how to design maps which look good. I've never looked at the way map building works in ArmA3 but I don't see any clear reason you wouldn't be able to create a map generating algorithm.

new topics

top topics

5