Unity Dots Networking

0 views
Skip to first unread message

Colleen Bramham

unread,
Aug 4, 2024, 2:34:51 PM8/4/24
to tingchiromo
Wellif I need to fill my custom needs, I would bet my money on Telepathy and it's aproach to solve unity bounds and

battle tested codebase. Here some detailed info on this topic from the author,





I add things to different sections as I learn over the years and I may not realize I have already said it somewhere. When I have time to re-read I maybe able to remove duplicates, but if you found them please put up with that. Also something like "previously mentioned" may not exist anymore when I edit out something and forgot that the next topic has reference to it. (Null reference exception IRL)


It is to prevent ambiguous claim. If I say "Unreal is much more powerful in 3D rendering" (this is one of the most popular claim) I would have to say exactly what is it that make the difference, that make it more powerful. If it is "just" better but I am not able to know why, I will state that explicitly.


I know some UE devs with this mindset. He didn't appreciate technology and just want to bite Unity at any given opportunity. (Actually the same for Unity devs that targets Epic's vast fortune and attacking the CEO for throwing money at everything.) This "faction/categorization" mindset seems to be innate in human. One use Apple and automatically hate Android. One is with this skin color and hate the other color. One hate a person from this country because someone else in the country/historically did something bad. If you are in group A then you fight with group B. esports is not sports. But isn't it funny that all the problem came from just that you are being named/categorized as something? Naming and words are human's creation and we artificially did this to ourselves. Why not move the category one step back to just "technology" instead of Unity and Unreal?


I am aware I am giving him these opportunities, it is just a little addicting and fun that he always come to bite my bait every time perfectly when I am expecting, that I still keep doing it to see what he will come up next... (I will continuously add to this list as I collect the replies) Anyways! Don't be like that here.


That is the time it takes to enter play mode. What domain? This is not a compile time that you see the spinner, but it is the time that C# reset its state which is the pause after that spinner. And it is the pause before entering, and also after recompiling script each time. No, asmdef will not help you, that only helps with the spinner and not the freeze afterwards.


At first it is not much, but as you give in to Unity and grow your project.. years passed and now to enter play mode it takes 20 seconds!! And it even doesn't have to take that long, my stupid-looking game is already taking 11 seconds to enter play mode.


If you ask me if I can migrate project instantly without any time cost (but you cannot come back to Unity again ever) would I move this project to Unreal? No, I still value Unity's interface. For others, I can see that this is a sound option given how important it is to quickly iterate on the play mode.


What is the solution then? Make a new project, lol. It's not a joke however as recently with Unity Package Manager you could link packages from other places. If you make your game in pieces, and use a new project to edit those pieces, then the project that contains each individual pieces will have an acceptable iteration time. (Pieces inside the same project is useless against domain reload.) And Unity Hub now could quite easily open multiple instances of Unity. Fortunately multiple Unity instances is not costing much. I could have up to about 3 Unity on my MBP Early 2015 open at the same time.


Unity's Timeline feature is also a good solution because you could preview time-sentitive things like UI transition without entering play mode. (As opposed to Animator which its state machine is only available in play mode) Imagine games made before Timeline's addition that is trying to time some explosion effect together with some other event.. how many play mode enter-exits... after 2019.1 you could add signals which emits events. It could trigger in edit mode too but it may link with other play mode only things that you have to enter play mode anyways.


