Recent Updates in Development and Planning for the Multiplayer Game

Recent Updates in Development and Planning for the Multiplayer Game

·

3 min read

Hi everyone, in this post I am excited to share some recent updates and features that myself and the team have been working on for the multiplayer game. Let's dive in:

Coding Updates

  1. Player Nicknames: You can now choose your own nickname within the game, and see other player nicknames, making it easier for everyone to recognise each other.
  • Image showing a Light Realm player with their name displayed in the game

    Image showing player with their name displayed in the game

    Image showing the lobby displayed where you can type your game nickname in this box and hit the join room button to join the game.

  1. Realm Assignment: Players are now automatically assigned to either the “Light” or “Dark” realm based on the number of players in the room. The ratio of light to dark players can be adjusted in the future depending on gameplay, for instance if the Light Realm team overpowers the Dark or vice versa.
    void AssignPlayerTeam()
    {
        bool isLightRealm = PhotonNetwork.PlayerList.Length % 2 == 1;  // Set the realm of the player based on the number of players in the room
        string realm = isLightRealm ? "Light" : "Dark";
        PhotonNetwork.LocalPlayer.SetCustomProperties(new ExitGames.Client.Photon.Hashtable { { "Realm", realm } });
        Debug.Log("Player ["+nickname+"] assigned to realm ["+realm+"]");

        GameObject playerPrefab = isLightRealm ? lightRealmPlayerPrefab : darkRealmPlayerPrefab;
        Transform spawnPoint = spawnPoints[Random.Range(0, spawnPoints.Length)];
        GameObject _player = PhotonNetwork.Instantiate(playerPrefab.name, spawnPoint.position, Quaternion.identity);
        _player.GetComponent<PlayerSetup>().LocalPlayer();
        _player.GetComponent<Health>().isLocalPlayer = true;
        _player.GetComponent<PhotonView>().RPC("SetName", RpcTarget.AllBuffered, nickname);

        // Instantiate the Machine Parts too (this has to be done by Photon, so that Photon can correctly manage their lifecycle!
        GameObject machine1Prefab = (GameObject)Resources.Load("Machine", typeof(GameObject)); 
        GameObject machine2Prefab = (GameObject)Resources.Load("Machine2", typeof(GameObject));  

        PhotonNetwork.InstantiateRoomObject(machine1Prefab.name, machine1Prefab.transform.position, Quaternion.identity);
        PhotonNetwork.InstantiateRoomObject(machine2Prefab.name, machine2Prefab.transform.position, Quaternion.identity);
        // Put name on screen
        TextMeshProUGUI nicknameText = GameObject.Find("Nickname").GetComponent<TextMeshProUGUI>();
        nicknameText.text = "Name: " + nickname;

        // Put realm on screen
        TextMeshProUGUI realmText = GameObject.Find("Realm").GetComponent<TextMeshProUGUI>();
        realmText.text = "Realm: " + realm;

        if ("Light" == realm)
        {   
            _player.GetComponent<PhotonView>().RPC("UpdateCollectibleCountText", RpcTarget.AllBufferedViaServer);
        }
    }

Summary of this code:

  • Realm Assignment: It determines the realm (either “Light” or “Dark”) based on the number of players currently in the room. The realm is assigned to the local player using Photon’s custom properties.

  • Player Instantiation: It instantiates the player prefab based on the determined realm and selects a random spawn point for the player to appear.

  • Instantiating machine parts: It instantiates machine prefabs in the room, ensuring that Photon manages their lifecycle.

Player “Three” view looking at a Light Realm Player and a Dark Realm player in the game. This screen shows the Players Realm (top left), the Machine parts count (middle) and the Nickname of player (top right).

  1. Machine Part Collection: When the player in the Light Realm picks up a machine part all players in the Photon Network can see the count incremented. Tracking of the collected machine parts is performed using Photon Room custom properties so that they are easily synchronised across all players.

Planning the multiplayer game

The team are using a tool called Miro to plan and outline the upcoming features for the game. This online whiteboard platform allows us to visually organise and track development tasks, making sure everything stays on track.

There is a Kanboard that has been created with the tasks in progress and future tasks to be delivered:

We also created a Games Ideas board on Miro. This space serves as brainstorming ground for generating new game ideas.

To visualise the timeline and duration of these tasks, we created a Gantt chart too. This allows us to see the big picture of how long each task will take, make sure everyone has some work assigned and ensure tasks are completed within the timeframe.

In addition to developing the game itself, we had also worked on an in-class presentation to showcase the game ideation and process. This presentation will be delivered tomorrow! It will look something like this:

That's all the updates for now, thanks for reading!

Molly

Did you find this article valuable?

Support Multiplayer Games Development by becoming a sponsor. Any amount is appreciated!