Answer the question
In order to leave comments, you need to log in
How to make an algorithm for choosing the most effective team of heroes?
Interested in your thoughts, suggestions, or even solutions to the problem.
The task was set (invented) by me.
There are many computer games where heroes fight each other. It is known that one hero is effective relative to another.
Let the hero's efficiency be determined by a number from 0 to 100. Where 0 is absolutely ineffective, and 100 is the most effective.
Let there be only 4 heroes. Let you choose a team of 3 heroes. Heroes may not be unique (you can choose 3 identical heroes).
Fights are team by team (3 vs 3).
Efficiency table
example For example:
Hero1 is effective against Hero1 by 50 points. Simply put, with their battle, the chances of winning are 50 units out of 100 possible (50%). Which is logical.
Hero1 is effective against Hero2 by 60 points. Those. in the battle between Hero1 and Hero2, the chances of Hero1 winning are 60 units. Probably Hero1 will win...
Hero2 is effective against Hero1 by 40 points.
The opposing team chose 3 heroes.
How to choose your team of 3 heroes, the most effective enemy team? What will be the algorithm?
Answer the question
In order to leave comments, you need to log in
If the enemy team has already been determined, and the size of the teams is what you described (say up to 5-6 characters), then a complete enumeration. (By the way, you did not tell about the rules of combat - one on one one fight or a survivor can help other "colleagues", etc.)
If the enemy team has not yet been determined, then game theory and the minimax approach .
A choice to understand: "Will the chosen hero be able to defeat someone?" can be defined as follows: the total effectiveness (the sum of the differences between the damage indicators of the selected hero and the enemy heroes) of the selected heroes must be greater than zero.
∞ iterate over so that the efficiency of each is positive and tends to zero (minimum overweight margin or minimax).
Everything else is optimization.
I would also add such parameters (coefficients that still need to be worked out in more detail) such as:
1. attack damage by each of the possible attack methods (ATTACK)
2. reload time of each of the possible methods
3. ability to attack each type of target
4. attack range to each target type
5. protection by each of the possible methods (PROTECTION)
6. defense recovery time of each of the possible defense methods
7. the ability to defend against each type of attack
8. the speed of movement by each of the possible methods (MOVEMENT)
9. freedom of movement (full - when flying, partial - depends on the terrain, stationary - for example, a defense turret or a bunker)
In turn-based play: cooldown can be calculated as the number of attacks per turn.
The big difference here: TURN-BASED or REAL-TIME combat.
I'll remember about the old man (StarCraft - RTS from Blizzard):
1. When they block the exit with two MCVs (slaves) that can repair each other, and behind them they put a couple of marines that beat off the hordes while they attack the slaves. It seems that with any calculation: killing 2 marines and 2 slaves is not a problem, if you have 6 marines and with any miscalculation - it will be clearly visible!
However, as reality shows: it all depends on the specific landscape / terrain and the ability to think strategically.
2. Marines are placed behind the buildings in a semicircle with equal distance for a simultaneous attack in front of the entrance, if melee troops (for example, zerglings) are attacking: made so that those who run in: are immediately under the fire of all marines and in order to kill all these marines, you need attacking everyone at the same time with a slight superiority, which is almost impossible to do with the mouse.
3. Banal labyrinth: when there is a narrow passage and only a few units can participate in close combat, the rest stand and wait (or die under fire).
Options for creating a labyrinth: narrow passages on the ground, specific buildings, specific organization of military units (units), or any combination of all of the above.
Much depends on the additional data and this table - it is not possible to answer your question. More data is needed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question