Monday, December 7, 2020

Computer simulations in designing Illeria

lleria has often benefitted from computer simulations as a way to balance abilities.  As mentioned in my last post, two goals of Illeria are (1) to have characters with different abilities, and (2) to have skill play a role in winning (and not just skill in designing a good party).  Thus, I need some way to estimate the relative strength of different abilities, so I can say if two characters are of (approximately) equal power (or how much stronger one character is).  Determining the strength of abilities is hard, however, because Illeria is a complex game.  For example, consider a character with a bow.  That character can damage a warrior several times before that warrior can attack back, though the damage will depend on the warrior's armor and movement, if they are in cover, etc.  Archers are less effective when they move, which could make a character with a bow less useful at capturing objectives.  However, archers can effectively screen areas, potentially scaring opponents away.  How could I possibly begin to think about pricing this?


The short answer is that I use  skills I learned as a mathematical biologist (my day job): I start with a very simple model, and build from there.  Illeria is, at its core, a wargame.  Therefore, a good place to start would be to figure out who would win if two characters fight.  The rules of melee combat are fairly straightforward, so they are not too difficult to code: character 1 attacks character 2 by rolling some dice and seeing how much damage it deals; if character 2 survives, they attack back; then character 1 attacks again; and so on.  If you run this 1000 times, you can determine approximately how often character 1 beats character 2.  This can help you determine the relative benefits of melee abilities and other simple abilities.  For example, you could determine how much of a benefit a character would receive by gaining +1 Health (i.e. being able to take more damage before dying) or +1 Armor (i.e. being able to avoid taking damage).


Once I have the baseline simulation, I can add things to it.  For example, to do archery or ranged spells, I assume that the character gets a certain number of attacks against their opponent (based on the assumption that the characters run at each other and are not obstructed); then they fight in melee.  Thus, archery and spells are essentially a source of free damage.  If a character has animated or summoned creatures, I assume that those creatures will arrive a round or two before their animator/summoner (since if I controlled the animator/summoner, I'd send the creatures in first), but that once the enemy can reach the animator/summoner, then the animator/summoner becomes the target (again, because this is what I would do).  


These simulations are great as a thought experiment, as a way for me to think about my game more rigorously.  For example, I originally had an ability called "Drain life," where a character heals when they hurt their opponent.  At first I thought this would be really strong, but when I ran simulations, it lost against most other abilities.  Why?  Well, characters have 3 health, and attacks deal 0 to 2 damage.  Drain life would give no benefit to a character who struck first (because they could not heal if they have not been injured), or if they died before striking their enemy.  Thus, Drain life can be summarized as: The character gains 1 (or 2 on rare occations) health if they strike their opponent in that window of time between when they are injured but not dead, and they gain nothing otherwise.  Drain life was certainly better than nothing, but far worse than having 1 extra health to begin with.  The simulation forced me to see this.


I'll use future posts to explain how I turn these simulations into a point score for each character.


That said, there is only so much one can get out of these simulations.  There was a great podcast I heard about the dangers of following a model blindly; its  basic lesson was that simulations need to be used as a tool to make you think more, not less.  So, what do I do once the computer gives me its estimate of how many points an ability is worth?  First, I do some mental adjusting to price-in effects the model does not consider.  For example, if an ability makes a character less mobile (e.g. heavy armor), then I figure it is worth fewer points than the computer says.  If it grants a benefit outside of one-on-one combat (e.g. regeneration, which helps a character after the first combat ends), then I figure it is worth a few more points than the computer says.  Second, I playtest everything.  


In the end though, while the simulations are far from perfect, they give me a starting point in which to match abilities.  If I didn't have them, then I'd start just using my gut to estimate the relative value of abilities.  Thus, simulations don't remove the need for playtesting, but they probably save me a couple of rounds of it, which really helps.

No comments: