Can I controll bot player from server not from client

Hay guys , i have some question on my mind that make me confuse for couple day, Can I control bot player from server not from client? for example in game FPS we have bot / AI that our enemy, Usually we code in unity to make that enemy behave like bot or AI that can search player in game and if it found player that bot / AI then shoot the player. Now the main question is can i like put the code or something on the server that make someday if i am update that code from server then bot in game will behave like code was I edited?? Sorry if my english bad. Thanks

Best Answers

Answers

  • Hi, @doolangames

    yes, you can, but in this case you either need to host your self modified sevrver code or write plugin and order enterprise cloud. you also may write plugin and host it yourself

    best,
    ilya
  • Hi @chvetsov
    Whether the photon provides an option for doing that? without make plugin and but just change some code? if that can how i must starting?? bacause iam not really understand about networking. And i want to install photon server in my pc to make them like server, but now i am use tethering from my phone is that can?? Thanks.
  • i am still confuse how to make plugin for photon , i have read documentation but i not understand yet how it works and the last thing is what is concept that plugin can control AI from server? Sorry if i still not understand @chvetsov please give me example like video to make understand because iam still college. Thanks
  • JohnTube
    JohnTube ✭✭✭✭✭
    Sorry we do not have any videos for plugins for the time being.
    Maybe you can start a YouTube tutorial while learning and experimenting with this.
    :)
  • hello @chvetsov

    i am using Plugin and my game working fine but i also need to add bot Player could you please guide me to do that.
  • hi, @OmiAmarwal

    well, you will have to do a lot of work your self. amount of work depends on what you are going to get. here are some hints.
    1. you may select for you bots very high actor ids, for instance after 65K
    2. you may send events from them using broadcast event.
    3. you may create interval timer and use it to calculate logic related to bot logic.

    what you do not have out of the box is notification that bot joined or representation of bot as actor. you may try to simulate this, but only if you really need it. this part is what you need to do your self.

    if you have more question, please ask

    best,
    ilya
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @OmiAmarwal,

    What my colleague @chvetsov tried to mention is the following:

    When sending an event from plugin (using BroadcastEvent methods) you cannot set a sending actor number other than:

    - 0
    - actor number of an active actor

    So actor numbers from inactive actors or fake actors won't work.
    This was made as a check as we supposed that only joined active actors or plugin/room (actor 0) can send events. The bot use case was not taken into consideration but now we are aware of it.

    So from current version of plugins you cannot simulate actors w/o adding extra logic on both client and plugin. Meaning you can't add bots to your game w/o updating the client code.
    So you may want to add your custom join, leave or bot events that can be understood by plugin and client.