Rift of the Realms - Running out of Time

Rift of the Realms - Running out of Time

·

3 min read

Hi all,

It's been a few weeks since my last blog post, so I'm excited to give you an update on the latest developments in our multiplayer Unity game, Rift of the Realms, and share a preview of what's coming up next!

Recent changes and additions:

Timer Implementation

A condition has been implemented to ensure that when the timer runs out the round ends. Currently, the game round duration is set to 60 seconds, but this can easily be adjusted. Here is a snippet of the Timer.cs class:

    void Update()
    {
        if (PhotonNetwork.LocalPlayer.IsMasterClient)
        {
            if (timerIsRunning)
            {                
                if (timeRemaining > 0)
                {
                    timeRemaining -= Time.deltaTime;                    
                    photonView.RPC("DisplayTime", RpcTarget.AllBuffered, timeRemaining);
                }
                else
                {
                    Debug.Log("Time has run out!");
                    timeRemaining = gameRoundDuration;
                    timerIsRunning = false;
                    AwardGoldCoinsOnGameOver();
                    PhotonNetwork.LoadLevel(1);
                }
            }
        }
    }

Additionally, we'll update the round over screen soon to include a scoreboard, showing players a summary of their performance at the end of each round, including the gold coins they have to spend in the shop.

Silver Coin Calculator and Display

There has been a silver coin calculator introduced, which will be linked to in-game purchases and upgrades. This calculator rewards players for completing in game objectives and when they score hits, kills or kill assists.

Snippet of the code:

public class SilverCoinCalculator
{
    public enum SilverEarners
    {
        playerHit,
        playerKilled,
        playerKillAssist
    }

    public static int CalculateSilverCoinReturn(SilverEarners earnMethod)
    {
        switch (earnMethod)
        {
            case SilverEarners.playerHit:
                return 1;
            case SilverEarners.playerKilled:
                return 10;
            case SilverEarners.playerKillAssist:
                return 5;
            default:
                return 0;
        }
    }
}

At present the gold and silver coins are displayed in the top left of the screen for the player to see:

Machine functionality and effects

Before, a Light Realm player could just walk up to a machine, hold the E key and fix it. Now, the Light Realm player needs to collect the machine parts in order to fix the machines in the game. If they don't have the required parts then they can't fix the machines as the E key will be rendered ineffective.

Extra visual effects

We have added some extra visual effects such as:

  • A realm transition effect that plays when transitioning realms:

  • A respawn effect:

  • A glow around the machine:

Realm Transition Cooldown Period

We've implemented a 5 second realm switch cooldown period. This prevents the players from being able to switch realms too frequently. If they try to switch realms in this period a warning message is displayed:

We’re continuously working on improving Rift of the Realms and have some key features planned to be delivered such as:

  • Implementing the shop

  • Linking the login screen to the database

  • Including the table of stats for each player

  • Earning gold coins

Thanks for reading the blog! Keep updated for more progress coming soon!

Thanks,

Molly

Did you find this article valuable?

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