I'm making a text-based RPG in C++ just for fun, and in a way that I can keep adding to it and hopefully give it graphics one day, and I've got a lot of code for everything. My only problem is that I can't come up with a decent way to create enemies that will be fair across the levels and classes. Tweaking the formulas doesn't seem to help. I will give some examples, there are only 10 enemies now, and I'm just wondering if anyone has a better way of going about this that keeps the variety between classes and fairness across levels. Here are a few of the monsters:
Monster.Name = "Minotaur"; Monster.monsterOption = random1; Monster.level = Player.level; Monster.health = 30+(5*Monster.level)+(rand()%7); Monster.workinghealth = Monster.health; Monster.attack = 15+(7*Monster.level+(rand()%4)); Monster.defense = 26+(11*Monster.level)+(rand()%4); Monster.speed = 10+(2*Monster.level)+(rand()%3); Monster.luck = 2+(1*Monster.level)+(rand()%1); Monster.accuracy = 90+(rand()%5)-(rand()%10); Monster.gold = (rand()%120)+(30*Monster.level); Monster.Name = "Bandit Leader"; Monster.monsterOption = random1; Monster.level = Player.level; Monster.health = 20+(2*Monster.level)+(rand()%15); Monster.workinghealth = Monster.health; Monster.attack = 20+(7*Monster.level+(rand()%3)); Monster.defense = 20+(10.5*Monster.level)+(rand()%3); Monster.speed = 20+(4*Monster.level)+(rand()%8); Monster.luck = 2+(1*Monster.level)+(rand()%1); Monster.accuracy = 90+(rand()%5)-(rand()%10); Monster.gold = (rand()%150)+(32*Monster.level); Monster.Name = "Dragon"; Monster.monsterOption = random1; Monster.level = Player.level; Monster.health = 35+(4*Monster.level)+(rand()%10); Monster.workinghealth = Monster.health; Monster.attack = 20+(7*Monster.level+(rand()%10)); Monster.defense = 25+(11*Monster.level)+(rand()%10); Monster.speed = 20+(1*Monster.level)+(rand()%10); Monster.luck = 2+(1*Monster.level)+(rand()%6); Monster.accuracy = 90+(rand()%5)-(rand()%10); Monster.gold = (rand()%100)+(30*Monster.level); So you can see the formulas aim to keep some degree of randomness between each of the same type of monster, and they should be changed based on your level but not your class, weapons, armor, etc. That is all the information about each kind of monster while there is more information about the player (Armor and weapons added to base defense and attack). Here is an example player from a file I have saved right now:
SAVED CHARACTER INFORMATION ================================================ | Name: WarriorRawrry | | Class: Warrior | | Level: 32 | | Health: 207/241 | | Attack: 231 | | Defense: 159 | | Speed: 159 | | Luck: 45 | | Accuracy: 90% | | Exp Pnts: 1228/16000 | | Gold: 7183 | | Weapon: Sword of 1000 Truths +125 attack | | Chest: Blinding Breastplate +90 defense | | Legs: Oblivion Greaves +88 defense | | Helmet: Crown of Death +64 defense | | Hands: Gauntlets of Fate +54 defense | | Feet: Hell's Sabatons +60 defense | ================================================ Note: That is output from the command line, I just put it in code format to make it easy to read.
So you guys can see what I'm trying to accomplish here, I'm not asking you guys to create math formulas for me, but any ideas on what would be a better way to go about this would be much appreciated.