MegaGlest Forum

Archives (read only) => Vanilla Glest => Multiplayer => Topic started by: olaus on 10 February 2011, 21:43:51

Title: why server controlled AI ?
Post by: olaus on 10 February 2011, 21:43:51
hi,

i just wonder why glest has server controlled AI in network games? the best concept for RTS-online-gaming is to just transfer the clicks of the players and calculate everything else the same on all PCs using the same random numbers.

this just produces unnecessary large packets which have a higher probability to get dropped for players with packet loss. (packet loss caused by noise on a bad DSL-line doesn't hit a certain percentage of packets but a certain percentage of transferred bytes, try it by increasing the packetsize (on linux f.e. ping -s 1000) on a bad line.)

regards
olaus
Title: Re: why server controlled AI ?
Post by: softcoder on 10 February 2011, 23:33:15
Some history. The code original (and still exists) to let all clients execute the AI themselves. While working out out of synch problems I added server controlled AI to try to further stabilize network games. When we added this it helped things a lot. IT is 'possible' with the changes made since the initial feature was added that maybe we don't need it anymore, but we don't know for sure. Because of timing differences and network LAG, by making onlyt the server control the AI commands offers a greater level of stability (at least for AI player behaviour) since it is controleld from one spot. This also improves hardware CPU performance since only one client needs to calculate the AI commands, all other clients simply think of AI players as other humans.

Thanks
Title: Re: why server controlled AI ?
Post by: olaus on 11 February 2011, 15:06:29
Some history. The code original (and still exists) to let all clients execute the AI themselves. While working out out of synch problems I added server controlled AI to try to further stabilize network games. When we added this it helped things a lot. IT is 'possible' with the changes made since the initial feature was added that maybe we don't need it anymore, but we don't know for sure.

might be also floating point ...

do you use a seperate random-number-stack for the AI ? otherwise the server would get different random numbers than the clients, or?

Because of timing differences and network LAG, by making onlyt the server control the AI commands offers a greater level of stability (at least for AI player behaviour) since it is controleld from one spot. This also improves hardware CPU performance since only one client needs to calculate the AI commands, all other clients simply think of AI players as other humans.

is this relevant, how much performance does the AI eat?
Title: Re: why server controlled AI ?
Post by: softcoder on 11 February 2011, 15:28:55
We use STREFLOP for floating point consistency, AI uses a deterministic Random number generator and we do not yet know how much extra the Server Controlled AI takes.

Thanks