Search Unity

  1. How has 2019.2 and the beta been for you so far? Give us feedback in this thread.
    Dismiss Notice

Unity ECS and Job System in production

Discussion in 'Data Oriented Technology Stack' started by eizenhorn, Sep 26, 2018.

  1. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    1,312
    It’s hybrid approach of A* and Potential Fields, world splitted to big locations (which splitted to 1 unit size grid) On changing obstacles in location, invalidate this location and recalculate portals from this location, to other locations, based on that, I build/change nodes graph and find path from current location to destination location, after that, I’m going through finded graph path and for every location, which included in this graph path, build cost field and then vector field, after all I’m cache locations by some hash in hashmap and all units in same location use this already generated vector fields for moving without requesting new pathfinding. In other words - first request find path, other - reuse this. It’s old approach from Supreme Commander from far 2010 (http://www.gameaipro.com/GameAIPro/...nding_and_Steering_Using_Flow_Field_Tiles.pdf), which in turn, use Crowd Pathfinding approach from far 2006 (http://grail.cs.washington.edu/projects/crowd-flows/continuum-crowds.pdf)
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    4,796
    This are very interesting readings. Thx for sharing this insight.
     
  3. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    1,312
    Debug...Debug never changes...
    upload_2019-4-22_21-15-54.png
     
    psuong, NeatWolf, fherbst and 3 others like this.
  4. mmankt

    mmankt

    Joined:
    Apr 29, 2015
    Posts:
    32
    very cool! we are also using flow fields in Spuds Unearthed (pre generated before build for each map, save as an array of bytes - each byte is converted to 2d dir when sampling)
     
  5. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    450
    Has anybody released games that use Burst? I mean a game that's already in the hands of players? We made massive optimizations using Burst but I'm still reluctant to enable it because players report crashes when we do.
     
  6. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    4,796
    It may be, that not every hardware is fully compatible with burst yet. I think there were some issues with iOS not so long ago. Mobiles may act a bit different than desktops as well.

    I don't have released product yet. However, since I run tons of tests all the time, in my experience, when burst is enabled, crashes happens most often, when there is some logic error. For example negative index of arrays, or infinity loops. Then I disable burst and test that particular job, until I got that bug again and "kill" it. Sometimes is very rare case. But can happen for one, or other reason.
     
  7. mmankt

    mmankt

    Joined:
    Apr 29, 2015
    Posts:
    32
    Our game is not using burst, i'm converting some of the systems to utilize it, but some of them give me strange errors but i'm still on 2018.3 and some older version. my work on optimizing the game with multithreading and il2cpp resulted in our game running fast enough on base ps4 so right now i'm really happy with it.
     
  8. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    450
    Haven't posted our game here yet because we're not yet confident with Burst (used but disabled). Now, I can definitely say that it's working in production. Our early access game just turned Alpha 3 and we enabled Burst compilation. There are no reports of crashes so far. Unlike before where we accidentally enable Burst in release, we get a deluge of reports about the game crashing. Now, I can confidently say that Burst works.

    We used DOTS for our rendering as describe in these blog posts:
    https://coffeebraingames.wordpress.com/2018/08/19/how-unitys-ecs-expands-your-optimization-space/
    https://coffeebraingames.wordpress....o-a-monobehaviour-based-project-a-true-story/
    https://coffeebraingames.wordpress....ded-unitys-camera-render-our-game-ran-faster/

    Lately, we also used it to optimize our path finding system:
    https://coffeebraingames.wordpress.com/2019/04/14/how-fast-could-burst-compiled-a-be/
    https://coffeebraingames.wordpress.com/2019/05/19/from-160-to-300-a-requests-per-frame/

    We also used it on some of our gameplay systems. Our project is still heavily OOP and MonoBehaviour based. The project started when DOTS wasn't around yet. We probably won't be able to convert the whole project to pure ECS. But the speed gains we got from our partial conversion are already huge.

    I want to thank Unity devs! Keep on improving DOTS. Games like ours need it.
     
    CypherEA and Sarkahn like this.
  9. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    1,312
    Hey, forgot to show you our new trailer from last Unity Developer Day Moscow 2019 :)
     
  10. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    4,796
    Really cool, but no sounds?
     
  11. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    1,312
    Yep, cos stand was just visual, sound was useless cos noise around :) But we shown our first demo and users played in our game!
     
  12. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    4,796
    Thats fine. But you could even add background music from a game. Just saying :)

    Wonder who gave you thumb down on vid? :eek:
    You got haters already? :p
     
  13. Sylmerria

    Sylmerria

    Joined:
    Jul 2, 2012
    Posts:
    228
    And can you share the demo ? I would love to test it
     
  14. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    1,312
    Maybe. All opinions can exist! Different peoples, different preferences.
     
    Antypodish likes this.
  15. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    1,312
    Not yet :) It was our first demo, just one of our regular latest builds more or less stable, but not perfect :) soon we’ll show public demo
     
    Sylmerria likes this.
  16. tommox86

    tommox86

    Joined:
    Apr 30, 2015
    Posts:
    39
    very nice!!! How come you dont have the stutter issue, are you rendering your models in a special way?
     
  17. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    1,312
    Nope. RenderMeshSystemV2 (from Hybrid Renderer package)
     
  18. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    1,312
    300 half-spartans :D Just testing arrows. Animations same on all objects, but other in progress :)
     
  19. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    4,796
    Everyone bobbing dancing, even dead shadows :D
    Didn't Spartans had spears and shield?:rolleyes: