Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  1. Micz84

    Micz84

    Joined:
    Jul 21, 2012
    Posts:
    194
    I understand that it is the first element in a given key of MultiHashMap, but it same entity won't be twice in different keys as they are a hash of position. But maybe I am still missing something.

    I wish code had some comments :) explaining why everything is done as it is it would help.
     
  2. OleJuergensen

    OleJuergensen

    Joined:
    Mar 21, 2018
    Posts:
    4
    Yes, it does not seem to make sense. The HashPositions job would have to add the same entity to the hashMap multiple times. Or at least the same index, so maybe the index is not unique? Actually I find several thousand boids, but indeices always seem to be in the hundreds. So I guess the index is not unique.
     
    Last edited: Feb 10, 2019
  3. OleJuergensen

    OleJuergensen

    Joined:
    Mar 21, 2018
    Posts:
    4
    Okay, so the HashPositions job that originally fills the HashMap is a
    IJobProcessComponentDataWithEntity, which uses chunk iteration. The indices it writes to the hashMap as values are chunk indices and therefore multiple entities have the same index. I think the naming of many signatures in ECS could be improved. The lack of documentation and comments does not help either XD