MFPS AI in multiplayer BUG

Report bugs of MFPS 2.0 here
Post Reply
User avatar
Lovatto
Admin
Admin
Posts: 1778
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

I noticed in the video that your Editor didn't instance the player until you focus the window,
Try enabling the "Run In Background" box in Player Settings -> Resolution and Presentation, make a new build and try again.
How to find your Invoice Number: Here
How to find your Order Number: Here
User avatar
Lovatto
Admin
Admin
Posts: 1778
Joined: Sun Dec 07, 2014 3:18 pm
Contact:

I don't get this problem on my builds, but I think that I have an idea what could be the problem since I see in your video that your ping is kinda high,
try this:

in bl_AIManager.cs add these functions:

Code: Select all

/// <summary>
    /// 
    /// </summary>
    void SyncBotsDataToAllOthers()
    {
        if (!PhotonNetwork.IsMasterClient) return;

        Player[] players = PhotonNetwork.PlayerList;
        string line = GetCompiledBotsData();
        //and send to the new player so him can have the data and update locally.
        photonView.RPC(nameof(SyncAllBotsStats), RpcTarget.Others, line);
    }
    
    public string GetCompiledBotsData()
    {
        //so first we recollect all the stats from the master client and join it in a string line
        string line = string.Empty;
        for (int i = 0; i < BotsStatistics.Count; i++)
        {
            BotsStats b = BotsStatistics[i];
            line += string.Format("{0},{1},{2},{3},{4},{5}|", b.Name, b.Kills, b.Deaths, b.Score, (int)b.Team, b.ViewID);
        }
        return line;
    }
in the same script replace the Start() function with this:

Code: Select all

/// <summary>
    /// 
    /// </summary>
    private void Start()
    {
        FirstSpawn();
        if(bl_GameData.Instance.lobbyJoinMethod == LobbyJoinMethod.WaitingRoom && PhotonNetwork.IsMasterClient)
        {
            this.InvokeAfter(2, SyncBotsDataToAllOthers);
        }
    }
Let me know if that work for you.
How to find your Invoice Number: Here
How to find your Order Number: Here
Post Reply