Loading...
  OR  Zero-K Name:    Password:   

AA micro widget

73 posts, 2678 views
Post comment
Filter:    Player:  
Page of 4 (73 records)
sort
13 years ago
I wrote a widget that distributed fire from missile towers among incoming gnats and blastwings. (it doesn't differentiate between the two)

Many thanks to KR and googlefrog for advice and links. Someone sent me the initial links to the site for Lua, sorry I don't remember your name.
More thanks to googlefrog for reference code taken from auto-swarm widget.

Final test run - v0.1:
http://zero-k.info/Battles/Detail/28962
3 towers on hold fire vs 1 gnat - only 1 tower shoots

14 towers, 50 gnats fly past on hold fire - 10 survive (8 for 3:1 kill ratio)
no widget, 14 towers, 50 gnats fly past on hold fire - 12 survive

13 towers, 50 gnats fly past on hold fire - 14 survive (11 for 3:1 kill ratio)
no widget, 13 towers, 50 gnats fly past on hold fire - 16 survive

13 towers on hold fire, 50 gnats pause over towers on hold fire - 6 survive (!!)
no widget, 13 towers, 50 gnats pause over towers on hold fire - 14 survive

Known Issues:
Does not prevent towers from firing on targets already targeted
- Hold Fire prevents this and greatly improves the performance but makes the towers not shoot anything else (working on this)
Expected to be CPU-heavy if many gnats/blastwings are on screen as well as many missile towers (have not experienced problems but algorithm scales by square of problem size)


Version 0.1
http://www.mediafire.com/?3e8e2dbw272zbly
+0 / -0
13 years ago
"Someone sent me the initial links to the site for Lua, sorry I don't remember your name."
But thanks anyway! That was very helpful!
+0 / -0
13 years ago
Integrated AA defence ideas:

No overkill fire distribution - needs detecting units firing
Hacksaws and Screamers don't shoot low hp targets if other AA is there to shoot them

Screamers calculate optimal target for AoE effect
+0 / -0
13 years ago
This is cool, can't wait to try it!
+0 / -0
13 years ago
v0.11 is up. Link updated.

Changed internal get targets algorithm. No behaviour change expected.

Should have reduced CPU usage.
+0 / -0
13 years ago
Two request
enable = false by default
and
unload if spectator
+0 / -0
13 years ago
v0.12
http://www.mediafire.com/?6mz34uxs2y4ocqj

enable = false
unloads if spec
Will work on towers built before widget starts
+0 / -0
13 years ago
whoops, I posted the developing version. Do not download above link. Will update ASAP.
+0 / -0
13 years ago
v0.12
http://www.mediafire.com/?17trf2ccgrzvx8a
+0 / -0
13 years ago
v0.12 - re
http://www.mediafire.com/?8mdlkyvs13lpg18

fixed widget failure
+0 / -0
13 years ago
v0.2
http://www.mediafire.com/?rdivalhycq1vfqx

targeting algorithm improved
missile towers will now shoot other targets when no gnats in range
- hold fire may now be safely used
- known issue: cloak state needs to turn off widget
+0 / -0
13 years ago
Do not use hold fire, I am tracing a bug that causes spring to crash. The land targeting has been implicated in tests.

If it still crashes, please post here to say so then don't use widget or use v0.1*.
+0 / -0
13 years ago
v0.3
http://www.mediafire.com/?roktfc1c3hyckpi

General AA targeting. Micros defenders, hacksaws, chainsaws, screamers.

Targeting checks if turret is ready to fire before assigning. Target hogging by reloading turrets should not occur.

Defenders will shoot land when no air targets in range.
- Remembers last target and continues shooting that if still in range and not dead.
Defenders will count ammo and cycle shots correctly.

Screamers know when they are out of ammo and won't fire or target hog.

Air targeting prioritizes visible aircraft.
Targeting prefers to shoot weakest, but will maximize casualties.
One-hit-kills will be preferred, in order of highest hp that can be one-shotted.
When no visible aircraft, will shoot radar dot aircraft.
- Remembers last target and continues shooting that if still in range and not dead.

Known issues:
Air targets that are in range but cannot be fired upon due to blocking by allies or terrain will cause target hogging and prevent the defender from shooting land.

Hacksaws will sometimes overkill despite overkill prevention.

Hacksaws' 2nd shot not retargeted if 1st shot kills target before 2nd launches. (work in progress)

Chainsaws fire slightly slower if hold fire is on.

Screamers don't take into account AoE. (work in progress)

Defenders actually shoot slightly faster than without widget. (Not sure why. Missile reload time was obtained through experiment but seems to be weird)
+0 / -0
13 years ago
Maximum benefit in chaotic environments, with lots of different types of turrets and aircraft flying around.

Better than humans or auto-targeting in those cases.

Worse than auto-targeting if ping > 1000ms.


Planned: Priority target (aim a tower at something and that thing will take priority over everything else, including overkill)
+0 / -0


13 years ago
Hacksaws shoot both missiles at the same target, this is enforced. They even shoot into empty space if the target has died.
+0 / -0
13 years ago
It is not.

In one of the earlier tests, if you park a swarm of gnats near a hacksaw, the hacksaw will fire twice, killing two gnats.

Not sure if that still applies since that was before I added the refire delay and the reload state detection (which wiped that behaviour)
I'm working on reinstating it, only with damage calculations. Missile towers are already exceptions, Hacksaws may as well be.

But the exact chain of events goes like this:
Hacksaw receives attack order to one gnat, fires a missile. (frame 0)
Hacksaw gets attack order removed from queue. (frame 3)
Hacksaw gets stop order. (frame 3)
Gnat gets hit, dies. (frame X)
Hacksaw receives attack order to another gnat, after delay fires missile at 2nd gnat, killing it. (frame X+3)
+0 / -0
13 years ago
Being a air player, I'm probably going to regret asking this, but you could make that Screamer always reserver 2 shots to kill one Licho plane.
+0 / -0
13 years ago
I can do that easily. But two problems:

1. You don't want this all the time. Might not want to save screamer missiles.
So I'd have to make a toggle.

2. You can't know if a particular radar dot is a Licho or not. Or at least, not easily.
I think measuring move speed could work, but that would be for later. I'd write an air radar dot ID helper first before attempting this.
+0 / -0
13 years ago
"Defenders actually shoot slightly faster than without widget." -jseah

Maybe because you are currently using "widget:Update()" rather than "widget:GameFrame()". From "SpringLuaScripting.pdf": it says that "widget:GameFrame()" actually run in sync with the Spring's own SIM while "widget:Update()" actually run as fast as it can. I think maybe if you use "widget:GameFrame()" you could also reduce CPU usage, IMO.

I changed your "Update" into "GameFrame" in your widget and it still work.
+0 / -0
13 years ago
Defender reload time calculations depend on 3 updates to 1 frame. So it'll think defenders take 3 times longer to load if you do that.

In any case, I'm looking into creating a gadget. Will update to using GameFrame when that occurs.
+0 / -0
Page of 4 (73 records)