Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

GAIA - AAA terrain generator, procedural texturing, planting and scene creation

Discussion in 'Assets and Asset Store' started by AdamGoodrich, May 21, 2015.

?

Would you pay an upgrade fee for Gaia 2 so that we can hire to accelerate its development?

Poll closed Sep 3, 2018.
  1. Yeah super cool - I would pay a $15 upgrade fee to get it faster!

    83 vote(s)
    80.6%
  2. No way - you promised free and i am happy to wait!

    20 vote(s)
    19.4%
  1. Shawn67

    Shawn67

    Joined:
    Jan 2, 2014
    Posts:
    2,196
    Adam, whould it be possible to manually create the rectangular terrain and then just use multiple stampers/spawners? I've never tried this before since I've always been happy with square terrains but I know a lot of times when I was doing the island stuff back in the old beta I would stamp different sized stamps to create the whole terrain. Or is the actual terrain shape going to throw off Gaia's overall calcs? I guess the question is do all the calcs just look at the spawner area or the whole terrain size?
     
  2. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    Ok so the stamps that intersect needs to be synced manually? Remeber the global pos and rotation and size etc, etc?
     
  3. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    Nope. The underlying math is all based on squares. Made it much simpler.

    Yep.
     
    AndersMalmgren and Shawn67 like this.
  4. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    Cool, maybe for the future support multiple terrains? Shouldn't be too hard, maybe a root controller were you can add sub Gaia sessions or something to an array
     
  5. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    I'm pulling my hair here guys. I need a better workflow for flattening the terrain around buildings.
    I set the building at the highest point in the terrain were I want the building. I set the house as low as possible withouyt terrain to clip through the floor inside.

    upload_2017-12-6_1-8-22.png

    But no matter what stamp I try to create in photoshop I end up with either stuff going through floor of building or the transition between stamp and exisitng terrain looks funny. Any tips on stamps or work methods?
     
  6. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    Was just about to give up and goto sleep when I got an idea. I created a stamp with alot of white in the middle then I used the levels tool in photoshop to cap all whites above a certain degree, this created a pretty flat middle of my stamp for the buildign to stand on and a nice slope so it connected well to the existing terrain

    upload_2017-12-6_2-1-3.png
     
    DragonmoN likes this.
  7. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    I have a workflow question. I first stamp my world using the stamper. Then I want to let Easyroads stamp its embarkment for the roads, and after this I want the texture spawner to paint the terrain. Can I somehow add custom steps to the session?
     
  8. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    Grab a stamper. Grab any stamp - I find hills stamps are good. Set stamp height to say 0.5 or 1 (ie flatten it), set a distance filter and set it to 1 at left and 0 at right - the strength of this determines how strongly the stamp is applied. Left hand side is center of stamp, right hand side is edge of stamp.

    Make stamp smaller so that it fits the area you want to influence. Then either add or subract height and flatten away. Works a charm.

    Stamp a few times until you get the area you want.
     
    AndersMalmgren, Shawn67 and Mark_01 like this.
  9. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    No. I am looking at allowing this to be extensible for Gaia 2.
     
    AndersMalmgren, Shawn67 and Mark_01 like this.
  10. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    Another tip - add plinths or bases to your models. The real world is rarely truly flat, and in my opinion terrains that are not completely flat look much nicer.
     
    DragonmoN and Shawn67 like this.
  11. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    If you want to lift your terrains visuals and render lush environments but still get acceptable frame rates then I highly recommend Vegetation Studio!

    Grab 20171011184840 w1920h1029 x-47y67z-118r180.jpg

    Grab 20171011185309 w1920h1029 x-46y65z-126r190.jpg
     
  12. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    AdamGoodrich likes this.
  13. OneManBandGames

    OneManBandGames

    Joined:
    Dec 7, 2014
    Posts:
    207
    I had similar issues with this, everytime I made changes to my terrain I had to manually redo a lot of steps, Gaia spawning, Easy Roads, splitting up stuff for terrain streaming, building a navmesh, etc. etc.
    I solved this by creating a "Build Terrain" script that goes through all these steps automatically. It still takes some time to process all the stuff, but still way faster than clicking manually & you can do other stuff in the meantime while Unity is working.
     
    Shawn67 likes this.
  14. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    So you dont use the session manager at all? Because I first wabnt to run all steps up to the texture spawner, before I run that step I want to run the easyroasds terrain builder. I havent looked at the session manager script so maybe its very easy to play the steps yourself?
     
  15. OneManBandGames

    OneManBandGames

    Joined:
    Dec 7, 2014
    Posts:
    207
    No, I don't use the session manager at the moment. I use Gaia only for texture / details / gameobject spawning, so I just call the spawners from my script at the time I need them in the terrain building process.
    But if you have a gaia session that you want to play back again from a script, I assume that should be possible as well. If you look into the scripts behind the Gaia components usually you can find a method that you can call from your own script that would do the exact same thing like pressing the button on the component in the editor.
     
    AdamGoodrich and Shawn67 like this.
  16. Shawn67

    Shawn67

    Joined:
    Jan 2, 2014
    Posts:
    2,196
    I wouldn't recommend actually changing the code within the Gaia scripts. I'd take the route @OneManBandGames took and call the methods within the Gaia scripts within your own script. If you change the Gaia scripts, you face losing your changes if changes are ever made by Adam in new releases.

    I haven't done this yet myself, but it is something I've thought about. Would love to see how you have yours set up, @OneManBandGames. If you don't mind sharing, that is. :)
     
  17. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    Never ever change vendor files!
     
    AdamGoodrich and Shawn67 like this.
  18. moria15

    moria15

    Joined:
    Feb 25, 2011
    Posts:
    395
  19. OneManBandGames

    OneManBandGames

    Joined:
    Dec 7, 2014
    Posts:
    207
    Sure thing, I will not copy & paste the entire Editor script over here since most of it is very specific to the game I'm working on (& also it is a uncommented, horrible mess ;) ), but the important parts for Gaia are set up like as follows....

    In the script there is an initialization part where I check if everything is present in the scene as required for building the terrain. This is where I get a reference to the Gaia GameObject and build a List<Spawner> for all active spawners it contains (minus the Visualiser)

    Code (CSharp):
    1.  //Find the Gaia Game Object, so we can access the terrain generation stuff
    2. gaiaGO = FindGOStartingWith("Gaia -");
    3. if (gaiaGO == null)
    4. {
    5.    Debug.LogError("Could not find the Gaia game object, needs to start with 'Gaia -'");
    6.    return false;
    7. }
    8.  
    9. //Get all active Spawners below the GaiaGO so we can iterate and spawn one after another
    10. foreach (Transform t in gaiaGO.transform)
    11. {
    12.     if (t.gameObject.activeInHierarchy && t.name !="Visualiser")
    13.     {
    14.         Spawner spawner = t.GetComponent<Spawner>();
    15.         if (spawner != null)
    16.         {
    17.             relevantSpawners.Add(spawner);
    18.         }
    19.     }
    20. }
    21.  
    Later in the build process I iterate through the relevantSpawners list and start the spawners as follows:

    Code (CSharp):
    1.  
    2. if (!currentSpawner.IsSpawning())
    3. {
    4.    if (currentSpawnerIndex<relevantSpawners.Count)
    5.    {
    6.        currentSpawner = relevantSpawners[currentSpawnerIndex];
    7.        currentSpawner.ResetSpawner();
    8.        currentSpawner.FitToTerrain();
    9.        currentSpawner.RunSpawnerIteration();
    10.        currentSpawnerIndex++;
    11.    }
    12.    else
    13.    {
    14.        buildProgress++;
    15.    }
    16. }
    17.  
    This is a bit simplified since I also do stuff like reparenting spawned game objects to a different parent inbetween etc. But I think you get the idea: As soon as a spawner is not spawning anymore, I select the next spawner from the list and call RunSpawnerIteration until all relevant spawners have been called this way, then it is on to the next part in the build process.

    I then can work on the scene in question, add / deactivate / remove spawners or reorder them within the Gaia parent gameobject, and the next time the terrain will be rebuilt the script will call all relevant spawners in the current order.
     
    AdamGoodrich and Shawn67 like this.
  20. Shawn67

    Shawn67

    Joined:
    Jan 2, 2014
    Posts:
    2,196
    Awesome! And thanks! I want to try to figure out how to do something like this and actually integrate into the session. But I'm probably going to wait until after Gaia 2.0 since it sounds like the session stuff might have to be tweaked to accommodate changes. Good to have a few snippets that folks have played around with and got working with the Gaia code base and not have to dig through code to pull out the right ones.

    I liked what you were saying about adding the other steps. I was thinking the other day that it would be nice to be able to start a session and have it not only set up my terrain and spawn, but also run the GX stuff for Enviro, Aquas, player spawn, screenshotter and anything else to recreate the whole environment. I think this was one of Adam's original visions with the session system but most of us who did the GX stuff mainly just did the main integration. Or maybe the API to fully tie-in isn't there yet. Not sure. But I think a build script like you are talking about is an awesome interim solution!

    The reparenting is something else I would like to try to do. Not only for Gaia, but Dungeon Architect as well. I haven't played with DA much yet as I just picked up (FINALLY heheh) in the mega sale. But it looked in the videos almost as if everything just kind of gets dumped into one parent game object. I think it may take a bit more to figure out how to do reparenting there than it will be for POIs since the POIs, for the most part, are fairly defined. Sounds like you are doing some interesting stuff though!

    Thanks again for sharing! I'm sure there are a few folks here that will appreciate it!
     
  21. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    Very cool :)
     
  22. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    Yes. Lennart has made an API available and I will integrate into that :)
     
  23. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    @AdamGoodrich

    Hey adam. Im trying to create a valley and have watched your tutorials. I thibk i want to use the masking tool for this. I have used the terrain texture as mask. The mask is not saved into the session? Because when I replay the session the mask is forgotten
     
  24. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    Hmm... I will check... its quite possible you found a bug :(
     
    AndersMalmgren likes this.
  25. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    Here is my Unite presentation on World Creation in Unity. If you can get past the first 10 minutes off waffle, the rest of the presentation is all demo and it shows off a whole range of tools :)

     
    C_p_H, Vondox, drmanhattan and 6 others like this.
  26. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    I tried again with the mask @AdamGoodrich same thing.
    It works to replay the session If I do not remove the texture mask from the terrain. But If I remove it it does not work. So instead of reading hte mask info from the session it seems it tries to read it from the terrain instead, but since its long gone it will not work
     
  27. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    Here is a video showing my problem. Forgot the mike and the kids are watching Frozen in the background, sorry for that :p

     
    Rockwall33 likes this.
  28. futurewavecs

    futurewavecs

    Joined:
    Jul 26, 2012
    Posts:
    64
    That is a nice demonstration. Have you considered maybe making your own video and covering everything you wanted to cover there but ran out of time on? (Of course in your copious spare time) o_O
     
  29. daibutsu

    daibutsu

    Joined:
    Nov 28, 2017
    Posts:
    18
    Hey guys,

    I have changed my terrain settings to 8k in GAIA and now Texture spaqing is not working.l What should i do? I just press texture and nothing happens.

    I'm using microsplat but it is disabled
     
  30. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    The rotation is reseted when ever I change something on the stamper, like the distance mask curve. And its very, very, very frustrating.. very.. very, very...very :/
     
  31. MrG

    MrG

    Joined:
    Oct 6, 2012
    Posts:
    317
    File a support ticket here for fastest response.
     
    Mark_01, AndersMalmgren and Shawn67 like this.
  32. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    I was very frustrated when I wrote that.. haha :D But the world is taking form slowly. Need to get better texture spawn rules

    upload_2017-12-13_0-38-36.png
     
  33. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    Not sure how you are getting this to happen... I rotate all the time both the the unity rotation tool and in the editor itself.
     
  34. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    So its a bug? If I rotate the stamper and change something, like the distance mask curve it will reset the curve. I can record a video tonight. Oh, I use Unity rotation only not the sliders, its to slow workflow when using the sliders. Also I use the hotkeys w/e to swtich between modes. But I do not think that can matter
     
  35. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    If you go back a few posts you will see it working just fine - as it has for several years... so is it a bug - who can say - if there is something weird then it is most likely an issues introduced by latest Unity.
     
  36. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    The problem is both on 2017.2p1 and 2017.2.1
    edit: same for the masking problem using terrain texture. I used the diistance mask inistead as a substitute. It would be super if the distance mask was reflected in the preview. Would save alot of timie
     
  37. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    Btw a very nice feature would be that you can go forward or backward in the session and apply that stamp to the stamper and see the preview that way it would be much easier to find back to a stamp and delete it or whatever
     
  38. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    @AdamGoodrich
    I have based my texture spawn rules on your demo. I try fit it for my scene, but its not going very well.

    upload_2017-12-13_22-28-44.png

    For example I only get it to use one of the sand textures and one of the mountain textures. I have 4 textures in my PBR desert pack

    upload_2017-12-13_22-29-47.png

    Any good tips how to utilize both sand textures for example?
     
  39. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    Based on your comments it sounds like your having some real environmental issues.

    So - i just fired up 2017.2.0p4 - stamp rotation works just fine both via the Unity rotation widget and via the inspector. I also tried changing the distance mask and the rotation was not lost. NOTE: You can only rotate on Y axis as Unity terrain does not support caves.

    Then I tried stamping. It took about 5 seconds to do a standard 2x2 km terrain on my machine. It then took about 1/2 second to undo the last stamp via the Undo button.

    So - while I agree that it would be convenient to have fully masked previews in Gaia 1 (and I have done this in Gaia 2), I don't understand how much actual time you would save by having it added to Gaia 1. The huge amount of dev work to add this would be better invested into Gaia 2.

    Please feel free to PM me if you want some help. We can arrange a quick Skype session to walk through the work flow and perhaps explain anything that is unclear.
     
    Mark_01 likes this.
  40. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    Mark_01 likes this.
  41. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,646
    Look at the way i blend in textures in the standard Gaia setup - I use noise to mix the two grasses and it is very effective.
     
  42. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    I actually use those, but it only stamps one of them. Will play around some more
     
  43. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
  44. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    For example we have done playtests now on above level. ANd noticed that one of the bases are too high, it needs to be lowered down. If I could iterate the session steps and have them applied to the stamper and previewed I can easy find the stamps that effect that part of the terrain and have them removed. Now I need to maximize each session entry, click apply, go to the stamper, move back to the session manager, move to the next session entry, apply etc. plus its easy to get lost if you have lots of entries in the session manager.

    So you are saying you are not able to reproduce the texture mask problem I showed in above video?

    edit: The workflow is a bit better if you do not hide the stamper preview when stamper is not selcted. I can live with that :D
     
    Last edited: Dec 14, 2017
  45. UnSkiLd

    UnSkiLd

    Joined:
    Mar 4, 2015
    Posts:
    20
    Hello @AdamGoodrich I am impressed by what I see this tool does but have a question. I see a lot of the environments that are being created are mostly mountain/forest type levels but would this be a good tool that could help with city environments? I am using standard Unity Terrain now and having a huge issue with simple tasks like raising the terrain on a median I am using between two roads that have mixture of grass, concrete and a few palm trees. I am curious if this could help solve my problem.

    Here is a sample pic of what my goal is. I am there in regards to the look of it but the only thing missing is the ground is slightly raised around the bush and tree's but because the Terrain object itself is not a perfect size (x2) the brush is vertical and not circular, messing everything up.

    pic url: https://imgur.com/a/SwgRm


     
  46. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    I have a workflow question, I can't find anything in the docs about it. What's the mechanics for building the game with a Gaia world in it? First I thought about setting the Gaia gameobject to editoronly tag but that would remove the POI objects from the scene at build time. Also in similar what about the helper colliders the system creates?
     
  47. OneManBandGames

    OneManBandGames

    Joined:
    Dec 7, 2014
    Posts:
    207
    @UnSkiLd If I understand you right, you want to elevate the terrain inbetween the two roads to build the median "island" with the trees and the bushes? I think you could do this with GAIA in theory: You could create a stamper that you size and rotate accordingly to stamp out those medians. But I think it won't give a good result though, since it would be difficult to get the stamper aligned / sized correctly so it fills out the area inside the curbs.
    Can you maybe try to keep the terrain flat for the road and use a mesh for the median itself instead? If you use a grass texture for the "terrain" part of the medians, no one should be able to tell the difference. You could then just move / resize / rotate these median meshes as you please, without having to worry about fitting the terrain inside every time you touch it. If you look at this roundabout model you can see that the medians / traffic islands there were built with meshes as well: https://www.turbosquid.com/3d-models/roundabout-tree-street-signs-3d-model/578633

    @AndersMalmgren
    After you are done with terrain generation you can remove Gaia from the scene since it is not required during runtime. As you mentioned you would need to copy the POI objects over somewhere to your scene first since you would delete them otherwise. It is up to you if you would like to keep the helper colliders or if you delete / deactivate them with the other Gaia stuff.
    I mentioned my terrain build script a few posts above, this script takes care of the generated objects for me and reparents them into the scene before the Gaia Object is discarded.
     
    AdamGoodrich likes this.
  48. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    I do not want to discard it, if I want to change something in the future I would need to start over, to me the session is part of the games source code. It would be cool if Gaia could support to have the POI objects in a separate object structure the same way they do the actual terrain. Then we could just mark the Gaia object as editoronly and it would be removed on build
     
  49. OneManBandGames

    OneManBandGames

    Joined:
    Dec 7, 2014
    Posts:
    207
    The session is stored in a separate file that you can load again in the session manager, so in theory you could restore it at some later point even after you deleted the Gaia GameObject from your scene (Check the "Data" folder inside your Gaia-Installation folder, your session file should be there.)
    However what I am not sure about is whether all spawner settings for texture, detail objects etc. are stored within the session file as well and will be magically restored if the Gaia gameObject is missing them when you start out fresh.

    In general it would be a nice to have feature as you suggested that you can select under which parent the POI objects are spawned, maybe that is something that could be added in Gaia 2. In the meantime, you could create a script that reparents all the spawned POI objects somewhere inside your scene, and reparents them back into the Gaia Object once you want to edit again.
     
  50. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,406
    Yeah, our game is in Steam early access so the map will se many iterations until its considered done.
    I also need to fix something for Easyroads, they have a finilize feature which removes the road scripts. Cant use that either