chainapockets
New Member
- Joined
- Dec 26, 2014
- Messages
- 98
- Reaction score
- 1
Hello guys,
after playing with the bot for a few days now, i'd like to share my opinions on how to make the DefaultRoutine even more viable for constructed ranked games or tournaments (if you do participate in them with the bot).
First of all, everything mentioned in here is only my opinion. Feel free to discuss and share your own opinions on several things, with the friendly amount of respect for each user.
Let's start.
Since the Bot comes with Silverfish API as Routine and is currently under rework/rewrite there are a lot of stuff in the Routines which isn't optimized yet. That doesn't mean that the basic DefaultRoutine.cs is bad, not at all.
It works quite good, but i'm one of those person who wants to get every little possible peace out of a bot to push it to the limits.
Before you continue reading, please backup your DefaultRoutine.cs right now. Go to your Hearthbuddy folder \Routines\DefaultRoutine\ . Thanks.
If you open your DefaultRoutine.cs now with Notepad you see a big field of lines and code. If this is too messed up for you, i suggest you to download Notepad++ (it's free). It makes everything easier to read and look through.
Now start to search for the following line (ctrl+F / strg+F):
At the first look you won't understand too much on it, but if you read the stuff behind the code lines it all gets kind of "understandable".
Now we come to the interesting stuff, finally !
These are actually the only code lines yet, which are worth to change.
Here is the original DefaultRoutine.cs code snippet of that part in the Routine:
So what i actually did was creating 2 modified Routines. One for "Control" decks and one for "Rush" decks.
That's actually quite easy, because you only have to change one single line!
If you want your Routine to play a "Control" style, you must have the following code line like this:
If you want your Routine to play a "Rush" style, you must have the following code line like this:
by enabling the "Rush" mode your hero is set to focus mainly on hitting the enemy hero and taunt's (and some times big threats). Taunt's are focused for obvious reason.
Now let me show you how my modified Routine looks like.
Routine - modified:
As you can see i changed a few values. These are not set in stone. As they are my personal preference and i still have to do a lot of testing.
Right now, as i mentioned at the start of this post, there are a lot of code lines which aren't quite clear for understanding yet.
So the only thing we can do is changing values, testing, testing, changing values, testing testing.
If there were a possibility of getting a "calculating" logfile output for every single game, in which you can see what the bot actually did calculate for each action it made, we might would get a better understanding for the single code lines and how they actually do effect the Routine and the play of the bot.
If you have any questions feel free to ask, maybe i can answer them.
If someone has a better understanding of the API, it would be nice to get some explanation on some code lines.
To the Developers: Would it be possible to implement some kind of "Calculating Logfile" output? Just for getting a better understanding on how each value effects the routine / bot and to get a better chance of tweaking it to it's limits.
Let's play cards,
chainapockets!
after playing with the bot for a few days now, i'd like to share my opinions on how to make the DefaultRoutine even more viable for constructed ranked games or tournaments (if you do participate in them with the bot).
First of all, everything mentioned in here is only my opinion. Feel free to discuss and share your own opinions on several things, with the friendly amount of respect for each user.
[UPDATE #1]
- i found some answers to a few code lines and the silver.exe
- will edit post according to this soon
[UPDATE #2 - 31.12.2014 / 06:15 CET]
- seems like i found a decent value combination which will not slow down your calculating or freeze your game. (all testings were without external calculating, calculating processes were fully done in hearthbuddy)
- all testings were done with different classes and different decks
- note: please remember, these are only suggestions.
- sideinfo: i won't post win/loss ratio results. reason: if i tell you i got 80% or more winratio with it on different classes, you think you will get this too. but decks and opponents do vary and so do regional plays. and even i do have runs of 5 hours were i may get 80%, but then i have 2-3 hours were i only get 60%, for example.
credits to: obtkamer for suggesting mxwide and twotsamount value ranges
int enfacehp = 30;
int mxwde = 5000;
int twotsamount = 1500;
bool enemySecondTurnSim = true;
bool playaround = false;
int playaroundprob = 50;
int playaroundprob2 = 80;
this.useExternalProcess = false;
int amountBoardsInEnemyTurnSim = 100;
int amountBoardsInEnemyTurnSimSecondStepp = 200;
int amountBoardsInEnemySecondTurnSim = 250;
int nextturnsimDeep = 6;
int nextturnsimMaxWidth = 1000;
int nexttunsimMaxBoards = 1000;
bool secrets = false;
int alpha = 50;
HREngine.Bots.Settings.Instance.simulatePlacement = true;
Let's start.
Since the Bot comes with Silverfish API as Routine and is currently under rework/rewrite there are a lot of stuff in the Routines which isn't optimized yet. That doesn't mean that the basic DefaultRoutine.cs is bad, not at all.
It works quite good, but i'm one of those person who wants to get every little possible peace out of a bot to push it to the limits.
Before you continue reading, please backup your DefaultRoutine.cs right now. Go to your Hearthbuddy folder \Routines\DefaultRoutine\ . Thanks.
If you open your DefaultRoutine.cs now with Notepad you see a big field of lines and code. If this is too messed up for you, i suggest you to download Notepad++ (it's free). It makes everything easier to read and look through.
Now start to search for the following line (ctrl+F / strg+F):
You found it? Great.// play with these settings###################################
At the first look you won't understand too much on it, but if you read the stuff behind the code lines it all gets kind of "understandable".
Now we come to the interesting stuff, finally !

These are actually the only code lines yet, which are worth to change.
Here is the original DefaultRoutine.cs code snippet of that part in the Routine:
// play with these settings###################################
int enfacehp = 15; // hp of enemy when your hero is allowed to attack the enemy face with his weapon
int mxwde = 3000; // numer of boards which are taken to the next deep-lvl
int twotsamount = 0; // number of boards where the next turn is simulated
bool enemySecondTurnSim = false; // if he simulates the next players-turn, he also simulates the enemys respons
bool playaround = false; //play around some enemys aoe-spells?
//these two probs are >= 0 and <= 100
int playaroundprob = 50; //probability where the enemy plays the aoe-spell, but your minions will not die through it
int playaroundprob2 = 80; // probability where the enemy plays the aoe-spell, and your minions can die!
this.useExternalProcess = false; // use silver.exe for calculations a lot faster than turning it off (true = recomended)
int amountBoardsInEnemyTurnSim = 40;
int amountBoardsInEnemyTurnSimSecondStepp = 200;
int amountBoardsInEnemySecondTurnSim = 20;
int nextturnsimDeep = 6;
int nextturnsimMaxWidth = 20;
int nexttunsimMaxBoards = 200;
bool secrets = false; // playing arround enemys secrets
int alpha = 50; // weight of the second turn in calculation (0<= alpha <= 100)
So what i actually did was creating 2 modified Routines. One for "Control" decks and one for "Rush" decks.
That's actually quite easy, because you only have to change one single line!
If you want your Routine to play a "Control" style, you must have the following code line like this:
- this actually the default setting of your DefaultRoutine.cs which comes with the bot.Behavior behave = new BehaviorControl();
If you want your Routine to play a "Rush" style, you must have the following code line like this:
Behavior behave = new BehaviorRush();
by enabling the "Rush" mode your hero is set to focus mainly on hitting the enemy hero and taunt's (and some times big threats). Taunt's are focused for obvious reason.

Now let me show you how my modified Routine looks like.
Routine - modified:
// play with these settings###################################
int enfacehp = 30; // hp of enemy when your hero is allowed to attack the enemy face with his weapon
int mxwde = 3850; // numer of boards which are taken to the next deep-lvl
int twotsamount = 120; // number of boards where the next turn is simulated
bool enemySecondTurnSim = true; // if he simulates the next players-turn, he also simulates the enemys respons
bool playaround = false; //play around some enemys aoe-spells?
//these two probs are >= 0 and <= 100
int playaroundprob = 50; //probability where the enemy plays the aoe-spell, but your minions will not die through it
int playaroundprob2 = 80; // probability where the enemy plays the aoe-spell, and your minions can die!
this.useExternalProcess = false; // use silver.exe for calculations a lot faster than turning it off (true = recomended)
int amountBoardsInEnemyTurnSim = 70;
int amountBoardsInEnemyTurnSimSecondStepp = 200;
int amountBoardsInEnemySecondTurnSim = 70;
int nextturnsimDeep = 10;
int nextturnsimMaxWidth = 20;
int nexttunsimMaxBoards = 200;
bool secrets = false; // playing arround enemys secrets
int alpha = 50; // weight of the second turn in calculation (0<= alpha <= 100)
As you can see i changed a few values. These are not set in stone. As they are my personal preference and i still have to do a lot of testing.
- i did change the value to 30, so my hero does start hitting the enemy hero with his weapon from the start.int enfacehp = 30;
- needs explanation by the API creator for better understanding. i tried values between 3000-5000, but higher value = needs more time for calculating. users with slower pc's could end up not finishing turns if the number is set to high.int mxwde = 3850;
- did try numbers between 25-350. didn't feel a weaker play by the bot, so i just took something in the mid at the end.int twotsamount = 120;
- IMPORTANT! You always have to be one step ahead of your enemy and so the bot has to be too. Calculating the enemies response is crucial for this!bool enemySecondTurnSim = true;
- i didn't test this yet, but "avoiding" some enemy aoe spells could be nice in certain matchups. on the other side, i don't see much use of this yet. (maybe some1 does)bool playaround = false;
int playaroundprob = 50;
int playaroundprob2 = 80;
- i wasn't able to find silver.exe yet, but the programmer says that calculating will be a lot faster with it and setting this to "true" is recommended. maybe some1 can help out with this?this.useExternalProcess = false;
- needs explanation by the API creator for better understanding. i did only play around with the first and last number. tried values between 20 and 300. couldn't find any bad response yet.int amountBoardsInEnemyTurnSim = 70;
int amountBoardsInEnemyTurnSimSecondStepp = 200;
int amountBoardsInEnemySecondTurnSim = 70;
- needs explanation by the API creator for better understanding. i did only adjust the first number between 6-25.int nextturnsimDeep = 10;
int nextturnsimMaxWidth = 20;
int nexttunsimMaxBoards = 200;
Right now, as i mentioned at the start of this post, there are a lot of code lines which aren't quite clear for understanding yet.
So the only thing we can do is changing values, testing, testing, changing values, testing testing.
If there were a possibility of getting a "calculating" logfile output for every single game, in which you can see what the bot actually did calculate for each action it made, we might would get a better understanding for the single code lines and how they actually do effect the Routine and the play of the bot.
If you have any questions feel free to ask, maybe i can answer them.
If someone has a better understanding of the API, it would be nice to get some explanation on some code lines.
To the Developers: Would it be possible to implement some kind of "Calculating Logfile" output? Just for getting a better understanding on how each value effects the routine / bot and to get a better chance of tweaking it to it's limits.
Let's play cards,
chainapockets!
Last edited: