简体   繁体   中英

How can I use bot players in real-time multiplayer games using Google Play game services?

I'm working on a new multiplayer game for Android devices and we are planning on using GPGS to handle our lobby/ gameplay. We need to fake it until we make it and have enough users to bring the matchmaking queue down to a reasonable wait.

Is it possible to have bot users that work with GPGS? Is it possible to extend the matchmaking functionality to include this?

You can implement bots at the game level. You can't emulate a match participant at the GPGS level, but it's pretty straightforward to do that from the game's layer. What you would do is something like this:

  1. Start automatch, wait for players, start a timeout.
  2. When the timeout expires, see how many bots you need (say, N bots)
  3. Decide who what clients will control each bot (one useful rule might be sorting the clients by participant ID in ascending order, and having the top N control one bot each.
  4. Play the game. Whenever you send an update about a character in the game, the sending participant specifies (in the message) whether that update is for the player or for the bot.

So, as far as GPGS is concerned, you only have human players, but in your game's logic, there are N bots as well as players in the game.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM