Search Unity

Procedural generation, Chunks or as one mesh?

Discussion in 'Scripting' started by MrCod3x, May 8, 2019.

  1. MrCod3x

    MrCod3x

    Joined:
    Mar 11, 2017
    Posts:
    1
    Hey, Im toying with an game idea that will have the play area around the same size as software inc / cities skylines. I would like to use procedural generation to generate the map as it will make the expirance more unique each time.

    I looked at some examples of terrain generation and most famous one i found is by Sebastian Langue, He seems to use terrain chunks. i guess this would be good for an fps game that would constantly need to generate new terrain but should i still use this method for a game that i know will have max play area? or should i just generate one single plane and add noise to it?
     
  2. Haston97

    Haston97

    Joined:
    May 1, 2017
    Posts:
    3
    Hi MrCod3x,
    In my opinion, it is much better a single plane in this case, as the chunk loading system, as you mentioned, is for infinite maps, as it would be impossible to to load it all at once.
    Hope I helped you.
     
    Dextozz likes this.
  3. SparrowsNest

    SparrowsNest

    Joined:
    Apr 6, 2017
    Posts:
    1,920
    Another advantage of chunks is that you can cull the currently invisible part of the map and makes recomputing the mesh (for stuff like terrain deforming) faster because you do it in chunks
     
  4. asd234w4r5

    asd234w4r5

    Joined:
    Oct 4, 2012
    Posts:
    888
    Really depends on your situation. You can also always work with heightmaps and complex datamaps to create terrain and place objects. Lot of options depending on your needs.
     
  5. DanJa512

    DanJa512

    Joined:
    Dec 14, 2015
    Posts:
    9
    ProcMod is an editor extension allows you to connect prefabs in random configurations, and can bake a NavMesh on top of them all.

    As stated, it depends on your situation, but this extension was built to "modularize" item/level generation using Unity's prefab system. With the recent overhaul of prefab workflow, this is pretty powerful.