Answer the question
In order to leave comments, you need to log in
How to solve tower defense game?
Suppose we know the defense parameters (number of towers, the damage they cause per second, and their durability)
We also know the attack parameters (different characters with their damage, health, and cost used to order new units)
If, for a certain time, the attack team destroys all the defense towers, then it wins.
How to calculate the probability of a team winning using Excel? How to take into account the terrain and downtime of some towers / units during the match in the development of the model?
The answer is desirable to suggest a simple example.
Answer the question
In order to leave comments, you need to log in
You need a book on mathematical modeling for dummies.
In general, you cannot do with one excel, as well as with one answer on the toaster.
If you simplify everything as much as possible, then you need to:
Draw up a model of the defense side:
- A diagram of the location itself
- A diagram of the location of the towers
- Damage maps (tower coverage areas, depending on range and dps \ dpt) Draw
a diagram of the attack side:
- Respawn points and "paths " for units.
- List and units.
- Calculate the efficiency for each type of units (how many lives in one or another damage zone, how much time it takes to get through / inflict damage in one or another damage zone, etc.)
Then superimpose these indicators on each other and simulate a battle.
If the potential lifetime of units in a given damage zone is greater than the time required to deal damage > than the HP of the tower -> the tower is destroyed.
(we take into account the planned death of units and the corresponding decrease in DPS \ DPT)
Well, then everything depends on the complexity / non-linearity of the logic and the possibility of macro- and micro-control by the player.
This is a complex problem and is solved by modeling. Excel won't help.
Tower - rate of fire every 4 seconds (sat), durability 16 (pb), damage 8 (db).
Enemy - rate of fire every 2 seconds (sv), durability 32 (pv), damage 4 (sv).
Time of war (when everyone is in the opponent's kill zone): 8 seconds. (vv)
Destruction zones - the enemy and the tower are equal.
8/4=2 shots the tower will have time to fire at the enemy (in the affected area)
32-2*8=16 - the enemy will be damaged by 50%
of the enemy's strength after the war: pv-kill*(vv/sat)
8/2=4 shots the enemy will have time to hit the tower (in the affected area)
16-4*4=16-16=0 the enemy will destroy the tower tower
strength after the war: pb-uv*(vv/v)
Outcome of the game: the enemy will capture the fortifications, the player will lose.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question