Modding/Game Balance
I want my 15 rapid-fire quantum torpedo launchers Uber-Defiant now! - Get help from modders. Share your work. Discuss modifications.
1, 2
posted on October 19th, 2010, 6:58 pm
Last edited by Dircome on October 20th, 2010, 5:35 am, edited 1 time in total.
I didnt know if this was the best place to post this but I thought it was fitting so ill put it here. I have been thinking about how games are balanced lately. And i have come up with a few ideas that may help you balance your games.
First of all an old adage comes to mind "You can have it done correctly, you can have it done fast, or you can have it done cheaply. Pick two" That being said in order for your games/mods to be balanced you can have cheap, quick building units but they will need to be weak. Or you can have units that are strong and built relatively quickly but they will have to be expensive. Anyway you get they idea.
So in order to help me wrap my mind around the concept of game i created a math equation.
totalUnitStrength = cost
So applying that idea lets say that you want to create a unit with a strength of 2 that means that you will need to charge 2 twice as much as a unit that has a strength of 1. And this is a very basic start to a game balancing equation. After that I broke it down a little bit farther.
offence * defence = cost
Im going to ignore the concept of cost for now. So lets create a pair of opponents.
Player A decided to build a Swordsmen. The Swordsmens stats are as follows
offence 2
defense 1
While Player B decides to build an Phalanx. The Phalanxs stats are as follows
offence 1
defense 2
And they both send them to attack each other. Now as you can see that Phalanx has more defence but the Swordsmen has greater range. These units are balanced.
So that was a very basic example, but the equation is a little bit useless when it comes to a real game. So i will expand the equation a little father.
attackStrength * attackSpeed * range * hitPoints * hitPointRegeneration * armor * speed = cost
So this is a more common breakdown of what you would find in most stratagy games. Armor in this intance is the amount of damage that is negated by the unit regardless of attack type (later on i think ill write a section on counters). Also Dom brought up a stratagy known as kiting in which you try to keep your ranged units out of the range of the enemy. All my ideas are assuming that your units can either be moving or fireing not both.
So again we have 2 players.
Player A builds a Swordsmen.
attackStrength 1
attackSpeed 1
range 1
hitPoints 4
hitPointRegeneration 0
armor 0
speed 1
While Player B builds an Archer.
attackStrength 2
attackSpeed 1
range 2
hitPoints 1
hitPointRegeneration 0
armor 0
speed 1
From looking at the numbers you can tell that these units are balanced but just to make my point a little more clear i am going to diagram the battle. The battles are going to take place in a turn based fashion but it still applies to RTS games.
turn 0
[S] [ ] [ ] [ ] [A]
Swordsmen HP 4/4
Archer HP 1/1
turn 1
The Archer and the Swordsmen move toward each other
[ ] [S] [ ] [A] [ ]
Swordsmen HP 4/4
Archer HP 1/1
turn 2
The Archer fires and deals 2 points of damage to the Swordsmen. The Swordsmen moves forward.
[ ] [ ] [S] [A] [ ]
Swordsmen HP 2/4
Archer HP 1/1
turn 3
The Archer fires and deals 2 points of damage to the Swordsmen. The Swordsmen attacks and deals 1 point of damage to the Archer. Both units die.
[ ] [ ] [S] [A] [ ]
Swordsmen HP 0/4
Archer HP 0/1
First of all an old adage comes to mind "You can have it done correctly, you can have it done fast, or you can have it done cheaply. Pick two" That being said in order for your games/mods to be balanced you can have cheap, quick building units but they will need to be weak. Or you can have units that are strong and built relatively quickly but they will have to be expensive. Anyway you get they idea.
So in order to help me wrap my mind around the concept of game i created a math equation.
totalUnitStrength = cost
So applying that idea lets say that you want to create a unit with a strength of 2 that means that you will need to charge 2 twice as much as a unit that has a strength of 1. And this is a very basic start to a game balancing equation. After that I broke it down a little bit farther.
offence * defence = cost
Im going to ignore the concept of cost for now. So lets create a pair of opponents.
Player A decided to build a Swordsmen. The Swordsmens stats are as follows
offence 2
defense 1
While Player B decides to build an Phalanx. The Phalanxs stats are as follows
offence 1
defense 2
And they both send them to attack each other. Now as you can see that Phalanx has more defence but the Swordsmen has greater range. These units are balanced.
So that was a very basic example, but the equation is a little bit useless when it comes to a real game. So i will expand the equation a little father.
attackStrength * attackSpeed * range * hitPoints * hitPointRegeneration * armor * speed = cost
So this is a more common breakdown of what you would find in most stratagy games. Armor in this intance is the amount of damage that is negated by the unit regardless of attack type (later on i think ill write a section on counters). Also Dom brought up a stratagy known as kiting in which you try to keep your ranged units out of the range of the enemy. All my ideas are assuming that your units can either be moving or fireing not both.
So again we have 2 players.
Player A builds a Swordsmen.
attackStrength 1
attackSpeed 1
range 1
hitPoints 4
hitPointRegeneration 0
armor 0
speed 1
While Player B builds an Archer.
attackStrength 2
attackSpeed 1
range 2
hitPoints 1
hitPointRegeneration 0
armor 0
speed 1
From looking at the numbers you can tell that these units are balanced but just to make my point a little more clear i am going to diagram the battle. The battles are going to take place in a turn based fashion but it still applies to RTS games.
turn 0
[S] [ ] [ ] [ ] [A]
Swordsmen HP 4/4
Archer HP 1/1
turn 1
The Archer and the Swordsmen move toward each other
[ ] [S] [ ] [A] [ ]
Swordsmen HP 4/4
Archer HP 1/1
turn 2
The Archer fires and deals 2 points of damage to the Swordsmen. The Swordsmen moves forward.
[ ] [ ] [S] [A] [ ]
Swordsmen HP 2/4
Archer HP 1/1
turn 3
The Archer fires and deals 2 points of damage to the Swordsmen. The Swordsmen attacks and deals 1 point of damage to the Archer. Both units die.
[ ] [ ] [S] [A] [ ]
Swordsmen HP 0/4
Archer HP 0/1
posted on October 19th, 2010, 7:03 pm
Interesting, though what happens if the archer fires once and moves - the archer will remain out of range for longer, but get to kill the swordsman
. (like what happens in Starcraft or AoE all the time with ranged versus melee units).

