Unity-Technologies / FPSSample

A first person multiplayer shooter example project in Unity
https://unity.com/fps-sample
Other
4.81k stars 1.83k forks source link

ECS Justification #36

Open Bryan-Legend opened 5 years ago

Bryan-Legend commented 5 years ago

Garry Newman (@garrynewman) of Garry's Mod fame had some thoughts on this project over at https://garry.tv/2018/10/24/unity-fpssample/

He's a pretty sharp guy and he had this to say in the summary:

The ECS stuff I could live without. That might be my ignorance of it speaking, but to me it feels like I’d like to see the performance of 16 player models with it vs without it before I add 30 new classes to seemingly just animate the model.

I realize that ECS is new and part of the reason for this project is to help mature the new feature. But, the perf benefit doesn't seem valid for a 16 player game and if it adds complications, should it be cut? Could you please justify the complexity?

Is the purpose of this project to illustrate best practices and be a starting point that we can build on, as described at https://www.youtube.com/watch?v=42Hc4IsGDqs? Or is it more just to help mature new systems?

Will it be shipping as a game that will get some usage and thus real maturity? Or is it always going to be a little half baked?

I am overall very pleased with the project. It has very good coding style and is clearly a product of great talent. Thank you!

garrynewman commented 5 years ago

I'd love to hear this too. My half assumption was that it isn't as complicated as it looks - but like all code it looks over complicated until you understand it.

My gut tells me that that if it's faster to animate models like this then can the traditional animation controller not be made faster with the same technology, can it be improved and restructured so we can add our own functional nodes to it that transplant variables and works like ECS under the hood?

enzi commented 5 years ago

I've ripped it out. Not a huge deal.

I think the animation system should have not been part of the FPSSample but as proof of concept it started there, set the workflow and was too difficult to rip out for them and make everything work with IK and all.

The benefit completely eludes me other than it's more precise when you can code it, but who wants that when there's already the animator and its state machine? I guess it'll be merged at some point so more of it happens under the hood.

On the rest of the code and why ECS. I think the benefits should be clear by now. If not, I can eleborate.

Maximetinu commented 5 years ago

@enzi please, elaborate.

ghost commented 5 years ago

HippoCoder does a nice breakdown sounds like part of a multipart series eval. this sample from Engineering perspective only. https://forum.unity.com/threads/thoughts-on-the-engineering-of-the-sample-project-feedback-on-content-design.574549/

I think the important thing about this sample and ECS is that it is fps sample where frame per second will matter and so will server lag. Let us also remember that we are doing a FPS using HDRP and not the LWRP a much easier task. Everything will have to be done to the Nth degree to reach the final product goal which itself is a moving yard stick of whatever the industries best is at any given time. That is what we are trying to achieve here. The industry has done a shift into ECS in many other ways, maybe it is all part of the larger ecosystem driving functions as a service and microservices etc. I think biz and players alike want fine grained control of their data hence the Data Orien. Tech Stack we see unity surfacing and then ECS within that. But if the goal is a FPS shooter at between 90-120 fps while using the best practices for HD graphics perhaps even hitting 4k and dual GPU VR. With an optimized full source server solution built in that also uses ECS allowing one do host and play a server at same time without huge performance drop. All of this while also getting drop ins like the lovely VFX and perhaps one day soon Visual Scripting which will also be ECS. I'd say that makes a strong case for ECS.

StuartIanNaylor commented 4 years ago

I am sort of groaning at ECS as no matter what anyone says an object model is easier to conceptualise. But reason why I am here is that I need the improvements ECS can provide in terms of DOTS and DOTS multiplayer. So for me its sort of important this has DOTS and also hybrid DOTS which may help make the transition a little easier for dummies like me.

So for me having ECS here is more essential than merely needing justification. But yeah groan ECS here we go...