System Balancing - Basic Equations

Table of Contents

Introduction

1. Introduction

This series is intended to help you think through how to set up and balance game mechanics and progression. To give you a bit of context, I typically support games (and do not make them) focusing on balance, equation structure, and the implementation of mechanics. So the goal output of my scripts are typically csv files or INSERT commands for SQL tables.


This is a companion discussion topic for the original entry at https://blog.pbbg.com/basicequations/

If you want your formulas to always give integer results (instead of fractions) and you do not mind introducing randomness into your calculations (perhaps because your game already uses randomness in other places), then a nice idea is to round fractions in a random direction instead of always up or down or any other deterministic mode.

Here is a simple random rounding algorithm that I used in the past in my game for rounding rewards:

  • let’s say that your calculations gave a result of X
  • integer number N = floor(X) is a guaranteed base reward
  • the remainder (R = X - N) is a probability to give a bonus reward of +1, so roll a random number between 0 and 1 and if it is greater than R then increase total reward by one

This algorithm has a nice property that average result of multiple roundings (“expected value” in math terms) is equal to value being rounded, so in estimations or statistical analysis you can just use original non-integer values without rounding them.