Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

How much randomness is needed to give the impression of a complex gaming world?

Discussion in 'General Discussion' started by Arowx, Aug 14, 2018.

  1. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,139
    Imagine you make a procedural world in a game you then cannot take advantage of instancing of repeated objects. So to balance a game that looks randomly generated and maximise gpu performance what is the perfect balance...

    e.g. How many trees are needed to make a forest look natural?
     
  2. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    2,697
    I think you are asking the question the wrong way.

    Just plug a bunch of trees in until it looks right. But there's a lot more that defines a forest than trees. Be sure to work from reference. If you hit performance snag but you don't want to sacrifice the look, you trim elsewhere.

    So the question isn't "how many trees?" It is, "what are the properties that define the forest?"

    Once you know the foundation pieces, all you've got to do is make them you variables and adjust them until it works.

    If I am working in substance painter texturing a model -- say, a human -- and I just try to paint the skin by hand in a traditional way, what happens if I choose the wrong colors? I got to do S*** over.

    If I instead setup fill layers that, all together compose the many properties of skin, then I can go into each layer individually and do whatever the hell I want until everything looks right as a whole.

    So, again, what I've done is defined the fundamental components of the whole and made these into variables that I can alter, rather than trying to guess what "right" looks like from the onset. I see no benefit to mathematically defining a forest. That could easily be a never ending task. I don't think a single person could do it in a lifetime. But our eyes know what forest look like. We can spot inaccuracies almost immediately, even if we aren't a botanist. I don't think anybody could look at a screen of numbers and script and say, "yeah, that's about right for a forest."

    If we pick out the most defining qualities of a forest, then using these as our variables, it's not to hard to whip something up quickly and people will say, "now that's a forest."
     
    Last edited: Aug 14, 2018
    Teila, QFSW and Kiwasi like this.
  3. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,688
    You can do a lot without true randomness. Take TV or movies for instance. A lot of different shows and movies have been filmed on premade back lot sets at the studios, and reused dozens of times even though the buildings are all the same. A little bit of dressing up and the same place can feel totally different.
     
    Teila and angrypenguin like this.
  4. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,501
    Instead of using an extremely large number of unique trees, use a smaller number of unique trees but place them at random rotations, sizes, and positions. Simply randomly rotating each tree will often be enough for the trees to seem unique. Same thing with rocks and vegetation. Random rotations make similar objects feel unique to the player.
     
    Teila and angrypenguin like this.
  5. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    2,697
    Quixel puts out some tutorials on youtube showing how to quickly create forest in Unreal Engine using some of their scanned assets. The tutorials don't really have anything to do with the OP question directly, but they do give a good idea of how realistic of a scene you can create with just a handful of assets.
     
  6. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,167
    Asset store publisher NatureManufacture have used a bunch of asset store assets (Veg. studio and CTS among others) to create a pretty nice forest,



    Sure maube not next gen level, but prettier than most forests I have seen in Unity
     
    Teila likes this.
  7. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,667
    How much randomness is needed to give the impression of a complex gaming world?

    None. Complexity and randomness have very little in common.

    Not sure why you'd want that.

    It depends on what it is naturally supposed to look like. Really beautiful natural places exhibit a lot of order and balance, and express the results of continuous logical processes spanning long periods of time. That's why erosion looks so good, because it's a process that you can't do in one iteration, so it gives an intuitive sense of history and dynamism. It's not a question of the number of trees. Some places have a lot of trees, others very few.
     
    Ony, Ryiah and Kiwasi like this.
  8. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,429
    You are basing your assumption on the most basic approach to instancing. You can instance a mesh but then manipulate it via vertex shaders to add uniqueness and it's still instanced. Your vertex shader could read from other textures that are basically encoded data points containing the data you need for the variation.

    And you could do that using approaches that range from completely random on each run to completely deterministic. That's kind of a side issue actually.
     
  9. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,570
    Artistic rules of thumb is: 3
    Look at most game, they have 3 "trees" per size and biomes, they then scale and rotate them. What's important is the hero objects, the one who are rare, distinct and break the background noise, by attracting attention, they push back the background trees outside attention. It's a contrast problem, you can't have focus if you don't have genericness. PCG failed generally at composition not at randomness/repeatability.
     
    hopeful likes this.
  10. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,711
    You're barking up the wrong tree. It's not the randomness nor the complexity that are the problem here. Players have come to expect content created by hand and talented level designers simply blow away the results of every modern procedural game. We need more than just randomness and complexity.

    We need algorithms that can tell us a story. Just look at the following screenshot from Fallout 4. If you want to further procedural game development then you need to find a way to create scenes like that. Just adding randomness and complexity won't do it.

    Grave.jpg
     
    Last edited: Aug 15, 2018
    Teila, carking1996, Kiwasi and 2 others like this.
  11. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,515
    I'm going to jump in on the side of randomness doesn't produce natural.

    Anyone who has spent any time in nature knows there are definite patterns to it. Where trees grow, what type, and how big depends on the amount of sun, soil, water and wind.

    If you want to build a procedural system to generate natural environments, do it the same way nature does. Run through successive seasonal cycles for several generations.
     
    Teila and Ony like this.
  12. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,429
    IMO the solution isn't based on a hand crafted vs procedural outlook. It's redoing our tools completely to incorporate analytics and machine learning in a way that multiplies the work an artist can do. It takes the basic building blocks of what they do and improves those. Some of it will be procedural, but a huge amount is just automating boring repetitive tasks to free up time for actual creative work. And then procedural/machine learning tools to help create variations of the creative work from very granular levels all the way up to say entire scenes.

    Unfortunately artist tool vendors suck, so I'm not holding my breath on seeing anything really innovative here anytime soon. I think what you will see is some large studios creating this stuff on their own. And once it hits a critical mass, then they will start to release it as open source.
     
    Ryiah and Kiwasi like this.
  13. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,515
    This is happening, has been happening for decades, and will continue to happen.

    Noone is coding in individual pixels from graph paper anymore.
     
  14. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,429
    I'm talking about where it could be vs where it is when you compare how we solve similar problems to other industries.

    This is kind of a pattern in this industry. It's actually what makes it interesting to me, but it's also frustrating at times.
     
  15. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,167
    I don't get it, are we talking pure procedural world's or tools that help you create your world with some automation like Gaia for example.

    I have yet to see a pure procedural world that looks good.
     
  16. chelnok

    chelnok

    Joined:
    Jul 2, 2012
    Posts:
    673
  17. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,570
    Back in the day we used to joke that :
    -,calling procedural stuff as tools was the way to make pcg acceptable
    - nowaday, people use procedural for what's merely a basic tool,
    Gaia is barely procedural, it's a stamp and placement tools that use pcg as a buzz word, it's a vanilla scene editor with heavy uuse of custom stamp lol

    The problem with pcg is that it's nebulous, I mean would call the random scatter setting of a photoshop brush pcg? Pcg still need a great deal of authoring anyway, if it succeed people will say it's because of the authorial part, if it fails they will say it's about the random part (pcg is not about randomness), it's a rorschach test. There is plenty good pcg stuff around, most animation system are arguably part pcg in some sense (state base blending template augmented with real data) and increasingly so. Shader are basically pcg lighting, look at how similar it is to edit a shader vs a substance texture.

    The problem will always be authoring and understanding how to make things looks good will be the key differentiator. Anyway a great pure pcg scene would pass for an authored one and you won't be much wiser, avatar's movie landscape are pure pcg! even nms as some amazing scenaru made by modder tweaking the values.

    Now NMS is not what I would call an informed used of pcg, it's still noise + scattering objects, they don't create "context" for why an object is scattered and that impact visual in some way.
     
    zombiegorilla and Kiwasi like this.
  18. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    2,697
    procedural generation = able to be infinitely reproduced while not showing a clear pattern?
     
  19. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,501
    PCG != Random
    One challenge with discussions about PCG is that people often equate PCG with random, and actually PCG is also about rules that help generate useful content. Random numbers are one part of PCG, but effective PCG is about a lot more than randomness.
     
    zombiegorilla and Kiwasi like this.
  20. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,515
    This. Yesterday's procedural is today's Photoshop or Z-Brush.
     
    frosted and zombiegorilla like this.
  21. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    7,883
    No.
    That may be what someone uses it for but tools and processes are not the outcome. That would be like saying “paint brush = painting of a dog sitting on a couch”.
     
    Last edited: Aug 18, 2018
    BIGTIMEMASTER, Ryiah and hippocoder like this.
  22. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,139
    So randomly generated fractal patterns?



    The fractals have an inherent form even though they are randomly generated, and nature does have a fractal aspect to it's shapes and forms, repeating patterns within patterns.



    The thing is how could your CPU/GPU take advantage of these repeating patterns to boost performance?
     
    Last edited: Aug 18, 2018
  23. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,806
    I'll tell you a story. I spent months researching the behaviour of water ripples. I coded a shader for this, and every time I looked at it, it just seemed too regular. So I went in with more code to break it up, to make it seem more irregular or random.

    And that was wrong. Nature said it was wrong. I checked out water in a number of situations in the real world and it was amazingly regular! It wasn't random at all, in fact it looked like a bad shader in real life!

    So my tale ends with the observation that realism isn't really very random. What you are looking for is probably art direction, which is pretty much the opposite of random. Random will give you results that neither reflect the real world or satisfy the eye of the beholder.

    My advice:

    Art direction will help. Breaking up that forest with lumps of rock, or much bigger trees here and there, will make it feel satisfying and complex.
     
    Ony, frosted, Billy4184 and 3 others like this.
  24. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    4,192
    I started playing "Hours of Darkeness" (Far Cry 5 DLC) yesterday.

    I came across an area where all trees were located in perfect lanes/lines. It's useful to easily traverse the environment, you just need to run in one direction vs dodging trees, but once I noticed that arrangement, it did look a little off to me :confused:
     
    hippocoder likes this.
  25. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,806
    Yeah I can't really speak for the decisions other developers make :D
     
    Ony likes this.
  26. Unknown33

    Unknown33

    Joined:
    Aug 18, 2018
    Posts:
    170
    Real life often has bad graphics. Bad lighting. Uninspired layouts. Textures that don't pop.
     
    Kiwasi and hippocoder like this.
  27. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,570
    fractals are 100% deterministic 0% random
     
  28. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    4,624
    Peter77 likes this.
  29. chelnok

    chelnok

    Joined:
    Jul 2, 2012
    Posts:
    673
    All random generators are deterministic. If you know the seed and how they (random value, and next seed) are generated, you can figure out any and all future random values. Just like fractals; they are repeating same "kinda random" pattern over and over again. However, i would consider fractals as procedural, while i wouldn't consider pretty much any random function as procedural. Just saying, being deterministic doesn't mean it's not random for us; we just can't figure out the pattern, so it seems random to us.
     
  30. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    4,192
    Yeah, almost exactly like these! Here is the image that matches pretty good with what I found in the game.
     
  31. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,711
    Yes, but depending on the implementation it can be almost impossible to replicate the values. One very interesting example of this is Linux's /dev/random. It augments its random numbers with values retrieved from the hardware in the machine.

    https://en.wikipedia.org/wiki//dev/random
     
  32. chelnok

    chelnok

    Joined:
    Jul 2, 2012
    Posts:
    673
    Thanks for the link. I'll check it later. I suppose it gets seed(s) from any analogue source (cpu voltage, temp sensors, fan speed, etc). For sure, practically impossible to crack. That reminded me something; i still love the idea i learned twenty years ago; point a camera to lava lamp, and use md5 hash of the image as seed.
     
  33. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,570
    If you prefer, I meant that some pcg algorythm are non deterministic program that use deterministic random number generator as a way to simulate non determinism. The pcg is distinct from the random input generator, the random input implementation is irrelevant to the nature of the pcg. :p
     
    Ryiah and zombiegorilla like this.
  34. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,667
    The difficulty is not in creating stuff per se, but how to arrange it so that it tells a story that is not simply one of cancerous and unhindered growth. The only complexity that seems to be inherent in these pictures is an algorithm that says "go forth and multiply!"

    That's why, if your goal is to create complexity that looks interesting, I think it is necessary to create conflict. Water fighting to take your soil downhill, wind fighting to take it uphill, rocks providing an obstacle that everything has to work around. The ebb and flow of natural processes that operate, sometimes together, sometimes in opposition, stamping the effects of their struggle into the land until some sort of balance or stalemate is reached. That's when it looks interesting.

    One cannot create something that makes you want to go and explore every inch, such as this image here, with a fractal algorithm or some algorithm that is based on randomness.



    It may not be exactly realistic of course, but that just means it is even less random.
     
    Ryiah likes this.
  35. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,570
    Too bad that landscape was made using procedural random placement as shown in their technical art video ...
     
    frosted likes this.
  36. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    3,669
    There is no such thing as "randomness". it literally doesn't exist anywhere. We use the word random as a placeholder for "too complicated to figure out".

    When I roll dice, the outcome is entirely deterministic, but the outcome is too hard to calculate in advance so it is random in appearance.

    Often times when we talk about "random" in game art or proc gen we often mean "arbitrary" - as is "add some arbitrary noise pattern".

    ar·bi·trar·y ˈärbəˌtrerē/
    adjective
    based on random choice or personal whim, rather than any reason or system.

    So what arrowx is asking in op is "how much arbitrary noise should I add to my tree placement?" and the answer there is: the right amount.
     
    Ryiah likes this.
  37. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    7,139
    What about quantum effects e.g. Shrodingers Cat?

    Or background radio noise e.g. static.
     
  38. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,711
    Last edited: Aug 19, 2018
  39. BIGTIMEMASTER

    BIGTIMEMASTER

    Joined:
    Jun 1, 2017
    Posts:
    2,697
    Great points.

    This is just reiteration of what I said initially, but lets consider the word "natural." In this context, I think OP means "seemingly realistic."

    Again, a real forest is only a random placement of trees to the most careless observer. With just a bit of careful observation, one can find that nature adheres to many rules -- and getting the basic ones that are most easily seen doesn't require any special study. So the question should be, "what makes a forest look real?" Once that is answered, then the more specific question of, "how can I leverage my given procedural tools to best recreate a forest?" has more utility.
     
    Last edited: Aug 19, 2018
    Ryiah likes this.
  40. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    3,669
    I don't believe in random in quantum effects. That we may not fully understand a system or how to measure it is different from it being impossible to measure or understand. I think the word 'random' in quantum effects is just describing the limitations to our knowledge, not the underlying truth of the system.

    Again, there is no such thing as "random" in reality. It's just a placeholder for "too hard to figure out".
     
    Ony, zombiegorilla and Ryiah like this.
  41. Zuntatos

    Zuntatos

    Joined:
    Nov 18, 2012
    Posts:
    522
    "A complex gaming world" is not what you get by increasing randomness. You get a more random game world.

    Complex worlds would be ones with many meaningful connections between the things in the world.
    And many types of those connections, of course.
     
    Billy4184 and BIGTIMEMASTER like this.
  42. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,515
    The science doesn't care what you believe. Unless you have a PhD in particle physics you aren't sharing with us, I'm going to go with the experts. Just because you would be more comfortable with the universe being deterministic on all scales doesn't make it so.

    Its also worth noting that you are in good company not believing in quantum mechanics. Eisenstein famously rejected the concept, saying "God does not play dice with the universe". However despite his and others efforts, the evidence points to individual quantum effects being fundamentally random.

    Some small portion of background static of it is CMB, which is truly random.
     
  43. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    14,711
    Information concerning it must be buried in a scientific paper somewhere because my Google-fu isn't turning up any useful results and that's usually what happens when something is buried behind a paywall like many papers tend to be.
     
    Last edited: Aug 19, 2018
  44. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,570
    Anyway, philosphical definition of randomness doesn't matter when practically, randomness and or randomness is enough to simulate many natural phenomenon. AND if you are going to make decent simulation, or simulation of a simulation in game term, you gonna cheat anway, so the true nature of randomness is irrelevant. We don't talk about making an ancestry simulation here, but a plausible video game visual and behavior.

    Which mean you gonna use your randomness on having procedural line of sight to get great POV, aka compose your scene, rather than plotting scattered element and hope it makes a great visual.
     
    zombiegorilla likes this.
  45. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,570
    https://en.wikipedia.org/wiki/Cosmic_microwave_background

    It's not random, we can extract information from it, it has small anisotropie that hint at events from the past.
     
  46. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,515
    Cosmic microwave background. Its leftover radiation from soon after the big bang. The fluctuations in the CMB are a direct result of quantum interactions in the early universe.
     
  47. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    3,669
    As a trained engineer I gotta bow to your superior knowledge of physics. That said, I think there's still so much that's still under debate in quantum mechanics as well as the interpretation of it that it's a bit pre-mature to say that the matter is settled.

    For example, my guess is that Bohmian mechanics is probably more correct that traditional quantum mechanics, and has seen some experimental success as recently as 2016 when they reproduced the results of the double slit experiment with fluid dynamics. It maintains causality and has been getting more attention of late.

    It's also worth noting that the meaning of 'random' splinters at some point. Is something "random" if it is impossible to predict an outcome? I would say no, there can only truly be random if there is no causality/determinism. Others might disagree, considering anything which cannot be measured or predicted as random.

    Intrinsic Randomness can only occur when there is no determinism, and I don't agree that science has firmly agreed on this yet. There's still so much research and debate going on there.
     
    Ony and Kiwasi like this.
  48. Billy4184

    Billy4184

    Joined:
    Jul 7, 2014
    Posts:
    4,667
    I didn't say it could not be made procedurally, or wasn't. In fact the clearer and more comprehensive are the rules that govern something, the better are the chances of being able to rely on a good procedural outcome. I'm not arguing against procedural generation, on the contrary, I think we can only get good stuff by finding out what non-random rules we can use to ensure a high degree of success.

    Randomness is in fact the thing I am objecting to. This thread has been begun on the assumption that complexity arises from a sufficient amount of randomness, which in my opinion is a fatally untrue axiom to build a satisfying game on.
     
  49. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,515
    Don't, I'm a chemical engineer. That means pipes and stuff. I have no more formal training in particle physics then the next guy on this forum. Scientists/engineers speaking out of turn can be very dangerous.
     
    angrypenguin, Ryiah and frosted like this.
  50. frosted

    frosted

    Joined:
    Jan 17, 2014
    Posts:
    3,669
    Probably still less dangerous than guys with zero formal training randomly googling stuff and making assumptions.

    (Not that that's me or anything ;))
     
    Kiwasi and Ryiah like this.