Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

[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:
    53
    @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:
    53
    @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:
    621
    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:
    53
    @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:
    190
    Hi, thanks for this amazing package first of all :) When can we expect compatibility with Entities 1.0?
     
  7. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    53
    @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:
    190
    Thanks for the Info!

     
  9. wechat_os_Qy07oG6LBuLwxrt0ao4ZkEwPc

    wechat_os_Qy07oG6LBuLwxrt0ao4ZkEwPc

    Joined:
    Jun 28, 2021
    Posts:
    16
    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:
    107
    Is it possible to make the flock move along a spline?
     
  14. Meta_Bird

    Meta_Bird

    Joined:
    Apr 25, 2020
    Posts:
    10
    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:
    9
    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:
    53
    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:
    53
    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:
    53
    No but you could theoretically implement a Steering Behavior that does this.
     
  20. check_marc

    check_marc

    Joined:
    Jan 26, 2013
    Posts:
    53
    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:
    53
    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:
    53
    I'll need more info to diagnose this.
     
  23. meeth_

    meeth_

    Joined:
    May 27, 2015
    Posts:
    9
    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:
    53
    @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:
    53
    @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:
    212
    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
     
  29. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    212
    Can I have a terrain + physics steering agent combo? I tried to mix their code but things went terribly wrong
    (┳◡┳)
     
  30. Spikebor

    Spikebor

    Joined:
    May 30, 2019
    Posts:
    212
    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?