Each play mode is rage inducing because I then found some little bugs that prevents it from going further, I feel stupid and also have to wait more 30 seconds for script compile x1, then it reloads after the script compile and also again when entering play mode. (Fortunately exit play mode won't reload)


If they add some button I could press in play mode so that it restart play mode instead, I could save 1 domain reload on entering. Unfortunately, no option here is comparable to that.


When it is a phase to iterate by entering play mode, I have to work laying down on bed so I could recover my back spine while it reloads. (It takes that much time that my back actually recovers) Also it helps to close my eye in between each play mode. The time taken to enter could save my eye sight in the long run rather than having to look at freezing Unity editor.


What's reassuring is that the CTO himself is feeling the same pain as you! He's saying it. Changing C# script in a large project file, reimporting, or anything, should cost less than 500ms, but it didn't! He said it made him angry. To be honest that sentence made me happy.


Instead of just entering play mode we can more generally define that Unity got scaling problems (that may or may not related to that 500ms). Likely a big consideration factor for AAA companies, hench why so many AAA Unreal games. These are not advertised, of course. It's painful to run into later in your game and having to make a life or death decision of do I want to continue with Unity or not. Here are some from top of my head, with mini sections about them after.


I am thinking of printing this and frame it, because finally we could do something about this dang curse. So the domain reload is not going anywhere, but we could turn it off!!! If you sure you don't have static variable junk from the last round of play or you design them properly that old value has no effect, then this... is the future.


Unity team said that resetting all the static is the big part of time taken. So if you ended up hand-resetting all of them later then no gains. But it is better to design without static in the first place just for this feature. Here's where you could try it if you are on alpha version.


C# reflection system may looks evil but it is actually the base of many important systems in Unity, particularly the type information which we need to constantly ask the whole assembly what it got right now. Many editor code and of course ECS need to be kickstarted somewhere with a list of all possible types defined. Serialization too, so it knows the structure of that type.


(You can see it is becoming a theme with Unity and later in this article as well, that you will see they openly say what went wrong, and not afraid to say "so we are scrapping this and that". I love this. No other company's patch note talks like this and just talk about improvements.)


There are other wasted time that is not just entering play mode. We iterate when going to external creative program and back. We iterate by switching export platforms. Better system started coming in 2019.3 with a new serialization rework, and then beyond that, watch this talk about the roadmap. (Again, still long way to go)


Blueprint is a visual scripting system in Unreal (before UE4 it was using a system called Kismet). Many compare Blueprint with Prefabs in Unity, but it's more than that. It is a codegen. So the graph you design could be individually compiled into C++ code. And in the context of play mode iteration, this means the compile time will not expands exponentially like Unity because each one compiles individually.


Ok, the compile time is equal to the spinner in Unity but we were talking about that freeze afterwards. I think there is no domain to reload in UE. It is so damn fast to enter play mode. Unity's disable domain reload added in 2019.3 is at best a band aid compared to this.


But Unity with DOTS is equivalent to Blueprint since "system" code is equally isolated and could be codegen-ed. Via graph visual scripting tool in the future, same purpose as Blueprint graph but output a different kind of thing. Blueprint outputs OOP-like instantiable code. System has no data, it's just workers that are waiting to work on data. Therefore in the future iteration time could be eliminated with DOTS thanks to more isolatable compiles and less dependency on reloading domain (that you could just disable it).


With tech from -matters.com/ UE had licensed, now C++ could be hot reloaded. Not that entering play mode is fast, now you don't even have to exit. Meanwhile in Unity you must exit, wait for spinner, wait for domain reload freeze (out of edit mode), wait for domain reload freeze again (on enterint play mode).


We have arrived as a subjective thing is interface design (if you "like" it or not), but I am going to turn this into an objective discussion as promised at the beginning. In UI world we are able to compare their function and how it affects the workflow. We touch the UI at every moment. And so this is the objective part of UI. What's the resulting speed of work from using the UI? Turning from likings to measurable "time".


Am I nitpicking things? I think not at all. If I am going to use one mechanical pencil every day, I would also complain about the material it was made of instead of functions (so all could write almost equally) as I have to touch it every day. GraphGear1000 is awesome by the way, just the right weight and good finishes on the barrel.


I have no problem in Unity so far with this spec. (Also I could open 3 Unity instances at the same time) But however I read from multiple places that even with decent i7 computer the reload and compilation time didn't improve. So it appears that if you have powerful computer you may want to go with Unreal.

3a8082e126
Reply all
Reply to author
Forward
0 new messages