Home Game Balance in a Grand Strategy Game - Basic Economy Approach
Post
Cancel
Preview Image

Game Balance in a Grand Strategy Game - Basic Economy Approach

Intro

Games are complex. How complex can they be? Can they simulate complex systems? Are some equations with variables enough? Enough for what? In the last couple of weeks, I’ve been exploring Game Balance. Specifically equations.


Balancing Economy Variables

Balancing a game requires the balance of all the game’s systems. I believe balancing a game’s economy is a small scale of rules based on the research and philosophy of Adam Smith and John Maynard Keynes (however, when it comes to social sciences, we are stuck..?) Here I will talk about my approach for using variables to impact other variables; How to balance “unrest” to affect “optimism.”

Some Math

In this section, I’m using Desmos calculator.

Assuming “unrest” and “optimism” are normalized (0-1.0), we need a function whose outputs will correspond to a scale of a whole floating number as well. Our component, which represents x, is the unrest variable in this case. \(cos(component)\) can do that with some changes:
\(\frac{1}{2}cos(component)+\frac{1}{2}\)
This function will output values between (0-1.0) This function will output values between (0-1.0)

We are multiplying by PI to set its equilibrium at 0.5 instead of PI, which isn’t helpful since we are dealing with normalized scales (0-1.0).
\(\frac{1}{2}cos(component \cdot \pi)+\frac{1}{2}\)
Multiplying by PI to set its equilibrium at 0.5 Multiplying by PI to set its equilibrium at 0.5 Let’s say I want “unrest” to impact “optimism.” First, I need unrest to deal negative and positive points so it can impact optimism with positive and negative weights. To do that, I will remove the last part of the function (\(\frac{1}{2}\)). The range is now from -0.5 to 0.5: Ranges from -0.5 to 0.5 Ranges from -0.5 to 0.5

Remember the equilibrium is still the same at 0.5:
\(\frac{1}{2}cos(component \cdot \pi)=0\)
Anything below 0.5 will output a negative number. Anything above 0.5 outputs a positive one. That doesn’t make sense because when unrest goes down, optimism should go up. Let’s negate the function:
\(-\frac{1}{2}cos(unrest \cdot \pi)\)
The range is now from -0.5 to 0.5: Negating the function Negating the function

Now when unrest is below 0.5, we have a positive output, and when it’s above 0.5, the output is negative. All left to do is to determine the weight of unrest on optimism. Let’s calculate the optimism with weights.
Assuming we want unrest to affect optimism by a weight of 30%, we will have:

\(optimism = 0.3 \cdot unrest ...\)
Converting to the cosine formula:
\(-\frac{1}{2}cos(unrest \cdot \pi)\cdot 0.3\)

Then we add other variables - all their weights will sum to 1.0:
\(optimism = 0.3 \cdot unrest + 0.4 \cdot variable_b + 0.3 \cdot variable_c\)

It’s also called weighted average. Watch on YouTube..

If we have an aggregate values, such as resources (electricity, water, currency, etc) we can use the following:
\(value+value(weight_1 \cdot variable_1 + weight_2 \cdot variable_2)\)

We can use the weighted average to constrain values in relation to their previous value so changes will look relative:
\(Electricity_{previous} + Electricity_{previous} \cdot (weight \cdot residential + weight \cdot industries)\)

Further info

Why multiply the component with PI?
Since I’m using scales from 0-1.0, I want to ensure that if 1.0 is the input, the function will output its maximum output as well (0.5 in this case)—the same with 0, which will output -0.5.

Why cosine?
In this case, I wanted a straightforward function that maps inputs of 0-1.0 to negative and positive outputs. Exploring functions is a key to balancing a game. I’m still learning this stuff, though.

Game Balance Resources

Spreadsheets are a straightforward way to design game economy. They are frequently utilized to balance different game systems as a whole. Here are a few further resources:

The best designers stay in the lowest possible fidelity as much as possible. -Jamal
Update: I don’t like it for simulating anything related something bing and complicated as economy. However, it might be enough for some games.

All trademarks, registered trademarks, games' footage, and referenced code/materials are the property of their respective owners.

Storing Data Efficiently using Test-Driven-Development in Godot

-