how does networking game works?

im having a hard time trying to figure out how does a networking game (lets say MMORPG) works…
i understand that the character movements and physics are calculated in the PC that uses that character.
but what about the enemies? if i have 3 players in 1 scene with 10 enemies. who calculate the physics of the enemies? the server? if so, how does it works so that the client wont calculate them?

Actually in a safe MMO, nothing is calculated on the client machine, the client only acts as an “input proxy” and the decision on what happens happens on the server.

But there is no “how it works generally” it is totally game and genre dependent actually, there are several dozen ways to approach it even without considering details :slight_smile:

i understand, so basicaly the UNITY standalone will only send the server the Inputs and get the outputs from the server?
so what is the server acctually? its probably not a unity build, so what im doing in unity now, all the player movements and enemy AI are wrong? and should restart from scratch?

You don’t understand.
Thats one of many ways of doing it (called authorative server, commonly used for MMOs and other non-low latency purposes due to the raised security), but there are other ways too (NetworkViews and OnSerializeXXX function on MonoBehaviour class for example for directly serialization and send where clients would do local calculations)

What the server is, is up to you. if you use unity networking then also unity.
if you use sockets, anything you want to use :slight_smile: (there are various solutions like Photon, SmartFoxServer 2x, ElectroServer, uLink, Lidgren, …)

thanks for the replys, ill check all the options.

I suggest you take a look at M2H Ultimate Networking Project. It will save you a lot of time, and unlike SmartFox. uLink etc. It is not more than $100.

is it safe using it?
id rather do more work and have safer game.
what is that project acctually?

check it out here: Ultimate Networking Project | Templates | Unity Asset Store

The project explains you how to use Unity Networking correctly as well as understanding the concepts of networking to a much larger degree.

Its your code that makes a game safe, not the middleware.

im still not understanding many things about this sockets networking with unity…
if i use photon server, and lets say, i use the safe way you presented me on your first post, that the standalone is just for sending inputs.
as i saw in the examples and videos, photon is only with C#. and it is in visual studio, out side of unity.
so all the unity functions are lost? like if i want to use a move functions of a character controller, how will i do that outside of unity?
sorry but im very confused… any website explaining from scratch the basic of networking with photon and unity?
also: will i have to write all the code in C#? (in unity)

To use Photon you have 2 sides to code, server and client side.
Both sides are C#.
You can use VS as a script editor in Unity, or even MonoDevelop.
SmartFox 2 is C# client side (Unity3d) and Java on the server side (SFS2x).

Hi, this conversation is very interesting, i am too begin in this world of the networking in unity, we can say, that M2H Ultimate Networking Project can supply all characteristic to create a full interaction in a MMO world?

no, not at all. M2H tutrial teaches you how Unity networking works.