How to manage own bots at the server?

Posted by Nikolay Kuznetsov on Game Development See other posts from Game Development or by Nikolay Kuznetsov
Published on 2012-12-10T08:43:19Z Indexed on 2012/12/10 11:25 UTC
Read the original article Hit count: 329

Filed under:
|
|
|
|

There is a game server and people can play in game rooms of 2, 3 or 4. When a client connects to server he can send a request specifying a number of people or range he wants to play with. One of this value is valid: {2-4, 2-3, 3-4, 2, 3, 4}

So the server maintains 3 separate queues for game room with 2, 3 and 4 people. So we can denote queues as #2, #3 and #4.

It work the following way. If a client sends request, 3-4, then two separate request are added to queues #3 and #4. If queue #3 now have 3 requests from different people then game room with 3 players is created, and all other requests from those players are removed from all queues.

Right now not many people are online simultaneously, so they apply for a game wait for some time and quit because game does not start in a reasonable time. That's a simple bot for beginning has been developed.

So there is a need to patch server code to run a bot, if some one requests a game, but humans are not online.

Input: request from human {2-4, 2-3, 3-4, 2, 3, 4}

Output: number of bots to run and time to wait for each before connecting, depending on queues state. The problem is that I don't know how to manage bots properly at the server?

Example: #3 has 1 request and #4 has 1 request Request from user is {3,4} then server can add one bot to play game with 3 people or two bots to play game of 4.

Example: #3 has 1 request and #4 has 2 requests Request from user is {3,4} then in each case just one bot is needed so game with 4 players is more preferrable.

© Game Development or respective owner

Related posts about java

Related posts about game-design