posted on October 19th, 2010, 8:32 pm
Remember 3.0.5a Disrutpor Rhienns? Those were fast, cheap, and good. 

posted on October 19th, 2010, 9:05 pm
lol kiting is annoying, thats why we have restricted arcs. so the archer cant fire backwards lol he has to stop, turn around and fire before turning and running again.
posted on October 20th, 2010, 12:14 am
Nice to see some work on balancing formulas and systems, something often forgotten in larger projects (be it mods or commercial games). 

posted on October 20th, 2010, 12:57 am
Thanks for the endorsement
Anyway i have edited my first post and changed a few things.
About kiting. For my examples the archer and the swordsmen have exactly the same movement rate. I am also assuming that the units cant fire and move at the same time. So the archer can always stay out of the range of the swordsmen but if he stops long enough to kill the swordsmen the swordsmen will have time to move into range and kill the archer.

Anyway i have edited my first post and changed a few things.
About kiting. For my examples the archer and the swordsmen have exactly the same movement rate. I am also assuming that the units cant fire and move at the same time. So the archer can always stay out of the range of the swordsmen but if he stops long enough to kill the swordsmen the swordsmen will have time to move into range and kill the archer.
posted on October 20th, 2010, 1:31 am
That looks nice, Dircome. Also, another thought is with teching up. For example, cruisers and battleships in FO cost less per attribute point than their counter parts to offset the cost of teching up to them. So perhaps a small unit uses the base formula, with the medium unit getting a 5-10% discount off the cost. And the Heavy unit gets that plus another 5-10% discount.
You could probably have some sort of formula that determines it based on how much of a tech cost was involved.
You could probably have some sort of formula that determines it based on how much of a tech cost was involved.
posted on October 20th, 2010, 1:43 am
Right i was thinking about the tech tree but i was unsure how to balance it. I may look into the cost of each building that has to be built and determine a number based on that.
posted on October 20th, 2010, 3:18 am
So i have been attempting to add in the cost of building a unit and so far it doesnt add up can anyone give me any assistance? This is the formula that i have been trying to use
attackStrength * attackSpeed * range * hitPoints * hitPointRegeneration * armor * speed = (food * wood * gold * stone) * buildTime
attackStrength * attackSpeed * range * hitPoints * hitPointRegeneration * armor * speed = (food * wood * gold * stone) * buildTime
posted on October 20th, 2010, 3:28 am
That's because anytime you multiply by 1, it won't make a difference in your equation, even if it makes a difference in game. 
For example, your swordsman has 8 total points, whereas the archer has only 6, and yet they'll end up costing the same, because 1*1*1*1*4= 4, and 1*1*2*2= 4 as well.

