Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Crux 2.0 - Procedural AI Spawner for Terrains (Biomes, Population Caps, and more)

Discussion in 'Assets and Asset Store' started by BHS, Dec 13, 2016.

  1. rpg_gamer

    rpg_gamer

    Joined:
    Nov 28, 2012
    Posts:
    214

    yes and am using ufps multiplayer. so when the player is instantiated, it's name becomes "1 (LOCAL,MASTER)" I am entering that into the field for the player's name, but it still is not seeing it obviously.
     
  2. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Crux hasn't been tested with network based games so I think finding a player is a little different. If UFPS Multiplayer uses Photon, try changing the following with the Crux script.

    If the eblow doesn't work, you can also try increasing the WaitForSeconds length. Maybe your player is being created after Crux is looking for it.

    Find this line:
    Code (CSharp):
    1.  
    2. if (PlayerTransformType == 2)
    3. {
    4.    //If the instantiated player option is enabled, add a slight delay when looking for our instantiated    player to ensure it has been spawned.
    5.    yield return new WaitForSeconds(0.1f);
    6.    _PlayerObject = GameObject.Find(PlayerTransformName).transform;
    7. }
    8.  
    And update it to the following (This hasn't been tested)
    Code (CSharp):
    1.  
    2. if (PlayerTransformType == 2)
    3. {
    4.    _PlayerObject = GameObject.Find(PlayerTransformName).transform;
    5.    int playerId = _PlayerObject.PhotonView.Find().owner.ID;
    6.    _PlayerObject = PhotonView.Find(playerId).gameObject;
    7. }
    8.  
    Here's a few links that have code for getting a player with Photon. Hopefully they can help.
    1) http://answers.unity3d.com/questions/644125/issues-with-finding-a-gameobject-using-photonview.html
    2) http://forum.photonengine.com/discussion/6051/find-local-user-as-gameobject

    We can work on finding full support for Photon when we get a chance to do so.
     
    Last edited: Feb 1, 2017
  3. Marcirazzo

    Marcirazzo

    Joined:
    Nov 27, 2015
    Posts:
    47
    The scene of the video is now included in the project? Which trees and bushes of "SpeedTree" have been used for desert biome?
     
    Last edited: Feb 8, 2017
  4. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there,

    No, the scene and assets in the video are not included with Crux. However, we do plan on adding the terrain shown with different textures as the new demo scene with our next update.

    The trees used are from the Desktop SpeedTree Package.
     
  5. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    This looks fantastic. I'm wondering if this would work with MegaSplat because their texturing system is very different and Crux spawns seemed to be based on texturing.
     
  6. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    Thanks for your interest in Crux.

    We have talked with the developer of MegaSplat and he said it should be possible, with a few minor modification to Crux. There is a component you can add to terrains using MegaSplat, that comes with MegaSplat, to get the texture at a certain location. You would just modify Crux's TerrainInfo script to get the terrain information from MegaSplat's instead of Crux's.

    We will work on getting a tutorial for MegaSplat integration up on the Crux Wiki site when we can.
     
  7. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Thanks for the information. I'm definitely considering purchasing this.
     
  8. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    You're welcome.

    For you, and others that are interested, we now have a copy of MegaSplat and are working with the developer to integrate full support. We are planning on putting together a tutorial for MegaSplat integration on the Crux Wiki site sometime this week.
     
    magique likes this.
  9. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey everyone!

    Crux 1.0.5 has been submitted and is awaiting approval. This update improves some of the spawning calculations as well as adds a new demo. This demo has two biomes, desert and forest, that better demonstrate Crux's biome spawning.

    CruxDemo1.png
    CruxDemo2.png
     
  10. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey everyone!

    Crux 1.0.5 has been accepted and is now live. This update improves some of the spawning calculations as well as adds a new demo. This demo has two biomes, desert and forest, that better demonstrate Crux's biome spawning.
     
  11. KIR99

    KIR99

    Joined:
    Feb 21, 2017
    Posts:
    19
    Hey there!

    So far I really enjoy Crux and how it's functioning, so far I'm able to get the basics of it. However, regarding the Spawning Options, I was just wondering whether if it was possible to have a feature that allows Crux to have multiple inactive mini-spawners that have their own radius to act as a biome and they can only activate when the player's radius interacts with the mini spawner's radius. This would be ideal to have when allocating certain areas to spawn certain animals. (Like Far Cry 3&4)
     
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey!

    Thanks, it's great to hear you're enjoying Crux. We are actually currently working on this feature for our next update. It works by spawning the AI that Crux spawns to spawners that enable and disable when a player is within range. This allows Crux to work as normal while keeping things more efficient. The new spawn point feature will still support all of Crux's features.
     
    KIR99 likes this.
  13. KIR99

    KIR99

    Joined:
    Feb 21, 2017
    Posts:
    19
    Just another quick question, when do you approximately think this next update will be out?
     
  14. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    The new update will most likely be submitted within the next two weeks.
     
  15. HiddenFace

    HiddenFace

    Joined:
    Feb 13, 2016
    Posts:
    12
    HI, Thx for this package !

    But i have a probleme, i try to spawn npc on my magic map. I add texture from my map in the forrest biome, but i get an error :

    "SetDestination" can only be called on an active agent that has been placed on a NavMesh.
    UnityEngine.AI.NavMeshAgent:SetDestination(Vector3)
    SimpleAI:Wander() (at Assets/Crux - Procedural AI Spawner/Scripts/Examples/SimpleAI.cs:35)

    What i have to do ? Thx^^
     
  16. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    You are welcome.

    This is happening because the sample AI system uses Unity's NavMesh which requires the terrain to baked with NavMesh. This isn't required by Crux, but just the sample AI system.

    For info on NavMesh building, you can see the Unity guide here: https://docs.unity3d.com/Manual/nav-BuildingNavMesh.html
     
  17. HiddenFace

    HiddenFace

    Joined:
    Feb 13, 2016
    Posts:
    12
    Hey, thx for your quick answer!!

    Yeah i have found how to bake the terrain, thx ! But i have still the same error :/ Less frequently but still here...
     
  18. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    You're welcome!

    What version of Crux are you using? This error shouldn't be happening if the NavMesh is baked. Ensure that you properly have NavMesh on your entire terrain. You can check this with the Navigation tab in Unity.

    Depending on your models, you may need to use the offset to ensure your AI are properly spawning on the terrain. Some model's position is a little off due to the way they were modeled. This can be fixed by using the offset. To see the amount of offset you may need to use, check the Y position of where the AI are spawning on your terrain during runtime.
     
  19. Marcirazzo

    Marcirazzo

    Joined:
    Nov 27, 2015
    Posts:
    47
    It is better to use the package with "Gaia" or "MapMagic"? I saw that Gaia will support multi-tile.
     
  20. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    Crux will work perfectly fine with both Gaia and Map Magic. There is no better system. The system you should choose should depend on your project's/game's needs.
     
    Marcirazzo likes this.
  21. henmachuca

    henmachuca

    Joined:
    Oct 14, 2016
    Posts:
    105
    Hello
    Very interesting system you got there.

    - I am creating an isometric RPG game and it would be nice to have a system that spawn monsters based on player proximity to an area, by hitting a collider or a trigger.... Thus, having monster spawned only when needed. Does your tool supports something like This!?

    - Does your system uses object pooling for better efficiency?

    - Oh and by the way I am using a framework right now and I have a fairly good code understanding.... But If I have any troubles would you be available to do some custom work(paid) to help me make Crux work with what I have?!

    Thank You!
    Henry
     
    Last edited: Mar 7, 2017
  22. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey Henry!

    1) This feature isn't currently available however, it is coming with the next version of Crux. The next version of Crux should be submitted within the next couple of weeks.

    2) Object poooing hasn't yet implemented because there aren't enough objects being spawned for it to really be effective. However, it may be something we add with a future update. Crux performs well and is very efficient.

    3) We can discuss this via a PM.
     
  23. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    I'm not personally asking for object pooling because I have solutions already for that, but your statement is not valid. Even instantiating a single object at runtime is going to cause a performance spike, especially on less capable machines such as mobile and console. Any runtime instantiations are bad.
     
  24. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    The statement was related to computers, not mobile devices or consoles. According to Unity's Profiler, there were no performance spikes while using Crux, or any generated garbage. The times you see performance spikes from instantiating during runtime is when you are doing it many times a second while using Destroy() shortly after, such as with bullets. Crux makes efficient instantiations once every spawn interval and only if the position is valid, which only happens once every few seconds.
     
  25. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    A lot of people develop for mobile and consoles and spikes can even occur on PCs depending on the specs and the precise use case. Generally speaking, pooling is the way to go. You always want to keep runtime instantiations/allocations to an absolute minimum.
     
  26. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Agreed, we plan on adding object pooling with a future update. It is certainly something that is beneficial.
     
    magique likes this.
  27. bobbybau

    bobbybau

    Joined:
    Feb 28, 2017
    Posts:
    33
    Question about your asset before I buy it. Can it link up to an sql database and spawn from it?
     
  28. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    This is the very reason we pulled Crux from our game for now since we develop for mobile only and console with Unity, we use Unreal for PC games. anyways multi player has been a real pain with this tool as well.

    So until we get more time to work with it, we pulled it, I hope to see Mega Splat support, making optimized for mobile console, atleast, before we bother using it again ...

    If your making a PC games ... single player its fine.. We are NOT. I bought as it said it was for mobile as well. we get nasty frame rates due to this very reason. We plan to make our own pooling system for it, once we get more time, as we are near release and we bought this hoping to save time, which didn't happen... I like what the tool can do,but its NOT there yet...with updates I think it can be, if the devs understand the need/wants we need.

    I bought CRUX the first few days it was out..
     
    Stormy102 likes this.
  29. Mafutta

    Mafutta

    Joined:
    Sep 30, 2014
    Posts:
    45
    Hi any known issues with:
    Crux + Emerald AI + Unistorm +Unity 5.6.0f1(linux) + Gaia + Aquas?

    I would like to use your tools to have some animals patrol the beach (penguins) and when they see the player I want them to flee into the water, swim away for a bit , then when the player is far enough away, I want them to come back and patrol the beach. Is this possible with Emerald AI + Crux in my environment? I guess one of the main questions is how to set it up so that they know where the water is (y=50)?, so maybe one can use that fact. Also I assume your tools can work without a navmesh for a large terrain (as made with Gaia) Is that correct?
     
  30. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    Crux gets its objects from prefabs so you'd have to modify the script in order for it link up to an sql database.


    Hey there!

    MegaSplat support is coming with the next update. We understand the importance of object pooling and mobile optimizations. Object pooling is a feature that will be added soon, most likely with the next update. I don't recall stating that Crux was for mobile, especially without Crux having object pooling. However, I apologize if there were any misunderstandings.


    Hey there!

    Crux works with all the mentioned assets except Auqas which hasn't yet been tested. However, Aquas shouldn't have any issues.

    Emerald AI don't have the ability to detect water. However, it is a feature that we would like to add soon. AI do have the ability to patrol an area within their Wander Radius, but they will generate random waypoints within that radius. Once they are triggered to flee, they will continue to do so until flee target is out of range. They will then return back to their wandering area and continue patrolling.

    Emerald AI does need NavMesh to work. However, this doesn't mean it can't be used with large terrains. We have used big terrains generated with Gaia (about 16 square kilometers) and baked them with NavMesh.
     
  31. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634

    Hmm, I typical ask, but I may have thought it did since you do support your other asset.
    Unistorm integration. So this can be confusing then as Unistorm is for PC and mobile as I use it for mobile which is why I bought it. So I may have mis understood.

    I don't mind writing my own, pooling, and networking,but wanted others to know, that right now its not working for mobile due to reason stated.

    So you MAY want to say it may have Unistorm integration...BUT this excludes Mobile. I'm not upset either way, I don't mind waiting to use it.. either.
     
  32. Shadex

    Shadex

    Joined:
    Dec 18, 2013
    Posts:
    89
    Hey, couple of questions.

    1) Can the object spawner spawn both the AI and the object together? Say i want a random encounter with trolls around a campfire, can it spawn the camp fire with the trolls together, or will it spawn a campfire randomly and seperately spawn trolls in random locations?
    2) Does the spawn system work in the air, for flying AI?
    3) How does the spawn system detect textures on terrain? For instance, Gaia blends pretty much every texture. Which spawn system is called if something like grass and sand are blended 50%? What happens if grass is 80% and sand is 20%?

    Thank you so much for your time!
     
  33. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    1) Crux can only spawn AI or objects. It can't spawn both at once. However, we plan on adding support for object detection with the next version or two that should allow you to do so.
    2) No, Crux does not spawn in the air.
    3) Crux takes the strongest texture at the point of spawning. If the grass is 80%, and the sand is 20%, it would spawn on the grass. If it's approximately 50/50, it should still spawn with the texture that is the strongest, even if it's very close.
     
  34. KIR99

    KIR99

    Joined:
    Feb 21, 2017
    Posts:
    19
    Hey Shadex, i dont know if this would help but i was able to use Crux to spawn flying AI by making the flying AI prefab a child of an empty GameObject that was positioned at 0 on the Y axis where its child (flocking prefab) was positioned on a higher Y axis. it seemed to work fine in my case :)

    EDIT: I guess it worked because I was using a bird flocking system that spawns groups of birds as a single prefab
     
    Last edited: Apr 18, 2017
  35. zenGarden

    zenGarden

    Joined:
    Mar 30, 2013
    Posts:
    4,538
    Hi,

    The plugin looks good, i have few questions :

    Hi,
    I am also interested in this new spawn feature only and totally skip the actual terrain biomes texture painting ?

    It is planned for birds wandering around on some zone ? letting us add our own AI prefabs ?
    With the new spawning system not based on terrain texture it should work.

    It is planned for next update ?

    Thanks.
     
    v_James_v likes this.
  36. v_James_v

    v_James_v

    Joined:
    Feb 13, 2016
    Posts:
    40
    I'm also keen to know if pooling will be included in the next update. This is a critical feature missing. I'll pick up a copy once implemented.

    Cheers.
     
  37. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    An option to bypass texture spawning and spawn flying AI will be in the next update.


    Hey there!

    Yes, object pooling is a top priority for the next update.
     
    v_James_v likes this.
  38. v_James_v

    v_James_v

    Joined:
    Feb 13, 2016
    Posts:
    40
    Awesome, thank you! :)
     
  39. AhmadouDiarra

    AhmadouDiarra

    Joined:
    Apr 21, 2017
    Posts:
    2
    Hi all, Just want to know what's the difference between Crux and Emerald AI?
     
  40. Stormy102

    Stormy102

    Joined:
    Jan 17, 2014
    Posts:
    495
    Emerald is an Ai system - it manages movement, behaviours and animations. Crux handles AI spawning, so spawning them in particular biomes or locations.
     
  41. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    HellPatrol and v_James_v like this.
  42. HellPatrol

    HellPatrol

    Joined:
    Jun 29, 2014
    Posts:
    38
    Crux is the right tool for environments without a terrain? Like normal meshs with single or even altas textures?
     
  43. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    Meshes are not currently supported, but we plan to add this feature in the near future.
     
    v_James_v and HellPatrol like this.
  44. v_James_v

    v_James_v

    Joined:
    Feb 13, 2016
    Posts:
    40
    +1 for mesh support
     
  45. KIR99

    KIR99

    Joined:
    Feb 21, 2017
    Posts:
    19
    Hey there,
    i'm currently using Map Magic and Relief Terrain Pack with Crux but it appears that the two build terrain textures within the objects of themselves that aren't on the terrain. Is it possible to bypass the terrain info and have it read off MapMagic or RTP?
     
  46. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Hey there!

    Crux should work fine with Map Magic. It's what was used in Crux's demo videos. However, it hasn't been tested with RTP. I can reach out to the RTP developer to see if full support can be added.
     
  47. KIR99

    KIR99

    Joined:
    Feb 21, 2017
    Posts:
    19
    Hi,

    I solved the issue, it was a settings within MapMagic, my apologies but thank you for the fast response :)

    You guys rock btw, i'm loving Crux soo much
     
  48. TheSeawolf

    TheSeawolf

    Joined:
    Apr 10, 2015
    Posts:
    267
    @BHS , hey guys I have both Unistorm, Emerald and Crux installed on my project but seem to be having a problem with my Crux animals that spawn being animated.

    I can't find a place to add any animations in Crux?

    I am using the same model for both and my Emerald animals that are placed are all animated. I have created an AI and navmeshed the unity terrain?

    Any ideas what I am doing wrong?
     
  49. TheSeawolf

    TheSeawolf

    Joined:
    Apr 10, 2015
    Posts:
    267
    Regarding my question above, I worked out that you have create the AI animal with Emerald first then it will work in Crux.

    I couldn't find this is the documentation for Crux or on the wiki? Did I simply over look this, or have I missed a tutorial video by chance?
     
  50. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    4,760
    Great to hear and you're welcome!


    Hey there!

    Great to hear you got everything figured out.

    The documentation can be found by going to Window>Crux>Documentstion in Unity. You can also use the link here: http://crux-procedural-ai-spawner.wikia.com/wiki/Crux_-_Procedural_AI_Spawner_Wiki?useskin=oasis
     
    TheSeawolf likes this.