A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Multiplayer' started by vis2k, May 1, 2020.
V1.17 pending review (bug fix release):
@vis2k looks really cool!
Is it relatively straight forward to convert the NetworkManager in usurvival to use this?
Hello, this asset is support smooth sync ?
No this can not be used with uSurvival. This doesn't use the old concept of GameObjects and components. The entire project would have to be rewritten.
Got it thanks
DOTSNET is 50% off during Unity's 2020 Reboot Sale:
Grab it while you can
Weekend Benchmark with libuv2k V0.9.
70k entities @ 20 FPS.
Now 100k entities @ 34 FPS with shadows.
100k entities @ nearly 50 FPS on lowest quality.
2-4 Fps less during video recording.
Still on a 2015 Macbook Pro, with no real GPU
Does Dotsnet support animations with DOTS? Is it stable?
Animations are client sided, so there should be no problem
Let's test this for my ambitious project
This project looks absolutely brilliant. I hope to give it a go sometime soon!
Manage expectations though. DOTS/ECS is still in preview and DOTSNET while stable, is still lacking features.
Hi, just bought DOTSNET. It looks very promising and you absolutely should have the money to work on it full time. We need this kind of asset and its mostly been a bad idea to rely on unity.
Not sure if I can use it for my current project though. Would it be crazy to try to make it work with the ultimate character controller? It's only a prototype, so not everything has to be perfect and server authorative. I'm just wondering about the long run... I heard somebody is working on a mirror port. If that ever is released, would it be easy to adapt it to DOTSNET?
Making character controllers work well over the network is very hard.
For Mirror, I only know of one controller that works, which is the one I made for uSurvival/uMMORPG.
DOTSNET definitely allows you to do that, but you really need to know what you are doing to get it right.
But sure, try and report back
Anyone know how you would go about setting the camera to follow the player in the samples? I’m trying to figure out how you reference the camera since it’s not a traditional game object. Is it possible to convert it to an entity?
This thread seems promising ...
DOTSNET V1.18 pending review.
What a month. I hope you all enjoy libuv2k. It's the best scaling Transport for Unity by far, being able to handle 100k Entities with 60 FPS on my laptop
Let me know if you have any problems.
V1.18b resubmitted. Now with the libuv2k Windows DllNotFoundException fix, and without physics package upgrade
Picked this up on sale few weeks ago. Haven’t dived into it much outside of the examples scenes. 100k entities is nice. But, that type of bandwidth/messages are going to be brutal on some devices.
Is there a way to track messages and bytes in editor or we got to use 3rd party tools?
Again. Haven’t spent more than a few hours playing with it. Is there any way to spread that bandwidth and messages out or do we have to script that on our own?
Just trying to plan on my next project. 10k entities I love it. I am just having a hard time planning how to spread that out among clients.
If you want a game with insane amounts of entities, then that's the price to pay
V1.19 pending review:
What if I don't use hybrid renderer, but gpu instancing? I made a prototype using dots and gpu instancing, learned from examples from other threads. How deep "dots networking" is bound to the hybrid renderer? I update position values through compute buffer to move dynamic units. Entities are anyways setup in a way, that natural fits the gpu array setup, so I think it should be doable without too much effort?
Rendering has nothing to do with networking.
Been digging through it, pretty dang awesome. I'm still trying to learn DOTS to move over but this is a great example to learn from and build off.
Thanks so much for all your work.
Then please remove the hybrid renderer requirement if it's not related at all:
And btw., I know rendering has nothing to do with networking...
I think the Hybrid Renderer is required in order to use DOTS.
DOTS is the data oriented tech stack, this includes all data oriented packages, therefor you don't use DOTS, you use DOTS packages. The hybrid renderer is one of those DOTS packages and its not required for all DOTS packages, just some have it as dependency.
Thank you for replying @voncarp and @FakeByte
So the asset just uses some packages, which leads to some package dependencies regarding hybrid renderer. I Just wanted to be sure, there's no heavy code refactoring necessary, to work with my own rendering workflow.
The package has demo scenes which for one would require the hybrid renderer, that could be one of the reason why its mentioned as dependency. You can always disable the hybrid renderers systems, then pick up the entities you want to render with your own system, I don't see why you would need to change a single line in the network code.
ECS is very modular and there are almost no direct dependencies which make your use case very easy to implement.
1 quality of life example feature request would be an example shooting a networked projectile from the player position and direction and destroying it. I edited the physics example to be a character controller, and its great, but struggling to get projectiles working right, I'll figure it out, but its taken a lot of time and I'm sure its probably 15 mins if you knew what you were doing.
Yep, a few more examples and a few more basic features will be needed.
Still spending all my time on transports these days. libuv is done and kcp will come to DOTSNET soon.
Afterwards features/examples again
Would this asset also work with other type of games from MMOs? Like for instance FPS or RTS? I am evaluating using this for an RTS, would this work out of the box or would I have to change a lot to get it working?
Also, how easy would it be to add networking to an existing ECS game with this?
Should work fine for RTS.
For FPS you need prediction etc., which DOTSNET doesn't have. It simply syncs entities over the network
I'd recommend starting with one of the DOTSNET examples and build your game on top of it.
DOTS/ECS is still new and nobody really knows the best way to do things yet.
Would you imagine ECS architecture would be suitable for card games with related entities? Something like X card reacts to how much mama Y character has?
I wouldn't recommend using ECS unless that's your only option.
If you aren't going for massive scale, go with MonoBehaviour instead.
I am currently developing mobile game based on DOTS. Although we have our own simple implementation now, our team is looking for existing solutions. DOTSNET looks awesome, however I am not sure about how well it fits our needs, so I have couple of questions:
1) just for clarity - according to asset store page, DOTSNET is modular and comes as source files, so we can edit that in case if we need or use our own transport, right?
2) documentation says that there are no support for android/IOS now. According to page in asset store, DOTSNET uses LittleNetLib low-level, which supports android/IOS. Are there other reasons for limited platform support, or I'm getting something wrong?
3) following previous question - documentation says that android/IOS support will come later, but is there any estimations for that?
4) our networking supports component filtering - for example we can have 10 components added to entity, but only couple of them may require network synchronization. We also use different filtering strategies, for example entity 1 have components A and B synchronized over network, while entity 2 have components B and C. This way we can avoid sending data which does not change for long periods of time. How these cases are handled in DOTSNET?
5) we can change entity archetype, adding or removing components, and change filtering strategies for data sent over network for each entity. Can we do that with DOTSNET?
Yes. Next version will also come with KCP transport, which you probably want to use.
That's because libuv only runs on Windows/Mac/Linux and LiteNetLib while it works, is too slow for DOTSNET's extreme performance.
KCP solves that problem because it's 100% C# and nearly as fast as libuv. So with KCP it runs on all platforms.
KCP update should come in the next couple of days by the way. I just finished porting it to Mirror, and now porting to all my assets
DOTSNET lets you decide how to sync components.
If you want to sync Transform component, you create a TransformSyncSystem that syncs it the way you like it to be synced.
So what you are describing is possible if you are willing to implement it.
By default DOTSNET has a simple syncInterval.
Btw if you are making a mobile game that doesn't have insane performance requirements, then I'd recommend going with MonoBehaviour/Mirror instead. Using DOTS/ECS for a game in production right now would be very risky and painful.
Thanks for quick reply!
We expect medium to high requirements for performance, and ECS as approach fits our needs rather well. But yes, we sometimes have troubles due to lack of experience with dots, faced several bugs and limitations which we had to work around.
And one more questions I forgot to ask:
How DOTSNET manages entity creation? I mean not just entity, but required components and their initial data.
Does it do something like "Create entity from prefab with ID" where ID of prefab is known on both client and server? If so, how it sets initial data for prefab components, or is it outside of DOTSNET scope and should be implemented depending on exact case?
Prefabs are GameObjects with ECS' ConvertToEntity (actually a custom ConvertToNetworkEntity) which are dragged into a prefabs list.
Server spawns them by id from that list.
Quick question about your 10K+ example demo's, what is exactly happening in them? By that, I mean what network traffic and such. Is each entity equivalent to a player executing a move, sending a packet to the server, and then server broadcasting that change to each entity? Or is this just a single player and the server broadcasting 10k+ NPCs moving on the server?
Did you base the KCP transport on one of the existing C# KCP transports or did you write your own?
I remember you mentioning that mono sockets were too slow many times on the forums, if you wrote your own how did you solve that problem?
It's 10k monsters being broadcasted to one client over the local network.
I always do this test first to optimize everything to maximum, because iteration time is extremely fast.
CCU is a lot more time consuming, and will come soon. The next one will be with Mirror first with the new KCP transport. Afterwards DOTSNET
It's based on paul's KCP Transport which is based on kcp-csharp.
kcp-csharp is basically kcp.c translated to C# as Kcp.cs. kcp-csharp deviated from original kcp.c a lot though, which caused several bugs, performance and garbage collection issues. I went through it line by line and adjusted it to latest kcp.c from skywind's github. It works a lot better now, and it's way less opinionated. It's simply kcp.c translated line by line.
Paul added high level connection handling, which I modified a lot for Mirror and for some of my own requirements.
Mono's TCP sockets are beyond broken. Unusable in non-blocking mode (which is still blocking) and barely usable in blocking mode.
UDP socket works fine though, except for that IPEndPoint allocation, But regular net/C# does that too
Gotcha, so you're moving all the Entities server-side then combing queued moves into multiple packets for the client? How many packets are your sending per move for the 10K entities? Just trying to gauge the amount of network traffic and how it would translate to CCU in the real world.
I'll let him fill in the specifics but it batches updates into fewer packets, and segments the observables you're receiving updates about by distance from the player. It also can compress quaternions down to a single uint and then fill up a packet with a whole lot of them.
V1.20 pending review:
Finally got DOTSNET, thank you very much for huge amount of comments and explanations, found some notes about Entity bugs I had to work around previously, too)
I have a question about World Initialization. If my understanding is correct, DOTSNET assumes that we create all 3 worlds (Default, Client and Server) when application starts, and those worlds live until application quit. However, I want more control over world lifetime - so I'm writing my own bootstrap based on what DOTSNET offers and what I had previously. For example, I want default world lifetime match application lifetime, while creating and disposing client and server worlds multiple times during app lifeteime. So I had to take a look at what happens inside Bootstrap.cs, and one thing that is not clear for me, is why using
InitializationSystemGroup initializationGroup = serverWorld.GetExistingSystem<InitializationSystemGroup>();
If I'm understanding it correctly, such Client/Server world initialization makes them tightly dependent of Default world?
At the moment I can manually launch Client or Server World and manually set up all specific systems, but when I try to dispose worlds created by DOTSNET bootstrap, I get exception thrown from DefaultWorld's InitializationSystemGroup:
InvalidOperationException: object is not initialized or has already been destroyed
which I suppose comes from fact that we added ServerWorld's InitializationSystemGroup to updateList of DefaultWorld's InitializationSystemGroup, and even trying to remove it manually before disposal doesn't seem to work for some reason.
InvalidOperationException: object is not initialized or has already been destroyed
Did you try the second code snipped and see if that works?
Unity changes ECS quite a lot, might be a new feature.
Yep, looks like its working almost without any additional changes - just have to deal with servers's PresentationSystemGroup. Checked on several example scenes.
Quick look at profiler shows that second snippet causes reordering of InitializationSystemGroup and SimulationSystemGroup execution order for client/server worlds - previously nested inside DefaultWorld SystemGroups, they now run outside of DeafultWorld scope. Not sure about how that going to affect performance, however.