Heroes of Might and Magic Community
visiting hero! Register | Today's Posts | Games | Search! | FAQ/Rules | AvatarList | MemberList | Profile


Age of Heroes Headlines:  
5 Oct 2016: Heroes VII development comes to an end.. - read more
6 Aug 2016: Troubled Heroes VII Expansion Release - read more
26 Apr 2016: Heroes VII XPack - Trial by Fire - Coming out in June! - read more
17 Apr 2016: Global Alternative Creatures MOD for H7 after 1.8 Patch! - read more
7 Mar 2016: Romero launches a Piano Sonata Album Kickstarter! - read more
19 Feb 2016: Heroes 5.5 RC6, Heroes VII patch 1.7 are out! - read more
13 Jan 2016: Horn of the Abyss 1.4 Available for Download! - read more
17 Dec 2015: Heroes 5.5 update, 1.6 out for H7 - read more
23 Nov 2015: H7 1.4 & 1.5 patches Released - read more
31 Oct 2015: First H7 patches are out, End of DoC development - read more
5 Oct 2016: Heroes VII development comes to an end.. - read more
[X] Remove Ads
LOGIN:     Username:     Password:         [ Register ]
HOMM1: info forum | HOMM2: info forum | HOMM3: info mods forum | HOMM4: info CTG forum | HOMM5: info mods forum | MMH6: wiki forum | MMH7: wiki forum
Heroes Community > Library of Enlightenment > Thread: H3: How to test AI, autoplay?
Thread: H3: How to test AI, autoplay?
Serp
Serp


Known Hero
posted March 11, 2019 12:26 PM

H3: How to test AI, autoplay?

Hi, I created a map and would like to test if the AI plays as I expect.
(Hota map, playing with HD mod)

Is there any automatic way I can do this? Currently I'm sitting long time there and hitting the "next turn" button again and again.

I already tried a "ghost mouse" script, but for some reason the scripted clicks/button-press do not work ingame.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
wenwell
wenwell


Adventuring Hero
posted March 11, 2019 01:24 PM

You can use "gosolo" cheat code (well, pseudo-cheat) instead of ghost mouse.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Serp
Serp


Known Hero
posted March 11, 2019 03:07 PM

ah, did not know this chaet, works great (beside it helps/speed it up to forbid player 1 to have a hero), thank you

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hyde
Hyde

Tavern Dweller
posted May 16, 2019 12:26 AM

Hi all!

I have similar question - can I do many combat fight without running the game? I want to do many (like hundrets or thousands?) combat simulations and I would prefer to do it in some programming language. Is it possible to pass somehow parameters (like starting armies, stats, skills, spells, artifacts) and get the fight result: every move, damage done etc.?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
wenwell
wenwell


Adventuring Hero
posted May 16, 2019 09:20 AM

Most close thing I know is a Damage calculator. You can check web version here - https://heroes3tools.herokuapp.com/

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted May 16, 2019 10:34 AM

Hyde said:
Hi all!

I have similar question - can I do many combat fight without running the game? I want to do many (like hundrets or thousands?) combat simulations and I would prefer to do it in some programming language. Is it possible to pass somehow parameters (like starting armies, stats, skills, spells, artifacts) and get the fight result: every move, damage done etc.?


Quite frankly, I think the number of permutations is astronomical. The biggest blockade here is that we don't know in detail how the AI makes its decisions during combat. You'd need to know the AI subroutines in detail to be able to program a combat simulator with any degree of reliability.
____________
The last Reasonable Steward of Good Game Design and a Responsible Hero of HC. - Verriker

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hyde
Hyde

Tavern Dweller
posted May 16, 2019 04:12 PM
Edited by Hyde at 16:13, 16 May 2019.

Maurice said:
Hyde said:
Hi all!

I have similar question - can I do many combat fight without running the game? I want to do many (like hundrets or thousands?) combat simulations and I would prefer to do it in some programming language. Is it possible to pass somehow parameters (like starting armies, stats, skills, spells, artifacts) and get the fight result: every move, damage done etc.?


Quite frankly, I think the number of permutations is astronomical. The biggest blockade here is that we don't know in detail how the AI makes its decisions during combat. You'd need to know the AI subroutines in detail to be able to program a combat simulator with any degree of reliability.


I think I didn't express myself clearly What I need is to run auto-combat, I just want to set up everything (armies, skills etc.) using some programming language and do it many times saving the course of the battle (unit A move to hex YYY and atacks unit B with damage ZZZ, unit C move to hex YYY etc.) to file. It does not require to know how AI works.

