bencbartlett / Overmind

AI for Screeps, a multiplayer programming strategy game
MIT License
545 stars 155 forks source link

Nuke response #178

Open ikiris opened 4 years ago

ikiris commented 4 years ago

Pull request summary

Code I'm running modified to handle nuke responses "better".

Description:

Nuke Responses already handle multiple nukes, so consolidate. Also don't just true up fortifications from highest to lowest priority as they could be woefully behind. First upgrade them to minimum survival value + critical barrier value, then fortify them as a subset using the normal proportional rules.

This was a pretty quick throw together, so I expect there will be things to clean up.

Testing checklist:

ikiris commented 4 years ago

Yes. The difference is before if the current level of fort is 2m and expected to be 20m, and a nuke lands:

prior) each priority structure will be brought up to the full expected 20m + nuke hits level before moving on to the next one, even if there are multiple priority structures this patch) each priority structure will be brought up to the expected damage of nuke hits + critical minimum from settings similar to before, then the priority structures as a group will all be raised together in lock step until they cap out.

the main difference is this prevents only raising one structure far beyond the rest when there are still priority structures that will die to the nuke and could be saved as well.