Depending on the situation, the client does things differently.
The server must be validated at least.
Compared with the network game, the data transmission amount can be neglected to some extent, and the more attention is paid to the return time. Under normal circumstances, such as Wow, the 200MS delay starts to turn yellow. In other words, in general time requirements are not very extreme, such as KOF97 to mmo,200 can default to a common MMO standard line.
Specifically, the ideal online game, the individual tends to all the logic processing on the server side, and the client is like a media player. This is because as the book says, the client is in the hands of the opponent, if you let the server only play the role of data exchange, then the plug can completely spoil your game.
On the basis of ideal, the client is to do the performance, according to the server and user input processing, the various scenes, actions and special effects play. This includes drawing characters (dynamic objects), drawing scenes (relative static objects), drawing lights, objects, lighting sorting, and animating animated objects.
Of course, this is based on the ideal, in fact, the production will have a lot of changes. such as casual games, because it requires more rapid response (such as Bubble Hall, the speed of the role of speeding up, how can you ensure that other clients in real time to see the location of the other side. Otherwise it will not be blown up), so in this demand, the client began to undertake more chores, such as the client is not only playing function, but also with the judgment, the first to perform the client's judgment to pursue the performance of fluency. Of course, for the sake of security, the final data will pass the server-side authentication, and the validation will be corrected. And because the correction is very rough, so now also began to add some correction mechanism, so that the correction process looks softer, such as in Wow, sometimes you can see other monsters or characters dragging the speed line quickly moved to other places, that is the gentle correction mechanism.
In a specific case, for example: Chat. A game so set, a play with the "current channel", only the players around 50 meters to receive.
So. Player A enters a bunch of words, this time the client receives and immediately sends to the server side.
Server-side fixed-cycle processing of all chat information, such as 200 milliseconds, when the client sent, just the last 200 milliseconds passed, and then ranked in the next 200 milliseconds queue. This time any client is not able to see the chat information, including a-side (assuming this is set, this is the time when you network card, obviously press ENTER, the dialog box does not pop up any chat information reasons).
Time in the passage, the server began to run the queue, and ran to this place, so it began to calculate, the first is to determine whether the chat dialogue is the current channel, the World channel or other, the decision is currently, and then perform the current channel processing: Read this player location, search for the location of 50 meters of other players, Include a-side broadcast chat message to these players (if there is a blacklist function, but also to exclude blacklisted players, if the paid user fonts have special colors, but also to disseminate the style of the dialogue).
All clients receive the message and then play the message in the chat channel. So we all saw it.
Basically this entire process, including player location information, including player chat content, size can not exceed 1KB, even if it is encrypted. This means that the amount of data can be ignored under normal circumstances. This is also the general network game Transmission data Volume standard. More importantly, two parameters, the time the first player packet is delivered to the server and returned by the server, and the second server processes the event's cycle.
In addition to the UI location of these trivial information about roles, other information should be stored on the server side. The resources that are stored on the client include the role model, animations, scenes, effects, and so on, and some of the games also store large amounts of text on the client side, such as task dialogs. Important information, especially any changes that will affect yourself or other players, should be placed on the server side. For example, the role of experience, even if you receive the task (if you save on the client, you change the machine, previously received the task is gone).
As for the client to the server when the message, how much frequency, that is generally a long connection, as long as the amount of information not more than KB, the impact is not too large. In fact, as long as you log in, the server side and the client are communicating with each other. Even if you do not move, the server will be because you are likely to receive chat information and keep you plugged in messages. So this is still the program to get headaches, they are professional.
That's basically the way things are.
For more information, please visit the "Dog Planing Learning Network" Unity Ultimate Academy Http://edu.gopedu.com
What are the server and client processes in the game development network game?