RaphaelRoyerRivard / MicroMachine

Starcraft 2 Bot
MIT License
14 stars 0 forks source link

Code Tank logic #952

Open RaphaelRoyerRivard opened 4 years ago

RaphaelRoyerRivard commented 4 years ago

Could start with :

RaphaelRoyerRivard commented 4 years ago

Could also get inspired by Sharpy's implementation https://github.com/DrInfy/sharpy-sc2/blob/develop/sharpy/managers/combat2/terran/micro_tanks.py#L51

RaphaelRoyerRivard commented 4 years ago

Ketroc said that it is very rare that it is better to unsiege the Tanks when targettable enemies get close. It is usually better to let them die while getting a few more shots because it takes too much time to unsiege.

Unusual229 commented 4 years ago

What if there is 1 worker? or 1 marine or whatever? Do we siege all 20 siege tanks for it? Should not siege for individual units, maybe. Just a reminder that the siege tank has a higher dps while unsieged, although much shorter range. So for individual units, we might not want to siege, even if its an immortal. The time it takes to siege for a single unit, isn't worth it.

What if we have 3 tanks vs 10 speedlings, we see them at 16 range, but we only siege at 13. We are done sieging, they are at 3 range. We lose all of our tanks, while it should have been the opposite. We need to siege earlier when the enemy is coming in our general direction , so it is likely to be at 13 range when we are done sieging.

What if we have 1 sieged tank and there is a zergling next to it trying to kill our tank? Surely we need to unsiege. We should only unsiege if there is no attackable threat and no threat near (15 range maybe?).

What if we have 3 siege tanks, 15 marines and there is a zergling in the middle of the marines. Do we just shoot and kill our army? We might want to consider if the splash damage would deal more damage to us than to the opponent.

We are not ready to attack so we siege on high ground, great. But where? If its always the main, then it is useless in the mid/late game. If its always the most recent base, there isn't always a high ground. Another option would be to siege in the mineral line of our most recent base or most recently attacked base, this way scvs can repair the siege tanks quickly if in need. Doesn't use the high ground advantage, but its significantly easier to program.

Just room for thought.

RaphaelRoyerRivard commented 4 years ago

If we see a single Thor, it might still be worth it to siege against it. Also, if we want to attack close range with our Tanks, they might block our Cyclones that want to kite back. It's true that it will often not be worth it to lose all that time to siege, but it's safer. I guess we could come up with some rule to prevent the siege in situations where it is not worth it, but I don't think the number of targettable enemies is the best metric. Maybe it will be easier after we get to see how the Tanks play out?

Should the Tanks siege at a greater distance only if the enemies are moving towards us? I could calculate their movement direction and prevent the siege out of range when the enemies are fleeing.

Yes that's right, if there are units in close range of the Tank and there are no other targets, the Tank definitely should unsiege.

I will need to do a better targetting logic for the Tanks, but if their shot would be bad for us, can we prevent them from attacking? Does a stop command prevents them from attacking or do we need to spam something?

I guess I could put the Tanks in the mineral line, but they might prevent our other units from getting repaired. Also, do they block the pathing of mining workers? I could maybe place them close to our ramp if we are on 2 bases or less and next to the CC if we have more than 2 bases.

Unusual229 commented 4 years ago

The point of sieged tanks is for their range and splash, if we siege to kill a single unit, we are not using the splash at all (could hurt us more than the opponent) and we are not necessarily using the range, since the unit might have moved away. I don't want to see our whole crushingly strong army stop to siege and kill or even fail to kill a single zergling and give the opponent time to build an army to stop ours.

To stop sieged tanks from attacking, I believe you can just send the Stop command every few frames, though that would need to be tested to know the exact number of frames or it could be sent every frame.

Unless sieged tanks have a property that I am not aware of, workers can path through any non-building units while gathering resources (they can path through a select few buidling units, but let's not bother with the details). It could be tested in-game really quickly just to be sure.

RaphaelRoyerRivard commented 4 years ago

Ok but what if there are 2 Zerglings? We probably still don't want to siege even though there is more than 1 enemy. We need a better logic than just the number of targettable enemies.

RaphaelRoyerRivard commented 4 years ago

pour les tanks, te faudrait une fonction qui calcule la meilleure target en considérant le splash pour maximiser les DPS Les kill devraient compter comme 100% health damage, comme ca les kills sont priorisé aussi pour éviter de maximiser le DPS, sans jamais faire de kill parce que le DPS serait plus bas

RaphaelRoyerRivard commented 3 years ago

Tanks cannot be given the STOP action to prevent them from attacking. Workers cannot mineral walk through siedged up tanks.

RaphaelRoyerRivard commented 3 years ago

Minimum range of sieged tanks is 2 + both radiuses.

RaphaelRoyerRivard commented 3 years ago

Tanks should not siege up against fast units that aren't too far if they do not have units in front of them to protect them. See https://aiarena.net/matches/433092/ image