Search Unity

  1. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  2. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  3. Unity 2017.1 is now released.
    Dismiss Notice
  4. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  5. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  6. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

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

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

  1. Gunsrequiem

    Gunsrequiem

    Joined:
    May 17, 2017
    Posts:
    69
    Hello, BHS!

    I just purchased both Emerald AI and Crux, and I must say I'm very excited to get them implemented with my project: Siegescape.

    Emerald AI is working perfectly, although I would like to ask you a couple of things if you have the time.

    First and foremost, I am utilizing the "Third Person Controller" by Opsive, and I was wondering if you have a way to have the damage caused by that asset to directly impact the Emerald AI objects. For now, I am utilizing the "Health" script that comes with TPC, but it's not as dynamic as it is not called within the Emerald AI object.

    Second, I'm having some issues getting Crux to work with Voxeland in that it is not spawning based on the textures selected. Since Voxeland is a voxel engine, I thought it might be due to the terrain textures being called throughout the entire height of the terrain (since it is filled, not planar), so I set it to call the rock textures that are placed on top of the actual terrain, thus ensuring the spawn is called on above-ground objects. However, this doesn't seem to work. Any thoughts on how I might create a workaround for this?

    I look forward to response, and I want to thank you in advance for your time regarding this matter.

    ~Mike
     
  2. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861

    Hey Mike!

    I can reach out to the developers of Opsive TPC to see if we can find full support with Emerald. Currently, we have a copy of the non-source code version so it isn't possible to see how its damage is called directly.

    It sounds like Voxeland isn't currently supported because Crux currently only works with Unity terrains. However, the 1.4 update, that is currently being worked on, will add tons of new features as well as mesh support, which should allow you to spawn on Voxeland terrains.

    As for texture lookup, that depends on the Voxland plugin. I looked through its documentation, but didn't see anything about getting a texture from a certain point. I can also reach out to this developer to see if we can find a solution for you.
     
  3. Gunsrequiem

    Gunsrequiem

    Joined:
    May 17, 2017
    Posts:
    69
    Thanks for the reply!

    I am currently working on a separate portion of the game that utilizes terrains, so for now it's okay to not have the functionality. Down the road, after 1.4 is released and you have implemented the mesh feature, I will toy with that to determine if I can get Crux to spawn.

    As for integration with TPC, that would be extremely helpful. I saw on the forums that you explained how to call the damage parameters with UFPS and others, but TPC wasn't included. I suppose for now, I can dig around and try figure out how to do it myself. If I do end up doing so, I will make sure to post it here since at least one other person asked about TPC integration.

    Thanks again!
     
  4. v_mace_v

    v_mace_v

    Joined:
    Feb 13, 2016
    Posts:
    18
    Do you have a rough idea of when the mesh support update might be ready?

    Cheers!
     
  5. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861
    Sounds good and you're welcome!


    Hey there!

    Version 1.1 will add support for mesh support. Version 1.1 is currently being worked on and should be submitted within the next few weeks, if everything is on schedule.
     
    v_mace_v likes this.
  6. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861
    Hey everyone,

    Just thought I'd share some information regarding the development of Crux 1.1. This update will bring some new features as well as some huge performance increases. The update should be submitted within the next few days. The other features that have been mentioned will come shortly after the 1.1 update as the feature below we the most important and most requested.

    The built-in object pooling system has been implemented with Crux and it works great. It can also dynamically expand to accommodate customizable population caps, if needed. The object pooling option allows an increase in performance of roughly 200% to 400+%, compared to using instantiation option. However, Instantiation is still an option for those who want to use it.

    The spawning node system has been implemented and allows AI to be spawned to spawning nodes. These spawning nodes allow AI to be deactivated until within a customizable range from the player. This helps with performance by not wasting it on AI that are too far away from the player. This feature works with both the object pooling and instantiation options, but is completely optional.

    ObjectPoolingAndSpawningNodes.png

    Flying and water AI options have been added. This will allow users to spawn both flying and water AI using Crux. The option is available in the AI's object tab. The range that the AI can be spawned is randomly generated based on the minimum and maximums set by the user.

    WaterAndFlyingAITypes.png
     
    Last edited: Jul 2, 2017
    v_mace_v, Stormy102 and Hitch42 like this.
  7. Gunsrequiem

    Gunsrequiem

    Joined:
    May 17, 2017
    Posts:
    69
    Can't wait! It's gonna be awesome!
     
  8. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    2,239
    Is MegaSplat support in yet?
     
  9. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861
    Thanks!


    I'm going to see if it can be squeezed in, but I'm not sure how hard implementation will be. If it's not added with the 1.1 update, it will be added shortly after.
     
  10. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861
    I looked into this, and while possible, it would take too long to implement before the 1.1 update is planned to be submitted. The 1.1 update required quite a bit of work and includes few important improvements. So, the 1.1 update should be submitted by this weekend and the 1.2 update should come within 2 to 4 weeks after that. The Crux roadmap section has been update to reflect what will be included with the 1.1 update and what will be included with the 1.2 update.

    For you, and anyone else who is interested, UniStorm support is already being worked on for the 1.2 version. UniStorm will need to have its own update in order for support to be possible as it needs to have a new script to add a custom preprocessor directive so the UniStorm features will only compile if UniStorm is present. The support will allow Crux the ability to spawn AI according to the time of day, weather, season, and more.
     
  11. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    2,239
    Thanks for the update.
     
  12. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861
    You're welcome.
     
  13. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861
    v_mace_v likes this.
  14. Ramulos

    Ramulos

    Joined:
    Feb 19, 2017
    Posts:
    13
    Hello,

    I recently bought Emerald Ai and Crux and was wondering if you could help. I used Gaia to create a terrain and then texture it. I implemented Emerald AI to my objects and the Crux to procedurally spawn them and it was working perfectly. I ran my Gaia terrain through the PolyWorld mesh converter to get a low poly style. The conversion removed the terrains textures and uses a material instead. Now Crux cant work on my terrain due to textures not being present.

    Is there any way to use Crux with a material? if anyone has used PolyWorld is there a way to preserve the textures?
     
  15. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861
    Hey there!

    Currently, only Unity Terrains are possible. However, with the 1.2 update, mesh support will be added.
     
  16. Ramulos

    Ramulos

    Joined:
    Feb 19, 2017
    Posts:
    13
    Thanks alot for the quick reply. Seeing as 1.1 update was just submitted Saturday 1.2 wont be out anytime soon. Though I'd love to have beta access if that's something you do for when mesh support find its way into beta.
     
  17. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861
    You're welcome!

    Crux 1.2 will be worked on while Emerald 1.4 is being worked on. I'm hoping the Crux update will take a about a month. You can certainly have beta access to Crux 1.2 when its ready.
     
  18. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861
    Hey everyone!

    Crux 1.1 has been accepted and is now live on the Asset Store!

    This update will bring some new features as well as some huge performance increases.

    Built-in Object Pooling
    The built-in object pooling system has been implemented with Crux and it works great. It can also dynamically expand to accommodate customizable population caps, if needed. The object pooling option allows an increase in performance of roughly 200% to 400+%, compared to using instantiation option. However, Instantiation is still an option for those who want to use it.

    Spawning Nodes
    The spawning node system has been implemented and allows AI to be spawned to spawning nodes. These spawning nodes allow AI to be deactivated until within a customizable range from the player. This helps with performance by not wasting it on AI that are too far away from the player. This feature works with both the object pooling and instantiation options, but is completely optional.

    ObjectPoolingAndSpawningNodes.png

    Flying and Water AI support
    Flying and water AI options have been added. This will allow users to spawn both flying and water AI using Crux. The option is available in the AI's object tab. The range that the AI can be spawned is randomly generated based on the minimum and maximums set by the user.

    WaterAndFlyingAITypes.png

    Redone Export to .txt Feature
    Crux's exporting feature has been improved as well as had some bug fixes. The exporting feature will now open up a saving window for you to save the generated .txt Spawn ID file. The AI's Category and Biome have also been added to the .txt file for better organizing.

    Updating to Crux 1.1
    Because users may have complex and large biomes, this update is intended to work without having to remove Crux prior to updating. Since there have been newly added lists within the Crux system, code has been added to dynamically add and expand the lists as needed to avoid errors. This goes for all biomes, categories, and objects.

    Coming Soon with Crux 1.2
    • Full UniStorm support to allow AI to spawn according to UniStorm's time of day, season, and weather.
    • Full Support for MegaSplat
    • Option to not spawn to textures
    • Mesh support
    • Spawn around tag option to spawn around areas such as camps, caves, city, etc.
     
    v_mace_v and Stormy102 like this.
  19. Gunsrequiem

    Gunsrequiem

    Joined:
    May 17, 2017
    Posts:
    69
    Any chance you'll be integrating Tenkoku in the same way as UniStorm at some point? That sounds like an amazing possibility for a more realized and dynamic world!

    I look forward to trying 1.1 :)
     
  20. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861
    Hey there!

    There's no plan to implement Tenkoku with Crux. However, if the creators of Tenkoku want to add support for Crux, that's entirely up to them. UniStorm integration is an added bonus for those who have both UniStorm and Crux :)
     
  21. KIR99

    KIR99

    Joined:
    Feb 21, 2017
    Posts:
    14
    Hey there, i'm just having a small issue with the updated Crux1.1, right now it doesn't allow me to spawn any animals or at least spawns one of them and I get the following error in runtime:

    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index

    System.Collections.Generic.List`1[UnityEngine.GameObject].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    Crux.AssignRarityCategories () (at Assets/Crux - Procedural AI Spawner/Scripts/System/Crux.cs:356)
    Crux+<InitializeCrux>c__Iterator1.MoveNext () (at Assets/Crux - Procedural AI Spawner/Scripts/System/Crux.cs:273)
    UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    Crux:Start() (at Assets/Crux - Procedural AI Spawner/Scripts/System/Crux.cs:262)



    Regarding the settings,
    I strictly have Crux for spawning Wildlife,
    I don't have any object pooling plus the spawn type and player Transform type is set to Standard. The only changes i've made to the Crux.cs script was that I've added a line in void start to auto assign the _PlayerObject transform to the player. (which i don't think is the cause this issue, since it worked fine last time)

    _PlayerObject = GameObject.FindGameObjectWithTag("Player").transform;

    It's also worth noting that within all the biomes are retained from the previous version and my animals within Wildlife are set to "common" rarity and the odds of spawning is set to 100.

    Could I have done something wrong in the settings which might have caused the "ArgumentOutOfRangeException" issue? Or could it be something to do with Terrrain Data in my scene?

    Any help would be greatly appreciated, thank you! :)
     
  22. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861
    Hey there!

    Strange, there shouldn't be any issues. The only thing I can think of is the new lists that were added with the 1.1 update, but these are supposed to be fixed automatically if you are updating from a previous version. Are you receiving this error during Runtime or while in the Editor?

    Those settings shouldn't be causing any issues. Have you tried creating a new Crux system to see if the problem is still occurring?

    If you can, try enabling object pooling to see if this fixes the error.

    Also, Crux has a built-in option for instantiated players. The Player Transform Type "Instantiate" option does almost the exact same thing that you've added and grabs the player by name during start.
     
  23. KIR99

    KIR99

    Joined:
    Feb 21, 2017
    Posts:
    14

    I ran through various tests and whatnot and i even rolled back to the old crux and i got the same issue, which is good because i think it means that something that's in my scene/project or that there's something wrong with the terrain itself which isn't giving any data to the TI script. I'm pretty sure there's something up with the terrain i'm using in the project.

    I do have multiple copies of the project with the old crux working good, I'll run through the tests over the other projects, worst come to worst i'll fall back on the old crux because it's working really well. :)

    Thanks for the fast response and for your help!
    I'll let you know if I find anything! :)
     
  24. KIR99

    KIR99

    Joined:
    Feb 21, 2017
    Posts:
    14
    Okay so i found out what was wrong in my scene! :)

    I've made the noob mistake of having the Y axis on my Crux object too far up (55f) where i assumed this object couldn't reach the terrain in order to get the info. I've just simply set the Crux object position on par with the Terrain's Y axis and it works perfectly haha
     
    Last edited: Jul 18, 2017
  25. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861
    Great to hear you were able to figure everything out!
     
  26. jrackley

    jrackley

    Joined:
    Jan 26, 2017
    Posts:
    14
    Can someone please explain to me how to set up the node based spawning? I am slightly confused on how this works, and any help would be appreciated,
    thanks in advance
     
  27. BHS

    BHS

    Joined:
    Dec 21, 2009
    Posts:
    2,861
    Hey there!

    There is nothing you need to do on your end with setting up nodes. All you have to do is specify the distance at which the objects are disabled.

    The node system simply spawns AI to nodes that are disabled when they are too far away from the player. This helps increase performance by keeping AI disabled until the player is closer to the AI.
     
    jrackley likes this.
  28. jrackley

    jrackley

    Joined:
    Jan 26, 2017
    Posts:
    14
    Thank you for the fast reply and explanation.