Hi all,
We have been digging into DOTS/ECS and Netcode for Entities trying to POC a prototype game with 4+ players and potentially 2000+ active units a large part of which will be visible on screen.
Without the multiplayer part this is no problem running with several thousand fully animated units incl. physics and all.
When looking into the Netcode for Entities part of things the picture is different though. It is far from smooth on the client screens.
So far all netcode for entities sample projects we have found are using relatively "few" units.
We are attempting various optimizations but were wondering if any one out there know of an available showcase/usecase sample project with the characteristics mentioned above (i.e. 4+ players, 2000+ active units (mostly visible on screen), ECS/DOTS, Netcode for Entities)?
🙂
#Netcode for Entities 2000+ active units showcase/usecase sample project?
1 messages · Page 1 of 1 (latest)
2000 is a lot of visible things on screen
what style of game out of interest?
i've tested netcode at 100,000 ghosts but only a fraction of those were relevant
you're likely being limited by the per frame bandwidth limits
if you're willing to bump that up can probably handle a lot more (i forget how to do it)
i think by default it's pretty small at something like 32kb/s per user
We are looking into "Relevance" 🙂 👍 also we are playing around with NetworkStreamSnapshotTargetSize
Have you looked into priority though?
SOmething much simpler to manage
We are, but have not gotten to it yet. Will definitely prioritize 🙂 that and get back with results
At the moment bullit hell meets very light weight Diablo 🙂 This could very well change 😉
Still it would be great with a sample project covering a Star Craft II type game including multiplay with Netcode for Entities 🙂
ah, projectiles are ghosts as well then i take it?
Yes they are, or will be, for now they have not been ported to the multiplayer part
We were talking internally about projectiles recently (i.e. Ghost vs non-Ghost). From our tests, if you can instead replicate the projectile spawner(s) and their timings, and "infer" i.e. "predict spawn and dead-reckon" the bullets, you'll save a LOT of bandwidth.
Obviously, if you have homing or otherwise unpredictable projectiles (both in terms of movement, and self-destruction causes), then a ghost is necessary... But yeah, 2k is a lot (***especially ***once you consider spawn + despawn frequency, which sounds quite frequent in your use-case?)
Good points 👍 Actually for us we are mostly at the moment sending positions of enemy units (2k+) over the network. Precision with regards to weapon systems, hits, etc. we try to keep server side and only communicate when needed e.g. stuff is destroyed / dies etc.
The gist of my post here I guess is that for DOTS/ECS 2k+ units is no problem at all (many use cases have a lot more) but when adding the network dimension it is difficult to find sample projects.
We are however making progress and have for one thing discovered that the tools for emulating multiplayer in the editor can cause unexpected perfomance results. Instead if we actaully build the game and run e.g. from different machines performance results do not differ from one time to another. (admitted also som PEBCAC issues 😉 )
The gist of my post here I guess is that for DOTS/ECS 2k+ units is no problem at all (many use cases have a lot more) but when adding the network dimension it is difficult to find sample projects.
Yeah, absolutely. Entities is really good at the RTS scale singleplayer games, but Netcode for Entities is designed specifically for AAA action games (like FPS, MOBA etc).
If I wanted RTS scale, I'd probably write a bespoke Planetary Annihilation / Beyond All Reason netcode on top of entities, or a lockstep SC2 approach (again, on top of Entities)... although Determinism isn't yet guarateed with floating point math, so you'd need a FP library.
To test high entity counts in a sample, I'd recommend the Asteroids sample (https://github.com/Unity-Technologies/EntityComponentSystemSamples/tree/master/NetcodeSamples/Assets/Samples/Asteroids), dialling up the NumAsteroids singleton config value from 200 to 2k+.
So in Planetary Annihilation, they are using keyframes for state changes and interpolating values in between? If you wanted to implement this, would you implement your own custom ghost snapshot to do this?
Yeah that architecture seems far too custom to fit well. I'd ***maybe *** investigate whether or not I could achieve something similar with "static optimized" ghosts and some kind of deterministic flowfield. See: https://docs.unity3d.com/Packages/com.unity.netcode@1.0/manual/optimizations.html#optimization-mode
But it's non-trivial.