Is it possible this way?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted May 16, 2019 10:05 PM

Yeah, that's possible, you just need to keep track of all the permutations. One thing you don't have control over, though, are the battlefield obstacles.

Also, regarding the permutations ... I think they quickly add up and will become pretty much insurmountably large within a few turns.
____________
The last Reasonable Steward of Good Game Design and a Responsible Hero of HC. - Verriker

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hyde
Hyde

Tavern Dweller
posted May 16, 2019 10:45 PM

Maurice said:
Yeah, that's possible, you just need to keep track of all the permutations. One thing you don't have control over, though, are the battlefield obstacles.

Also, regarding the permutations ... I think they quickly add up and will become pretty much insurmountably large within a few turns.


I don't understand what do you mean by adding up permutations. Let's suppose I want to see results of 100 battles.

1. 20 pikeman vs 10 archangels
2. 40 pikeman vs 10 archangels
3. 60 pikeman vs 10 archangels

etc.

100. 2000 pikeman vs 10 archangels

As the result I would like to have 100 text files with battle outcome (similar to log during autocombat but with added position on the battlefield). Where are those permutations you mentioned?

Anyway, you said that it is possible? Can you tell me how? Do I need to know some specific programming language or can I choose one that I prefer (eg python)?

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
avatar
avatar


Promising
Supreme Hero
posted May 17, 2019 08:32 AM

You wrote earlier that you want to set-up everything for example skills. So, results will be diffirent if attackih hero has offence skill and defending hero has advanced armorer, Luck can alter the game etc, etc.
____________

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted May 17, 2019 10:41 AM
Edited by Maurice at 10:45, 17 May 2019.

Do you just want to see the outcome of them beating on eachother? Or an actual battlefield simulation?

As it is, the battlefield is made up of 165 hexes. Each time a unit gets to move, it can move to any hex within its reach - which is further augmented or hampered by buffs, debuffs and battlefield obstacles.

Let's take the Pikeman from your example, assuming it starts its own turn on the left side of the battle field, in the middle. With its speed of 4 and ignoring buffs, debuffs and battlefield obstacles, it would be able to reach 32 other hexes, or choose to defend in its position. So, right after the first turn, you already have to consider 33 different permutations. Archangels are even worse there, because they can reach just about the entire battlefield in a single turn. That's what I mean.

If you just want to simulate the units exchanging blows without actual movement or battlefield constraints, then that's doable with some basic programming skills, because all you need is a RNG to simulate the damage variance due to the damage spread of most units.

However, that's a very unreliable way to simulate a battle outcome, since it depends on much more factors - even in direct combat alone, disregarding the battlefield, you'd have to distinguish between melee and ranged attacks and that's only doable if you take battlefield movement in consideration.
____________
The last Reasonable Steward of Good Game Design and a Responsible Hero of HC. - Verriker

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hyde
Hyde

Tavern Dweller
posted May 18, 2019 11:01 PM
Edited by Hyde at 23:05, 18 May 2019.

Maurice said:
Do you just want to see the outcome of them beating on eachother? Or an actual battlefield simulation?

As it is, the battlefield is made up of 165 hexes. Each time a unit gets to move, it can move to any hex within its reach - which is further augmented or hampered by buffs, debuffs and battlefield obstacles.

Let's take the Pikeman from your example, assuming it starts its own turn on the left side of the battle field, in the middle. With its speed of 4 and ignoring buffs, debuffs and battlefield obstacles, it would be able to reach 32 other hexes, or choose to defend in its position. So, right after the first turn, you already have to consider 33 different permutations. Archangels are even worse there, because they can reach just about the entire battlefield in a single turn. That's what I mean.

If you just want to simulate the units exchanging blows without actual movement or battlefield constraints, then that's doable with some basic programming skills, because all you need is a RNG to simulate the damage variance due to the damage spread of most units.

However, that's a very unreliable way to simulate a battle outcome, since it depends on much more factors - even in direct combat alone, disregarding the battlefield, you'd have to distinguish between melee and ranged attacks and that's only doable if you take battlefield movement in consideration.


All I need is the battle log a little bit more detailed than normal battle log (I need description of the movement that was made by every unit in every turn).

I don't want to program whole battle by myself and I understand why it is impossible.

