Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Third Party The best way to handle AI and bots with PUN.

Discussion in 'Multiplayer' started by Aaron_T, May 15, 2015.

  1. Aaron_T

    Aaron_T

    Joined:
    Sep 30, 2014
    Posts:
    123
    Hello.

    I've been developing a game using Photon and have successfully managed to make it work well with multiple human controlled players. Now, I'm at the the point where I want to add bot players and artificial intelligence.

    My question is how to handle the artificial intelligence. Right now, the only viable way that I can see how is to have every bot's actions performed on the master client and their PhotonViews owned as well by the master client and their actions only sent to other players via OnPhotonSerializeView.
    I would much rather have an authoritative server be able to handle all the bots and then send the positions to the players, but I don't think that this is possible with PUN. So, any suggestions on how I may better handle networking with AI with Photon?
     
  2. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Dont know if its the best.


    but surely it helps.
     
    Aaron_T likes this.
  3. Aaron_T

    Aaron_T

    Joined:
    Sep 30, 2014
    Posts:
    123
    Ooh, thanks for the link! I followed this exact tutorial last year and I don't recall there being videos for bots. I'll follow those videos and see how it goes.
     
  4. Aaron_T

    Aaron_T

    Joined:
    Sep 30, 2014
    Posts:
    123
    After reviewing the videos, it is exactly how I was thinking.
     
  5. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Good! Shame quili stopped the series
     
  6. Aaron_T

    Aaron_T

    Joined:
    Sep 30, 2014
    Posts:
    123
    Very true. But, following his series and then following it up with Hammer Labs' PUN series really gives just about anyone enough knowledge to get going on their own.
     
  7. Pulov

    Pulov

    Joined:
    Feb 20, 2010
    Posts:
    824
    Yeah, that is true. I found the Quilli vids the key to get the multiplayer part working, otherwise for sure it would have been a pain. I've pending another series that merge unity 4.6 ui and the lobby part with room listing etc.