Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Flock Box DOTS 2.0 - Flocking simulator

Discussion in 'Assets and Asset Store' started by check_marc, Mar 19, 2020.

  1. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    55
    @XyrisKenn Go to FlockBox > Import DOTS Packages to open this window for the most up to date packages upload_2022-9-29_18-32-42.png
    Also note that as previously mentioned in this thread, Entities 0.51 is only supported by 2021.3.4+
     
    XyrisKenn likes this.
  2. CodeWiesel

    CodeWiesel

    Joined:
    Jun 1, 2022
    Posts:
    4
    Hi @check_marc

    Are you planning to update FlockBox to the newly released com.unity.entities version 1.0.0? (currently -exp.12)

    If(so)
    {
    I'll wait and stop struggling trying to do it myself :D
    Do you have a rough guess of a release date?​
    }

    Thanks and kind regards

    Mark
     
  3. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    55
    @CodeWiesel I am planning to keep supporting new versions of com.unity.entities into the future, but 1.0.0 is still experimental and currently only compatible with beta versions of Unity (2022.2.0b8+) so I'm holding off until it becomes more stable.
     
    lclemens and CodeWiesel like this.
  4. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    741
    I'm considering purchasing Flock Box, but I'm unsure if it will work in my situation. I'm using the recast graph from the A* Pathfinding Project asset on a terrain that is converted to an entity with a mesh via a script (like the scripts here: https://forum.unity.com/threads/using-unity-terrain-with-dots-workflow.755105/ ). The idea is that there are lots of enemies spawning and I want them to follow an A* generated path to get to a particular destination. The player can place buildings, which performs a navmesh cut so that enemies try to go around the buildings. This works right now, but I would also like the enemies to have local avoidance without adding physics bodies, which is where I was hoping Flock Box might help.

    So my question is... do I have any hope of getting Flock Box to work in this scenario, considering that I'm using A* Pathfinding Project's navmesh (with navmesh cutting) and a mesh-entity terrain?
     
    Last edited: Nov 4, 2022
  5. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    55
    @lclemens It could potentially work. You would need to modify the systems that apply the calculated velocity directly to the LocalToWorld and instead weight it in combination with the desired pathfinding direction.
     
    lclemens likes this.
  6. Onat-H

    Onat-H

    Joined:
    Mar 11, 2015
    Posts:
    195
    Hi, thanks for this amazing package first of all :) When can we expect compatibility with Entities 1.0?
     
    lclemens likes this.
  7. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    55
    @Onat-H It's currently in development but I don't have a release estimate yet
     
    CrazyCode_, Onat-H and lilacsky824 like this.
  8. Onat-H

    Onat-H

    Joined:
    Mar 11, 2015
    Posts:
    195
    Thanks for the Info!

     
  9. wechat_os_Qy07oG6LBuLwxrt0ao4ZkEwPc

    wechat_os_Qy07oG6LBuLwxrt0ao4ZkEwPc

    Joined:
    Jun 28, 2021
    Posts:
    17
    hi, I have some doubts.Why is there a difference between DOTS mode and general mode performance.
    For example, BOID in DOST mode reacts more slowly, and they collide with the player while normal mode does not
     
  10. arminiuspp

    arminiuspp

    Joined:
    Jun 15, 2020
    Posts:
    54
    hello, I have a problem where I used sharks for flocks, its works well apart from when they hit the edge the flock (shark) snaps into 360 turn fast without smoothness or whatever. How it this fixed? Thank you!
     
  11. theflorist614

    theflorist614

    Joined:
    Jul 2, 2022
    Posts:
    6
    Just recently purchased the asset. I am going to spend some time poking around with it. I am trying to create a game about herding sheep. I am curious what the developers recommendations would be for setting up such a project. What would be the best way to go about having the agents move away from the player as he gets closer to them and possible be able to steer them left or right?
     
  12. alexmalaugh

    alexmalaugh

    Joined:
    Jun 19, 2014
    Posts:
    1
    Hi, I only get 1 unit when using DOTS. Without DOTS I get the number I put in the population field
     
  13. ml785

    ml785

    Joined:
    Dec 20, 2018
    Posts:
    119
    Is it possible to make the flock move along a spline?
     
  14. Meta_Bird

    Meta_Bird

    Joined:
    Apr 25, 2020
    Posts:
    16
    Hi @check_marc, thanks for a great asset.

    I was confused why the Twitch Dampening was causing the agents to freeze in place until I realised that the script should be attached to a child game object of the agent, and the mesh attached to a child of the Twitch Dampening game object (i think).

    Leaving this here in case others run into the same confusion.

    Daniel
     
    Last edited: Mar 17, 2023
    check_marc likes this.
  15. meeth_

    meeth_

    Joined:
    May 27, 2015
    Posts:
    11
    Does this package work with Unity's built-in NavMesh system?
     
    lclemens likes this.
  16. cg_will

    cg_will

    Joined:
    Jan 12, 2016
    Posts:
    1
    @check_marc Thank you for your great asset. I was wondering if you have a rough estimate for DOTs 1.0. Depending on the timeline i have to include your package at a later point in my project. Thanks in advance.
     
    lclemens likes this.
  17. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    55
    Increase the buffer zone of the FlockBox and the weight of the Containment behavior until they don't collide with the sides.
     
  18. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    55
    Look at the Player Control Demo as a starting point. Use the Flee behavior to get the sheep to run away from the player.
     
  19. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    55
    No but you could theoretically implement a Steering Behavior that does this.
     
  20. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    55
    Not explicitly, but you could have an invisible nav mesh agent acting as a target for the Seek Position behavior.
     
  21. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    55
    They're different implementations. They should behave similarly but may not be 1:1. Also some Steering Behaviors haven't been implemented for DOTS.
     
  22. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    55
    I'll need more info to diagnose this.
     
  23. meeth_

    meeth_

    Joined:
    May 27, 2015
    Posts:
    11
    I see. Can I ask the reason as to why the target should be an invisible nav mesh agent?

    Also, I have just one last question, does this package support mobile?
     
  24. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    55
    @meeth_ That's just a strategy for bridging the two systems. If you wanted your agent to perfectly follow the Nav Mesh you would just use a Nav Mesh Agent. It seems like what you want is for the Nav Mesh system to provide one the the influencing forces affecting the agent's steering. That's what Seek Position would do. The Nav Mesh Agent would be invisible because it's just a target for the Steering Agent to follow.

    Yes it will work on mobile.
     
    meeth_ likes this.
  25. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    55
    @cg_will No estimate. The primary hurdle at the moment is figuring out how to maintain the DOTS workflow now that IConvertGameObjectToEntity has been deprecated and replaced with Baking.
     
    Last edited: Apr 30, 2023
  26. yambetam

    yambetam

    Joined:
    Jan 21, 2019
    Posts:
    1
    Hi @check_mark

    I wanted to render boids with this fish shader from Unity.

    The vertex animation works if I preview a single boid in the scene, but it doesn't work when boids are rendered in a flock.

    This is true for both normal and DOTS mode.

    Is there a way to make vertex animations work with Flock Box? I couldn't find info about this in the manual.

    Thank you
     
  27. pawellyczkowski

    pawellyczkowski

    Joined:
    Nov 29, 2018
    Posts:
    1
    @check_mark

    When I use World Space Flocking + Wrap Edges in DOTS mode I get these errors, and on Flockbox changing position all the agents align in this way. All is fine in normal mode. I'm on Unity 2021.3.20f1
    upload_2023-5-15_15-10-41.png
     
  28. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    278
    Hi @check_marc , can we have upgraded version to latest Unity's ECS.
    Since it's out of preview, I can't use these old recommended package versions.

    upload_2023-6-8_11-7-14.png
    upload_2023-6-8_11-7-0.png
     
    lclemens likes this.
  29. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    278
    I have some more questions regarding gameplay scripting:
    -How to handle Leader die or leave the flockbox?
    -I know boids can detect Leader to follow by tag, but can I forcefully assign Leader via script?
    -Api for an Agent to join a FlockBox is kinda confusing: agent.Spawn(box)
    Can it be like box.Add(agent)
    And how to remove agent? Like when agent controlled by player that leave the box, I'd need an api call to box.Remove(agent) for this.
    I found out that we have public LeaveFlockBox function, but why is it private?
     
  30. pietrina

    pietrina

    Joined:
    Aug 22, 2015
    Posts:
    15
    hi,

    DOTS version not works :( in Unity 2023,

    can we expect any update?
     
    lclemens likes this.
  31. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    741
    DOTS itself isn't supported in Unity 2023, so a lot of DOTS things won't work in 2023 until unity officially release a version of 2023 that is DOTS compatible. For official DOTS support the latest you can use is 2022.3.5.
     
    Last edited: Aug 10, 2023
  32. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    741
    Almost all DOTS developers are using DOTS 1.0 now. Is it correct that Flock Box DOTS does not have DOTS 1.0 support?
     
  33. Yurij-Chirkov

    Yurij-Chirkov

    Joined:
    Aug 17, 2013
    Posts:
    8
    +1 Towards requesting support for Unity.Entities 1.0
     
  34. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    278
    guys when the dev is not providing new updates, reminder that the non-ecs feature of this asset is also very performant.
    My game is currently using it. Just remember to cull the flock boxes far from your character, the game can still have great performance with some flock boxes near you.
     
    lclemens likes this.
  35. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    741
    Yeah it looks really awesome for game-object based games, but there a lot of us who built entire games around entities so game-objects are not an option for us. Turbo Makes Games, which focuses on DOTS, recently highlighted this asset in a video, but if it's still using DOTS 0.51 then a lot of us DOTS junkies won't be able to use it, so I'm trying to get clarification on the version number.
     
    Spikebor likes this.
  36. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    278
    Yea it's unfortunate that we don't have updates recently. but regarding the asset is very cheap I guess there're not much we can ask. Have to upgrade the asset ourselves maybe, but the doc of ECS is not as friendly as the doc I've used to when I first start learning Unity a few years back.
    Side note, same as Turbo Makes Games~ If I make video about assets I would highlight this one too, good one, easy to use. Just not very up to date haha.
     
    lclemens likes this.
  37. Yurij-Chirkov

    Yurij-Chirkov

    Joined:
    Aug 17, 2013
    Posts:
    8
    Package is already built with DOTS. Applying movement to Entities could not be too complicated.

    Moreover, each project has specific restrictions, so having a capable flocking library could be better than bloaty packaged solution.
     
  38. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    741
    I haven't bought the asset so I can't say for sure, but my understanding is that it used to work in ECS projects, but now it won't work for most projects because it hasn't been updated to DOTS 1.0 and most of us have upgraded. I don't know if Flock Box uses a plugin or if the source code is available to upgrade. There were a ton of breaking changes between 0.51 to 1.0, so it might not be a trivial upgrade.
     
  39. Yurij-Chirkov

    Yurij-Chirkov

    Joined:
    Aug 17, 2013
    Posts:
    8
    Hi @Iclemens

    You're correct. It was developed for the Entities 0.51.

    Just purchased the package. It implements it's own solution to bridge between GameObjects and Entities seamlessly using outdated Conversion workflow.

    To keep it would mean to completely rewrite huge part of the package.

    Without it the update is fairly straightforward. I've managed to spend 30 minutes to update outdated API's.

    The package has an excellent implementation of flocking behaviours.

    It wouldn't work out of the box even with after updating API's. It would require you to manually review the code and use parts of implementation within your own project.
     
    CrazyCode_ and lclemens like this.
  40. bvonline

    bvonline

    Joined:
    Feb 27, 2021
    Posts:
    79
    General question: does installing the DOT relevant packages cause in general crashing of Unity projects, in case it isn't installed already - especially if other assets are installed? in which cases is installing it critical?
     
  41. lfd547

    lfd547

    Joined:
    Mar 26, 2019
    Posts:
    1
    is there any plan to support entities 1.0.14?
     
    lclemens likes this.