[Arianne-devel] RP Balance application From: Miguel Angel Blanch Lardin - 2006-03-12 14:59 ```Hi all, I did a application to balance all our monsters. And danter asked me how it works, so I explain it here. The offending class is games.stendhal.tools.BalanceRPGame If you run it, it will start printing balanced stats output for each creature. So how we balance it? First we create a typical player for levels 0 to 110. for(int i=0;i<110;i++) { atkLevels[i]=10+(int)Math.round(Math.log(i+1)/Math.log(10)*7); defLevels[i]=10+(int)Math.round(Math.log(i+1)/Math.log(10)*14); } The HP is always 100+level*10 To create this formula I took data from player progressions. This data is from a player that doesn't train at all, it is not the case of some of our hardcore games. Now we define the equip a player will wear. p.getWeapon().put("atk",7+level*3); if(level==0) { p.getShield().put("def",0); } else { p.getShield().put("def",12+level/8); } p.getArmor().put("def",1+level/4); p.getHelmet().put("def",1+level/7); p.getLegs().put("def",1+level/7); p.getBoots().put("def",1+level/10); Again, these stats shows a typical progression althouth level >50 shows items that doesn't exists yet. Ok, once the player is setup I just test his/her stats against the creature by running a fight and getting the turns that took to get the result and the left HP. I do this for 100 turns to get mean values and ignore as possible the random effects. Once this is done it is time to measure the result. A good result is that one that takes around 30 turns + 1-2 turns per level. Also a player fighting against a level XX monster where player level is XX too should get around BaseHP - XX HP points left to consider it sucessful. We need to define these conditions in a better way, but the idea is something like that. So to achieve this I though of the problem as a search problem and "solved" it with a random tries around good values to search better alternatives. It needs anyway that you balance previously the monster to some semicorrect values so you don't search too much. That the overall idea. This I want to add: - Genetic search algo. This will better results. - Better way of defining goals to accept/reject a set of stats. - Better score method. Any help on this area is a really welcome help. Regards, Miguel ```