[Photon Realtime] Create bots?

Options
ssrobin
ssrobin
edited June 2015 in Native
Hello,

Is it possible to create bots to test the games? Lets say 100 bots. If yes, please advise how to do that?

EDIT:
To be more specific. The bots are not manually spawn on client side, the bots will act like a player, who make connection(connect, join room, disconnect etc) to Photon Cloud server. We want to conduct a test, where, about 15 players or more play in one room.

Thanks.

Comments

  • Kaiserludi
    Options
    Hi ssrobin.

    Well, for a somewhat realistic test your bots would have do understand the basic game logic of your game, so that they can behave similar to human players.
    At the same time, when you don't just want to run 15 devices, you must make sure, that your bots don't need as much resources as the clients for real players, so that it's possible to run several of them on just one machine.
    Therefor you should write a headless mode for your clients, where they don't render any graphics, etc. to save resources. If your game is a mobile game, then you will likely need to write a desktop version of the code that is also needed for the bots, if your game isn't that low end, that a mobile device could easily run several clients at once.

    You could run multiple client instances from within one application, but its probably easier, if you start run one application for each bot.

    As you can see, loadtest bots aren't a trivial task, so for just 15 players it might make more sense to just get your hands on 15 devices and human testers.
  • ssrobin
    Options
    Hello Kaiserludi,

    Thanks for your detailed explanation.

    The reason for asking is because beside real players, our game (mobile platform) will also spawn default bots when a room ( game ) is created. You may refer to this game called ,"Respawnables" (https://itunes.apple.com/us/app/respawn ... 84686?mt=8 for iOS. https://play.google.com/store/apps/deta ... bles&hl=en for android) to have an idea of what we are trying to achieve. A more mainstream example will be Counter Strike where bots are involved as well.

    This is a scenario for the game we will like to clarify:

    1) Player 1 create a game
    2) X number of bots will spawn after Player 1 has created the game ( please advise on how to spawn bots, from Player's 1 device or photon server? and the considerations required )

    if spawn from Player's 1 device:
    3) After a few seconds, some other players join in
    4) Player 1 disconnects (deliberately or due to network fault)

    Question : Can the other players still play with the SAME bots until Player 1 reconnects?

    I look forward to your reply.

    Thanks in advance
  • Kaiserludi
    Options
    Well, for letting the server side control the bots you would need to use Photon server, as Photon Cloud does not currently support custom server side logic.
    So on Photon Cloud you can either run them on players devices or you could run your own servers, just for running the bot instances on them, that would then just join any room, where additional bots are needed.
    The latter approach of course is more effort and involves additional financial costs, as you would have to host and maintain those servers, but it may be preferable if you want to protect your bots against cheating through hacked clients.

    Yes, you can. Just let one of the other players take over control as soon as you get informed that the player that had control over them previously has left the game. Just use the latest information that you received for them and let some other players device calculate the updates from there on.
  • ssrobin
    Options
    Hello Kaiserludi,

    Thank you for the explanation. May I find out what server do your recommend for running bot instance?
  • Kaiserludi
    Options
    Hi ssrobin.

    This highly depends on the needs of your bots (how much CPU power do they need, how much RAM, how much network bandwidth) and on the success of your game (how many bots do you need to run).

    In general I would prefer bare metal servers over cloud services for handling the main load as with them you get much more power per dollar. For handling load-spikes a cloud service makes sense, so that you can quickly add a few extra machines for a short time when needed, without having to may for them for weeks. Pay extra attention on the traffic costs as real time games produce lots of traffic (you could easily end up with several TB per month per machine).