Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

GeNa - Sophisticated procedural content spawner

Discussion in 'Assets and Asset Store' started by AdamGoodrich, Oct 22, 2016.

  1. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Yep.... am in a crazy busy patch and have a bunch of things I want to do - and the fence concept is a confusing feature to set up - so I will do that video for you!
     
    Mark_01 likes this.
  2. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    224
    Hi Adam,I have two question.

    1、My "Draggable Rotation" function doesn't work,I checked Draggable Rotation,press the Shift Key and then drag the mouse with the left mouse button,there is just green visualiser,haven't arrow.

    2、I have a house model,when I spawn it,the spawn height is doesn't right,it into the terrain.
     

    Attached Files:

  3. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    I have never had any issues with draggable rotation - in fact its demo'd in the next video, so am not sure what is up here. Perhaps there is no active object selected ?

    To change the height of your house check its Y offset.
     
  4. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    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 :)

     
  5. AngelBeatsZzz

    AngelBeatsZzz

    Joined:
    Nov 24, 2017
    Posts:
    224
    Understand,thank you Adam.
     
  6. rastlin

    rastlin

    Joined:
    Jun 5, 2017
    Posts:
    127
    I've been trying GeNa in Unity 2017.3 RC2 and there seems to be a lot of issues with the asset. Not sure if it's caused by Unity problems or API changes, but the asset is barely usable. Here is the list of issues I noticed so far:
    • The spawner always spawns only ONE prototype instance, regardles of Max/Min Instance settings.
    • The visualizer seems to work funky, I see just a green circle, but not green "balls" in the editor. If I play a game and stop, the "balls" are displayed until I move the visualizer
    • The Global Spawn does not work, period. It results in the exception being logged in the unity console, I tracked it down to line 611 in Spawner class:
    Code (csharp):
    1.  
    2. #if UNITY_EDITOR
    3. if (!Application.isPlaying)
    4. {
    5.    if (EditorUtility.DisplayCancelableProgressBar("Spawning", displayName,
    6.        (x - minX) / (maxX - minX)))
    7.    {
    8.        Debug.LogWarning("Spawn cancelled by user.");
    9.        cancelled = true;
    10.        break;
    11.    }
    12. }
    13. #endif
    14.  
     
  7. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    This seems odd - GeNa has generally been very stable across releases.

    I did some lightmapping exploration on 2017.3 rc1 i think and found it to be really buggy so I deleted it off my machine.

    I will be updating GeNa shortly to add Vegetation Studio support, and will explore this as part of that - and hopefully after Unity has made the release more robust.
     
  8. rastlin

    rastlin

    Joined:
    Jun 5, 2017
    Posts:
    127
    Just updated to 2017.3 release, sadly none of my issues has gone away.

    Additionally I noticed there seems to be some weird things going on when baking the NavMesh with GeNa-spawned prefabs.

    When I place the prefab manually, the bake is respecting my NavMeshObstackle configuration for prefab. When I place the object via spawner, the prefab seems to have similar carve as manualy placed. However once I bake the NavMesh the obstacle mesh carve settings seems to be entirely ignored.

    I'm spawning the tree-prefab as Prefab, not as a terrain tree.

    From the looks of things, after bake the carving looks like it's based on mesh boundaries - I'm using build-in Nature-Tree shaders for the prefab as I'm doodling with the Trees in general.

    Image demonstrating the problem below:
     
  9. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Now that its released I will explore and see if I can replicate your issue. Please drop a message to https://proceduralworlds.freshdesk.com/support/home so that this does not drop through the cracks.
     
    BackwoodsGaming likes this.
  10. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    If anyone has been on the fence about any of my products - DevDog is doing a massive christmas giveaway and there are 5 copies of each of my products available as giveaways if you sign up today!!

    http://christmas.devdog.io/
     
  11. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Just tested in Unity 2017.3.0.f3 - had no issues spawning lots of instances as per image below. One little trick to be aware of... if your throw distance is substantially smaller than the object size, then GeNa will only ever attempt to place the next one within that range - and then the ensuing collision will stop that location being used.

    2017-12-22_10-25-50.png

    Again no issues - see visualization above.

    Worked for me, although I did get an exception. Will track into this. Unfortunately its very esoteric.

    GeNa just places prefabs and sets flags as necessary - check the flag settings on your prototype to check that your flags are correct for what you want to achieve.

    As general comment - I have largely done the work needed to support vegetation studio in GeNa. I will release an update in the next few weeks that removes the 2017.3 upgrade question, fixes the arrow cap warning, digs into that global spawn exception and also adds veg studio support.

    Any other issues please send them to my support system so I can track and ensure they are resolved in the next release.
     
  12. rastlin

    rastlin

    Joined:
    Jun 5, 2017
    Posts:
    127
    Thank you Adam for checking my issues.

    Based on you suggestion I checked my spawn criteria, and indeed all the behaviour was due to "Check Height" being selected and set to Min Height = 50 by default. I had a very levelled terrain, so in essence none of my area qualified, which resulted in only singular spawn. Interestingly this had an effect even if "Spawn criteria" check box was not selected as it's initially the case when you create a spawner.

    As for my NavMesh carving it indeed was related to the fact that GeNa selected a bunch of static flags, when I applied the to my manually spawned prefab, the result was the same.

    So besides the exception you noteced as well, I'm happy able to use all the neat features of GeNa, thank you :) .
     
    AdamGoodrich likes this.
  13. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Merry Christmas everyone!!

    I will be taking this week off so support will be sporadic!
     
  14. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    @RonnyDance Looks like what you did wrong was set the height of the original plane you used to create your POI incorrectly. The Y value should be -0.02 or -0.05 in order for the height of all your assets to be correctly configured when you drop them into the spawner.
     
  15. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Thanks adam you were fast as always. I deleted my post after fixing the wrong coords of the prefabs I found directly after posting.
    One thing is anyway causing me trouble.
    I have multiple house prefabs which are grouped:

    Like
    house1 is consisting of: house1 prefab, stair prefab etc.
    upload_2018-1-7_10-48-33.png upload_2018-1-7_10-51-47.png

    I can't drag them as prototype to gena. I want to spawn the whole village which is grouped in 3 groups:
    houses (all houses), props (all props), fences (all fences). Right now the problem is that I cant drag and drop any groups, I have to drag and drop the blue prefabs itself which would be lot of work and will not work with houses which are consisting of different prefabs like house 3. Any ideas? Gena can't detect groups of prefabs?

    Thanks as always!
     
    Last edited: Jan 7, 2018
  16. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Nope it can't and this is by design.

    From a design perspective a prefab is a group of elements that have been designed to work together - e.g. a 3D forge house is a collection of walls, floors etc.

    If I broke these apart and aligned them all to the terrain at spawn time - then the house would be destroyed.

    In a similar way - there is no way I can know what should be grouped or what shouldn't - so all high level prefabs are individually spawned - and then individually positioned, rotated etc in order to stay true to their respective layout when the POI was created.
     
    RonnyDance likes this.
  17. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    Hmm thats sad, because the Asset Author just created the objects / prefabs like above in the screenshot and not like 3DForge.
    Can I fix this problem by creating an empty prefab myself putting house_03 (2) for example? If not I will have to spawn them by hand on terrain which is lot of work. Thought I can do it faster with GENA.

    Thanks again.
     
  18. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    You absolutely can do this faster with GeNa if you set it up right.

    Additionally you can save your spawners as prefabs, so you can re-use them over and over again.

    GeNa will spawn whatever prefabs you throw at it and they will get positioned and rotated based on their settings.

    If that prefab happens to be a whole bunch of houses... then GeNa will spawn them as a single unit and on anything but purely flat terrain that's going to be an issue.

    In the tutorial below you can see that every house is still a single prefab - and what is actually being dragged onto GeNa as a flat collection of individual objects.

    Tutorial here: http://www.procedural-worlds.com/gena/tutorials/poi-and-fence-spawning-in-unity-3d/

    Not sure how you did your setup - but if the childed group of buildings is not a prefab - then just unchild the buildings so that you have a flat structure - and then recreate the spawner.
     
    BackwoodsGaming likes this.
  19. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    By creating clean prefabs with everything nicely included (props, house etc) Gena works perfectly.
    Thanks again for the explanation and hint.

    One thing I noticed though:
    I have a big cementary POI ready with different prefabs which have different scales. Like some walls have 0.5, stones 1.5 etc.
    When spawning the Prototype with GENA the POI is not spawned right because the walls have all a minimum scale of 1. I saw the the "Same Scale XYZ" with Min Scale of 1in the Placement Criteria. I think thats the main issue, that I can't set the min scale to something below 1 like 0.1 so Gena takes the Scale I used when Prototyping the POI.

    Is this also intended? How can I spawn prototyped POI when having different scales for the Prefabs?
    Btw.I am talking about the Graveyard Demo Scene and Prefabs of Barts PBR Graveyard asset. (https://www.assetstore.unity3d.com/en/#!/content/58915).
    Pretty sure you also have the Asset ;)
     
    BackwoodsGaming and AdamGoodrich like this.
  20. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Disable integer only in global settings in order to get smaller scales. System in middle of unity update so i can't check.
     
  21. matteumayo

    matteumayo

    Joined:
    Jul 25, 2016
    Posts:
    170
    Hello,

    Has a "NavMesh check" ever been considered for placement criteria? Or is there any way I could add this functionality to the current version?

    It would make Gena a very powerful enemy spawning tool when dealing with runtime enemy spawning across a variety of different landscapes/environments.

    I imagine it would have a lot of other good uses too.
     
  22. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Nice idea. I will add this into the roadmap!
     
  23. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    llJIMBOBll and MrG like this.
  24. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    Don't do it! its a trap!!! Lol, j/k, great group of people here. :)
     
  25. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Pfft! :)
     
    recon0303 likes this.
  26. TeagansDad

    TeagansDad

    Joined:
    Nov 17, 2012
    Posts:
    915
     
    recon0303 likes this.
  27. emmcd3

    emmcd3

    Joined:
    Dec 16, 2012
    Posts:
    26
    Hi Adam,

    An idiots I can only spawn a tree at time. I'm having a devil of a time getting ctrl + shift + click to spawn across the terrain. I also do not get the grid as in the tutorials. I knew I shouldn't have ventured into the art studio world. :)
     
  28. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Well... assuming you asked GeNa to spawn more than 1 tree (by setting min and max instances).. then the next most likely offender is that your seed throw distance is too small..

    GeNa simulates natural growth over time by allowing each tree to 'throw a seed' that will turn into another tree. If the distance is too small (as compared to the size of the tree), then the seed will fail to germinate.

    Hard to say really as there is little information to go from in your post and GeNa has a range of things that influence the spawn.

    If you would like some more help join our discord server here: https://discord.gg/rtKn8rw
     
  29. emmcd3

    emmcd3

    Joined:
    Dec 16, 2012
    Posts:
    26

    Here is what I have for settings :
    Min style
    Max 211
    Throw distance 69.7
    Spaw range 69.7

    I didn't take at the console before, but, the root of it all might the following exception : "invalid operations ... opp station is not valid due to the current state of the object:.

    The settings look okay or should permit at least another object to be spawned. The console exception states that there is an invalid exception due to a
    The current state of the object.
     
  30. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Yep - that would seem to be the root of it - and being Unity could be from any number of causes. Feel free to reach out via Discord if you want to do a screen share - will only take a few mins to get you sorted.
     
  31. emmcd3

    emmcd3

    Joined:
    Dec 16, 2012
    Posts:
    26
    Thanks again for a quick response. Would same time tomorrow night be all right with you. I'm in SF, CA it is 1930 hours now . Would 1900 be suitable for you?
     
  32. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Just connect and reach out - if i am around i will help you out - tend to be fairly fluid.
     
  33. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    204
    Hi Adam,

    I've been using Gaia and Gena for a while now and I'm wondering if you have any ideas on how I can create trails (walking trails, animal trails etc.)?

    Thanks.
     
  34. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Hmm... easy roads perhaps ?

    I have something at the moment but its still not much more than a prototype.
     
  35. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    204
    I thought about easy roads. I can fiddle with that. If you can think of any other ideas, let me know. Thanks!
     
  36. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    204
    What would be ideal, is if after generating the terrain and adding the ground textures, I would have the ability to then go in and paint my trails. Then, when I run the spawners for objects, trees and grass, it would stay away from the path.
     
  37. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    204
    World Creator has this feature for roads & rivers. I guess they are using a mask type system that applies to a path so that textures can be applied to the trail/road/river. I have not licensed that asset, but here is a video example of how it works. I'm sure it's not trivial, but you can get an idea of how it might work. If you could do something like that, it would be epic. :D

     
  38. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,100
    that would be really cool, then people are able to make paths all over the terrain... I have so big terrain so I cant paint small, and my road tools is terrain based so It cant make it smallen then the smallest brush and thats too big.
     
  39. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,100
    Hello! Is the Gena update released with the vegetationstudio intergration? :)
     
  40. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    No. Been focussing on the new CTS update and its tutorials.
     
  41. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Made this video on how to enhance a Gaia terrain with CTS last week. While obviously I am a big advocate of Gaia, you can create your environment any way you want.

     
    ScourgeGames likes this.
  42. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,100
    Allright thats cool no problem.. I just realized something that it would be cool if Global Spawn would only spawn from min height to nax height? is that possible to get the global spawn to follow rules? it takes such a long time to paint it all by hand..
     
  43. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    Global spawn wont spawn below the min height (as a convenience) - and is already also constrained to the height range you select ... so you essentially already have this.

    It's a feature I really like as I use it to spawn different vegetation at different heights.
     
  44. mattis89

    mattis89

    Joined:
    Jan 10, 2017
    Posts:
    1,100
    hmm, okay.. well I set min hight to be really far up in the mountains so only the mountaintips are like "spawnable, like not blue" and the rest is blue wich is under the min height.... and hit global spawn, still it spawns the whole terrain....?
     
  45. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    I appreciate 2018.1 is only just out, but GeNa is not wholly importing, so it seems. The menu item in GameObject is missing. No errors are generated, but what does import, does so very quickly, far moreso than in 2017.x. This is GeNa 1.5.0.2.
     
  46. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    Hmm. Oddly enough, the menu item just appeared. I had loaded Aquas, but that is broken for now, although I know there's an update coming. So I deleted that. Then an Aquas script in Enviro threw an error, so I deleted that entire folder, as I didn't need it. Then the Dreamteck welcome screen appeared out of nowhere and more Aquas errors, which were in an Editor folder, in the Assets root. Once I'd despatched that, GeNa appeared properly. Huh. Oh well, I'll plough on and see what happens next :D
     
  47. claudiorodriguescampos

    claudiorodriguescampos

    Joined:
    Jun 23, 2017
    Posts:
    98
    Hi, I have a terrain and want to know if I can populate the terrain with an 50 enemies(enemy is a prefab) with only one click? I mean, it is possible to config a gena spawner to do that based in the terrain location and area?

    ps: enemies must be across all the terrain, not only in a specific part
     
    Last edited: May 4, 2018
  48. ScourgeGames

    ScourgeGames

    Joined:
    Aug 22, 2017
    Posts:
    204
    You could probably make it populate like that, but its placement is meant to be local to the place you are clicking. That being said, if you are going to put 50 enemies on your terrain, you should really consider using a realtime spawner with pooling.
     
  49. KristofferH

    KristofferH

    Joined:
    Oct 27, 2012
    Posts:
    20
    @AdamGoodrich Hi Adam, this is an interesting assets indeed, but I have a few questions that I haven't seen any information on.

    How does Gaia and GeNa handle Global Illumination? You're talking about fully procedural generation and real-time spawning, but how does this work with the Unity's GI system? Do you still have to bake all the GI within the Unity Editor after the scene has been constructed, and bake light probes for the dynamically spawned objects at run-time? I saw that it can automatically place light probes. So all of this procedural world generation is done inside the editor, right? And then you bake the lighting, and build the stand-alone game. Or, could you use Gaia and GeNa to procedurally generate an infinite terrain at run-time in the stand-alone game itself (without the editor's baking functionallity) and have it lit properly with Global Illumination?
     
  50. AdamGoodrich

    AdamGoodrich

    Joined:
    Feb 12, 2013
    Posts:
    3,692
    They both put stuff into your scene - its up to Unity to handle GI - and the whole thing with Unity GI is that its pre-computed - so you can't use it on runtime generated environments.

    However, GeNa also has the ability to modify the settings of things as they are placed into your scene. So for example it can automatically place light probes, and modify your object settings so that it uses them instead of being light map static - this can reduce your light baking time from many hours down to less than a minute. This is a editor only feature as unity do not expose these API's at runtime.

    Gaia can do editor and runtime spawning, but i do not support runtime spawing as it introduces a number of issues. There is a runtimestapmer.cs file there that you can look at if you are feeling brave. Gaia 2 will be able to do both editor mode and runtime infinite.

    GeNa does both editor and runtime spawning. You pre-configure it in editor mode and save that as a prefab, and then call it at runtime.
     
    KristofferH and StevenPicard like this.
unityunity