Hello everyone,
I’ve coded a combat simulator for Age of Empires 2 - Definitive Edition (latest patch) which I’d like to share with you.
With the combat simulator you can compute the expected outcome of battles between two arbitrary armies in AoE2.
IMPORTANT: THE CURRENT VERSION IS NOT OPTIMIZED FOR MOBILE DEVICES YET.
Details about usage, code and the simulation process can be found in the following YouTube video: https://www.youtube.com/watch?v=QZVT7kQYvoM&feature=youtu.be
Here’s the link to the simulator: https://aoe-combatsim.com/
In case you’re interested in the code (or the parallelized .NET C# version of the simulator), you can find it on GitHub: https://github.com/Zukatah/AoeCombatSimulator and https://github.com/Zukatah/AoeCombatSimulatorWeb
In case…
…you find bugs
…you encounter unexpected results
…you have suggestions for improvement (apart from support for mobile devices obviously)
=> I look forward to your feedback.
5 Likes
Great work mate… do civ bonuses or techs count? I couldn’t find them.
Thanks!
In the current version, all units are post imp teched (fully teched).
All (elite) unique units are affected by all techs and civ bonusses their respective civ has access to.
Support for individual tech and civ bonus selection might be added in the future.
In case you’re interested, you can find more detailed information in the linked YouTube video 
1 Like
This simulator seems interesting, but I am afraid, that it doesn’t consider collision and pathfinding properly. It said for 100 villagers vs 1 paladin test, that on average 98 villagers would survive. I tested in scenario editor 100 briton villagers vs 1 persian paladin (with repeated right-clicking, so villagers would keep fighting) and 90 villagers survived.
Also it should be possible to set civilization and technologies for both sides. What were the stats of the paladin in combat simulator test?
I like the idea but have a few questions
Are the individual units affected by the civ bonus and limitation of technology as well or they are all fully upgraded without regards for the upgrades a civ has? (cumans don’t have bracer, does its cav archer have it? goths don’t have arbalest, can i select it anyway? indians don’t have knight line, can i select it?)
Could the implementation of the hit and run be a slider that lets decide the user (me) what % of hit & and run i want instead of 0 - 50 - 100% (as it seems it is only a small operation)
Maybe you could ask a dev how does the targetting sytem works to be more accurate
@Yorok0 probably needs some more tweaks for the melee units (more melee units can attack a single unit in the simulation than what it is possible in game)
@Yorok0
You’re absolutely right! In extreme cases (a unit ratio of ca. 8:1 or higher between the different armies) due to the lack of collisions a unit can be attacked by an unlimited number of attackers at once which is not possible in the game. In most situations where the unit ratio isn’t higher than ca. 8, there isn’t really a problem (because the speed reduction I’ve explained in my video is simulating collisions quite well), but if the ratio is 100:1 as in your example, the results are definitely “distorted”. I could try to fix this by hardcoding a maximum number of attackers on one unit and an “idle” state of attackers that don’t find a target.
@RoomOfTheEvil & @Yorok0
The stats of all non-unique-units are “generic civ post imp” (you can find more information in the linked YouTube video) and the stats of all unique units are “post imp for their respective civ”.
Hence…
…Elite Kipchaks don’t have bracer.
…Elite Huskarls lack the last armor upgrade.
…Elite Teutonic Knights have access to all infantry techs from Barracks and Blacksmith.
…all non unique units are always fully upgraded.
and so on.
I’m still thinking about adding all the civs and their respectiv tech trees and bonusses for all the non-unique units as well, but that’s a huge amount of work. I have to see if I find the time needed to do that.
@RoomOfTheEvil
Your slider idea is nice. I think I will implement that!
And yes, maybe I should just ask the devs for the target selection^^
The civ differentiation addition is definitely a must then because else this won’t really be a simulation of the real… simulation as i can’t use it to determine in a civ matchup.
It would definitely be a nice addition, I agree with that.
However, I do think, that the current version is very well able to simulate a lot of real & existing situations.
While for example…
-some civs lack certain infantry blacksmith or barracks upgrades
-some civs lack the champion/halberdier upgrades
-some civs have specific bonusses for champions/halberdiers
…most civs DO have just vanilla post-imp champions and/or vanilla halberdiers (with Blast Furnace, Plate Mail Armor and Squires). Same goes for most other non-unique unit types (except for e.g. the Battle Elephant).
So in my opinion even with the current versions many real game situations can be simulated pretty accurately with my simulator.
Hi, your simulator predicts that even with perfect hit and run, 14 elite war elephants will defeat 50 elite longbowmen. I tried this in the scenario editor, controlling the longbowmen myself, and I was able to kill all 14 elite war elephants with 37 of my 50 longbowmen still alive at the end. That was with enough space to continually run away until the battle was over.
1 Like
Hey!
Actually that’s still in line with what I expect for three reasons:
(1)
Units don’t automatically attack the closest target - target selection in AoE2 (and therefore in my simulator as well) works differently. You can check out my video ( https://www.youtube.com/watch?v=QZVT7kQYvoM ) for that.
Perfect Hit&Run means that the ranged units run away from their respective target with perfect efficiency/timing. Let’s assume we have the two elite longbowmen Donald and Joe and the two elite war elephants rams Angela and Emanuel. If Donald attacks Angela, but Angela attacks Joe, Joe attacks Emanuel and Emanuel attacks Donald, after a few seconds there won’t be any Hit&Run going on anymore, because Donald and Joe have a distance of 12 (their max range) to their respective targets. However, Donald is still under attack by Emanuel and Joe by Angela, so despite Perfect Hit&Run activated, noone is actually running anymore, which is what can happen in AoE2 itself as well.
(2)
In order to avoid infinite loops (especially when a unit with a minimum range runs away from a melee unit that has the same speed), maps are not infinitely large. Hence at some point of time, the elite longbowman (even when not dying due to (1)) will arrive at the map’s edge and stop running any further. Usually that rarely happens, but since elite war elephants have a LOT of hp and pierce armor, this situation can definitely arise in the settings you’ve described.
(3)
“Perfect Hit&Run” is not what you probably think it is (I again refer to https://www.youtube.com/watch?v=QZVT7kQYvoM ). It does not mean that a ranged unit runs after each shot for as long as it needs to get far away from its target.
“Perfect Hit&Run” means that it still fires as fast as it can, and that it only uses the time between the end of each attack animation and the beginning of the next attack animation to run away from its target.
Since an elite longbowman is only slightly faster than an elite war elephant but has a pretty long attack animation, the elite war elephant will actually close the gap during the elite longbowman’s “Perfect Hit&Run”.
Imho to “simulate” the sort of Hit&Run you probably have in mind, you don’t need a simulator at all. Under “ideal” circumstances a single elite longbowman will win vs. 50 elite war elephants because his slight speed advantage gives him the chance to Hit&Run the elephants forever - but it will take him several days to kill all 50 elephants, so that just isn’t a reasonable scenario to consider.
1 Like