Answer the question
In order to leave comments, you need to log in
Server side of the game - how does the server side AI work?
I understand that the question is quite broad, but maybe someone will direct in the right direction or share their experience.
Let's take CoC as an example of a game.
Client - there is a playing field, there are buildings, there are units.
The player releases units (just like in the game above), the units land on the field and run to hit the buildings.
Each unit has its own priorities, let's say thick ones hit towers first, thin ones hit everything.
It is clear that the AI must manage the units right from the server, as the players will simply deceive it.
The question is in the implementation of this moment. How does the interaction between the server AI and the client take place, will there also be a delay between actions?
How does the synchronization of the game cycle with the server AI happen, let's say I make such a "simulation", but how does synchronization happen in a trite time, for example, units can come running before it happens on the server?
In addition, it turns out that I have to make an application that will duplicate what is happening on the client, if there are 1000 players, for example, 1000 battle instances should be launched on the server, isn't it very hard?
Please do not beat with crutches, in gamedev'e recently, I have never been engaged in game development. dipping
Answer the question
In order to leave comments, you need to log in
Instances of "fights" are not the correct concept. What does 1000 fights mean, there should be 1000 unit instances, each unit has its own state - current activity (running, hitting, dying), parameters, and so on.
AI can command units from anywhere.
It can be part of a server loop (as in most simple games like Diablo or MUD)
It can be a separate process (like in Lineage2)
It can be a separate process running on a different server.
Actually, the architecture and complexity of the AI is thought out in such a way in order to keep up with the game cycle to perform the necessary actions, and if there are too many units, the game can slow down or deliberately slow down (like Eve online)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question