For example, your swordsman has 8 total points, whereas the archer has only 6, and yet they'll end up costing the same, because 1*1*1*1*4= 4, and 1*1*2*2= 4 as well.

posted on October 20th, 2010, 5:23 am
Ok i think you are at least partually correct (maybe completely i need to test first) I think the problem is i need to add instead, which is knida what you said Mal. Let me change it and see if it gets better.
posted on October 20th, 2010, 5:34 am
Last edited by Anonymous on October 20th, 2010, 5:43 am, edited 1 time in total.
Some of the formulas for calculating offensive value for FO might come in handy, as it helps explain how the devs do it. It gives you the what, not the why.
http://guide.fleetops.net/guide/modding/visuals-effects/editing-tooltips#OffensiveValue
I wrote some other stuff, but I realize that you're trying to keep it simple.
Edit: The other thing to consider is that while you do come up with a balancing formula, you do want to consider the balancing based on what you want your game to do. Right now your swordsman has more stat points than the archer, but the archer is equal to the swordsman in the fight (Both die). So are range points more expensive than hit points, etc.? You could in fact add the stat points in that manner if they're different and then create a cost system based on that.
Getting slightly more complex, most vessels in FO have costs increases associated with range, since they can move while attacking. So in this case, the Archer may be really powerful, but his cost is twice that of the swordsman. So you can build swordsman simply expecting to take a few loses to overcome the archers, etc. I'm starting to get more complicated, but this is how you can decide what you want your game is going to be like, and then set the values by which it will be balanced.
http://guide.fleetops.net/guide/modding/visuals-effects/editing-tooltips#OffensiveValue
I wrote some other stuff, but I realize that you're trying to keep it simple.

Edit: The other thing to consider is that while you do come up with a balancing formula, you do want to consider the balancing based on what you want your game to do. Right now your swordsman has more stat points than the archer, but the archer is equal to the swordsman in the fight (Both die). So are range points more expensive than hit points, etc.? You could in fact add the stat points in that manner if they're different and then create a cost system based on that.
Getting slightly more complex, most vessels in FO have costs increases associated with range, since they can move while attacking. So in this case, the Archer may be really powerful, but his cost is twice that of the swordsman. So you can build swordsman simply expecting to take a few loses to overcome the archers, etc. I'm starting to get more complicated, but this is how you can decide what you want your game is going to be like, and then set the values by which it will be balanced.

posted on October 20th, 2010, 5:51 am
Last edited by Dircome on October 20th, 2010, 5:56 am, edited 1 time in total.
I am eventually trying to move to a point where i can use my equation to help balance FO-like ships.
And about the stats you are right because if i put two archers against two swordsmen the archers destroy both swordsmen and only lose one archer.
Edit: corrected my earlier statement.
And about the stats you are right because if i put two archers against two swordsmen the archers destroy both swordsmen and only lose one archer.
Edit: corrected my earlier statement.
posted on October 20th, 2010, 6:01 am
Eventually the guide will have all the info needed to balance FO like ships. But I don't want to disuade you at all, since you're giving the why and helping people think conceptually, something that I find many modders have an issue with. 
It's also a lot more constructive than "Ship X or Strategy Y is Over/Underpowered!!!
, and we could use more useful stuff on the forums. 

It's also a lot more constructive than "Ship X or Strategy Y is Over/Underpowered!!!


posted on October 20th, 2010, 1:23 pm
Well ik what my problem is. So far all i have tested has been one vs one instead of several units vs several units. What i havent been accounting for is the fact the people will focus fire on one specific unit instead of spreading their fire to each enemy unit. So an even number of archers with their greater range will always win (even though they lose half of their remaining hp to the swordsmen).
1, 2
Reply
Who is online
Users browsing this forum: No registered users and 7 guests