In this week’s dispatch, we’ll delve into a topic of great importance as we chart the course of our game’s evolution.
As anticipation builds for the implementation of game rewards in the coming months, it is crucial to ensure the integrity of our in-game economy.
Establishing robust protection mechanisms is the cornerstone for an economy that not only thrives but also endures the test of time in the long-term.
Strap in as we navigate the intricacies of game score validation algorithms.
Our development efforts are currently centered around ensuring fair reward distribution and safeguarding our game’s economy against exploits, hacks, and other threats. This is where the in-game validator plays a pivotal role.
The validator operates on an algorithm that references the core metrics of the game:
We’ve set baselines using average gameplay data:
Imagine a well-designed game where a perfect 5-minute session yields a maximum score of 550,000 points.
The challenge is to extrapolate this to any gameplay duration and establish checks for energy usage and score efficiency.
We employ derived metrics for suspicious activity detection:
First, we determine how many points can be scored per second in a perfect game:
Max Score Rate = Total Points / Total Seconds
Max Score Rate = 550,000 points / (5 minutes * 60 seconds per minute)
Next, we calculate the maximum score possible for any given time:
Max Plausible Score = Max Score Rate * Time in Seconds
Our game also involves energy as a resource. We need to ensure that the energy claimed to be spent aligns with the time played:
Energy Generated = Base Energy + (Energy per Second * Time in Seconds)
The energy balance is valid if the energy generated matches the energy reported as spent.
Efficiency is the ratio of the score to the energy spent. We want to catch impossible efficiencies that could indicate cheating:
Efficiency = Score / Energy Spent
Efficiency is valid if it does not exceed a certain threshold determined by analyzing legitimate gameplay data.
By aggregating evidence from these metrics, we develop a ‘suspicion score.’ If this score crosses a predefined limit, the session may be flagged for review.
While Motoko is our language of choice for Internet Computer development, our code below can be adapted to any other language:
FUNCTION maxPlausibleScore(timeInSeconds):
maxScoreRate = 550000 / (5 * 60)
RETURN maxScoreRate * timeInSeconds
FUNCTION validateEnergyBalance(timeInSeconds, energySpent):
energyGenerated = 30 + (0.5 * timeInSeconds)
RETURN energyGenerated == energySpent
FUNCTION validateEfficiency(score, energySpent, efficiencyThreshold):
efficiency = score / energySpent
RETURN efficiency <= efficiencyThreshold
FUNCTION validateGame(timeInSeconds, energySpent, score, efficiencyThreshold):
maxScore = maxPlausibleScore(timeInSeconds)
isScoreValid = score <= maxScore
isEnergyBalanceValid = validateEnergyBalance(timeInSeconds, energySpent)
isEfficiencyValid = validateEfficiency(score, energySpent, efficiencyThreshold)
RETURN isScoreValid AND isEnergyBalanceValid AND isEfficiencyValid
Our algorithm undergoes constant refinement:
We’ve been implementing the use of statistical methods and machine learning to spot significant deviations from expected gameplay patterns.
We will periodically adjust our algorithm based on new data, strategies, or exploits that emerge.
Player feedback is integral to our refinement process, helping to enhance the accuracy and fairness of our validation system.
We maintain an open and fair validation process, keeping player trust at the forefront of our efforts.
That is it for this week, commanders.
We trust you found insight in our exploration of algorithm construction mechanisms that anchor firmly in real data and practical applications.
This isn’t mere theory; we’re actively weaving these principles into the very code that underpins our game.
Your strategic mind is invited to scrutinize and audit our code within the canisters.
https://github.com/worldofunreal/cosmicrafts-motoko-backend#validation
With no further ado, let’s forge ahead in our quest to build the most immersive RTS the galaxy has ever seen!
Thank you for joining us in this journey, and until next time, keep your fleets ready and your wits sharp.
Did you like this post? Tell us
Leave a comment
Log in with your itch.io account to leave a comment.