Ian Fienberg
Game Design
Combat Simulators
Fall 2023
In fall 2023 I worked on writing code that simulated battle of characters to learn about quantifying data and creating balanced game systems. I wrote the code in Java. The following is what I produced.
WWNCharacters & CombatManager
The first system I created was one in which two characters with with 6 attributes of varying rank could battle one another. I created two java files: WWNCharacters and CombatManager. In WWNCharacters, I used a main method to test the code and I have a constructor to create characters. The constructor for the characters take on the parameters: name, strength, dexterity, constitution, intelligence, wisdom, charisma, and backstory. The middle 6 of which are the attributes and are integers (ranging from 3 to 18, 3 being low skill and 18 being proficient in that skill), and name and backstory are Strings. CombatManager is where characters can battle each other in three different ways: fightSimple, fightModerate, and fightComplex.
-In fightSimple, the sum of each character's attribute values will be compared and the greater value will be the winner.
​
-In fightModerate, each character will randomly select one of six terrains (underwater, icelands, space, methlab, darkness, or volcano), each of which corresponds to an attribute. The two terrains chosen will negate two attributes that they correspond to, thus reducing each characters total hit points. The new set of hit points will be compared and the character with the greater value will win.
​
-In fightComplex, each character will get a raw hit points and attack points score based off of their attribute values. Then, two terrains will be randomly selected, just like in fightModerate. However, instead of negating attributes, they boost attribute skills. Attribute skills can increase or decrease you or your opponents hit points, attack points, or even a shield protecting you from attacks. The charisma attribute helps determine which character attacks first. Once boosts and skill bonuses are applied, the character with the greater charisma score attacks first and each character takes turns attacking until one has no hit points left. The survivor is the winner of the battle.
BattleCharacters & BattleManager
The second system I created was one in which two players could have two teams of units battle. The units I used were based off of StarCraft's Terran Units. I created two java files: BattleCharacters and BattleManager. In BattleCharacters, the user has a preset list of units in the main method to choose from when building their team. Each unit is represented by a constructor which takes on the parameters: name, hp, attack, cost, and attackSpeed. BattleManager is where the two players can have their units battle in one of two methods: fight and complexFight.
-In fight, the user can have any number of a unit fight, and does this by inputting the name of the unit and how many of that unit they want to fight. Then, a forloop representing time will count upwards and for any players N attackSpeed, they will attack every N units of time. The unit's attack will be multiplied by the number of units still alive and every time one unit's hp is less than or equal to 0, the quantity variable representing how many units are still alive will decrease by 1 until one player has no units left.
​
-In complexFight, any number of any set of units can battle, and must be inputted as an arrayList in the order the user wants them to receive damage, as the unit in the 0 index of the arrayList will take damage before the other units. The same forloop as mentioned in the fight method will run to simulate time passing by so that each unit can only attack when their attack cooldown is done. Then, when the first unit in the arrayList's hp is less than or equal to 0, it will be removed from the arrayList and every other unit in the arrayList will be shifted down one position and damage will still be given to whoever is in index 0 of the arraylist. This process continues until one player has no units left in their arrayList.
​