The example I used in previous post (battles between pikemen and archangels) wasn't good, because it's true that damage calculator is all I need to predict outcome of these specific battles. But I also want to do some more complicated battles with different armies on both sides where I will not be able to predict outcome using only damage calculator (I don't now how AI works).

Regardless of whether my needs are strange or not I'm just looking for answer if it is possible to perform belowmentioned task in any programming language:

1. Set up battle parameters of both armies (heroes, army size and type, stats, artifacts etc.)
2. Run auto-combat for armies from point 1.
3. Write log of the battle (as detailed as it could be that mean normal battle log + description of units moves) to txt file.
4. Repeat points 1-3 for many times with different armies.


If it is possible - how?


 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Maurice
Maurice

Hero of Order
Part of the furniture
posted May 19, 2019 10:11 PM

So basically, you want the decisions made by the AI at every creature turn to be output to a file and parse it?
____________
The last Reasonable Steward of Good Game Design and a Responsible Hero of HC. - Verriker

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hyde
Hyde

Tavern Dweller
posted May 19, 2019 10:21 PM

Maurice said:
So basically, you want the decisions made by the AI at every creature turn to be output to a file and parse it?


Yes, that is exactly what I need.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
wenwell
wenwell


Adventuring Hero
posted May 21, 2019 01:55 PM

Talking about movement descriptions. You can use combat log in Oracle but it pretty much lack all other information

As example, battle in HD+, press Q in first round:

2 Crusaders [2, 2]..[2, 2] @ [3, 1]
1 Crusaders [3, 4]..[3, 4] @ [3, 2]
10 Pikemen [5, 5]..[5, 5] @ [5, 6]
1 Crusaders [2, 2]..[2, 2] @ [3, 2]
1 Griffins [3, 3]..[3, 2] @ [2, 2]
3 Swordsmen [3, 3]..[3, 3] @ [4, 3]
3 Marksmen [5, 3]..[5, 3] @ [4, 3]
1 Crusaders [5, 2]..[5, 2] @ [5, 3]
1 Crusaders [3, 2]..[3, 2] @ [2, 3]
3 Swordsmen [5, 5]..[5, 5] @ [5, 6]
1 Crusaders [5, 4]..[5, 4] @ [5, 5]

Same battle without HD+ (different obstacles and rng + some quick combat bugs possibilities):

2 Crusaders [2, 2]..[2, 2] @ [3, 1]
3 Griffins [3, 3]..[3, 2] @ [2, 2]
1 Crusaders [3, 4]..[3, 4] @ [3, 2]
3 Swordsmen [7, 3]..[7, 3] @ [8, 3]
10 Pikemen [5, 5]..[5, 5] @ [5, 6]
2 Crusaders [2, 2]..[2, 2] @ [3, 2]
1 Crusaders [5, 1]..[5, 1] @ [6, 1]
1 Crusaders [7, 1]..[7, 1] @ [6, 1]
3 Swordsmen [3, 2]..[3, 2] @ [2, 2]
14 Pikemen [5, 6]..[5, 6] @ [5, 5]
6 Pikemen [5, 5]..[5, 5] @ [5, 6]
1 Crusaders [5, 4]..[5, 4] @ [5, 5]
1 Crusaders [4, 2]..[4, 2] @ [3, 1]
1 Crusaders [6, 5]..[6, 5] @ [5, 5]
3 Swordsmen [5, 5]..[5, 5] @ [5, 6]
8 Pikemen [5, 6]..[5, 6] @ [5, 5]
2 Archers [3, 1]..[3, 1] @ [4, 2]
1 Crusaders [5, 4]..[5, 4] @ [5, 5]
1 Crusaders [6, 5]..[6, 5] @ [5, 5]
1 Swordsmen [5, 5]..[5, 5] @ [5, 6]
15 Pikemen [4, 5]..[4, 5] @ [5, 5]

Another movement description could be found in SoD_SP plugin (as D11, A3 eth.) but it is not displayed in combat log, sadly.

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
AlexSpl
AlexSpl


Responsible
Supreme Hero
posted May 22, 2019 02:20 PM

Quote:
If it is possible - how?

The most straightforward way is to write a plugin.

Quote:
You can use combat log in Oracle

Keep in mind that LMOracle doesn't interfere with the game in any way. It only reads game data periodically, therefore don't use it for quick battle logging, because the program may and will skip some turns.


 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Hyde
Hyde

Tavern Dweller
posted May 22, 2019 04:50 PM

AlexSpl said:
Quote:
If it is possible - how?

The most straightforward way is to write a plugin.



And this is the straighforwad answer I needed. Not the one I prefer, but I see that there is no shortcut

 Send Instant Message | Send E-Mail | View Profile | Quote Reply | Link
Jump To: « Prev Thread . . . Next Thread »
Post New Poll    Post New Topic    Post New Reply

Page compiled in 0.0644 seconds