Attack AoE v3.1

Attack AoE v3.1

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Attack AoE v3.1

Post by Evil4Zerggin »

Ever wish you could see how much scatter your artillery is likely to have?

Ever wanted to see whether you could catch that enemy commander at the edge of their antinuke with splash damage?

Ever wondered just how much splash radius your orbital laser has?

If so, this widget is for you!

Attack AoE

When you are giving an attack command, it draws red circles indicating the area of effect of a weapon. It even shows the edge effectiveness of the weapon through the transparency of the circles.

But wait! That's not all! If the weapon is also inaccurate, it also draws a yellow circle indicating where the weapon is likely to scatter (erring on the side of overestimation).

Plus, get a special bonus when using a ballistic weapon: It draws a line indicating the approximate length of the scatter!

Great for:

Artillery!
Image

Wobble missiles!
Image

Bombers!
Image

Nukes!
Image

Ridiculously large plasma cannons!
Image

Shoopin' da woop!
Image

Download from caspring.org at the bottom of the page here.

Version History

3.1
Better wobble estimation.

3.0
  • Markers are now dynamic with range.
  • Ballistic calculation is much more detailed now. It traces shots to give a fairly accurate prediction of where shots can land, so you can use it to see if shots will scatter over a hill, for example.
  • Bombers now get a marker for each bomb.
  • Added flame and dgun markers.
  • Drawing code changed for hopefully improved performance.
  • Added some precomputation.
  • Now released under the GNU LGPL, version 2.1 or later.
2.6
  • First forum release.
Dev Notes
As with all my widgets, several of the major config variables are at the top.

This is one of my older widgets, and as a result is somewhat clunky; for example it eats quite a bit more time than any of my other widgets. (Ironically it's also my most downloaded widget at time of writing.) I may or may not rewrite it sometime.
Last edited by Evil4Zerggin on 22 Jan 2009, 09:29, edited 8 times in total.
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Attack AoE

Post by REVENGE »

IMA FIRIN' MAH LAZOR WITH ACCURACY!

WIN!
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Attack AoE

Post by Forboding Angel »

SOme slick work there. Nice job!
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Attack AoE

Post by REVENGE »

Now you can visualize exactly how useless a Catapult really is! :lol:
j/k
Masure
Posts: 581
Joined: 30 Jan 2007, 15:23

Re: Attack AoE

Post by Masure »

This is sex
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Attack AoE

Post by KDR_11k »

REVENGE wrote:Now you can visualize exactly how useless a Catapult really is! :lol:
j/k
Hm, does it handle wobble?
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: Attack AoE

Post by manolo_ »

could it be possible to modify the lua this way that u hold ctrl (or some other button) and the attack-mark didnt snap in?
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Attack AoE

Post by Evil4Zerggin »

KDR_11k wrote:
REVENGE wrote:Now you can visualize exactly how useless a Catapult really is! :lol:
j/k
Hm, does it handle wobble?

Code: Select all

currScatter = (weaponDef.wobble - weaponDef.turnRate) * weaponDef.maxVelocity * 10 * (weaponDef.range / weaponDef.maxVelocity + 1)
Unfortunately I don't know a great deal about random walks and the like so this is probably way off the mark. I'll see if I can think up a better estimation.
manolo_ wrote:could it be possible to modify the lua this way that u hold ctrl (or some other button) and the attack-mark didnt snap in?
I'm pretty sure the attack command itself snaps onto targets, so you're just seeing what you're getting? Or do you mean hiding the marker completely?
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Attack AoE

Post by Forboding Angel »

Evil4Zerggin wrote: Unfortunately I don't know a great deal about random walks and the like so this is probably way off the mark. I'll see if I can think up a better estimation.
It's reeeaaallly reaaaallly close. Basically the outside line is where some of the shots will hit. I did some fairly extensive testing with this last night and have declared it, unmitigated win.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Re: Attack AoE

Post by Warlord Zsinj »

Pretty cool. How flexible are the visual features? Would it be easy to change them to suit say, the IW GUI style?

(Also, out of curiosity, how have you licensed this?)
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Attack AoE

Post by Evil4Zerggin »

Well, it says "GNU GPL, v2 or later" on the tin. I don't have any strong allegiance to that particular license, though, so if that's a problem I'm open to suggestions.

The visual features are basically about the simplest GL I could concoct for the purpose. I've actually not tried IW yet, so I'm not sure how difficult it would be to change them to match that style.
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: Attack AoE

Post by Licho »

Its great.. i just dont get the scatter indicator.. is it at what distance? Or is the scattering constant no matter what distance you aim at?
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Attack AoE

Post by Evil4Zerggin »

The circle indicates the side-to-side spread, and the line indicates the range spread.

Currently the scatter indicator is more or less constant (it's calculated at maximum range), which isn't a very accurate estimation--for example, a ballistic weapon spreads more in range when shooting at a close target and more side-to-side when shooting at a distant target. I'm working on a more accurate ballistic marker. Maybe also more different markers for different types of weapons (flame, bombs, etc.).
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Attack AoE

Post by Forboding Angel »

CC:SA would be a much better license. GPL is poison in a project like spring.
User avatar
REVENGE
Posts: 2382
Joined: 24 Aug 2006, 06:13

Re: Attack AoE

Post by REVENGE »

I could see this being most useful for setting up efficient line bombings. 8)
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: Attack AoE

Post by Licho »

Line bombings no longer exist in CA and it cannot predict the new turn + toss - that would be too hard to calculate, too many factors..
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Attack AoE

Post by imbaczek »

monte carlo method could be good, but not sure it's worth the effort.
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Attack AoE

Post by Evil4Zerggin »

I don't think I can simulate flight behavior in Lua, even probabilistically.
User avatar
Evil4Zerggin
Posts: 557
Joined: 16 May 2007, 06:34

Re: Attack AoE

Post by Evil4Zerggin »

Major new version. A lot of things have changed, but the most dramatic one is the ballistic marker. I could get into the gritty details, but I think I'll let this image of aiming a Buzzsaw speak for itself.

ImageImage

The marker isn't a perfect predictor (for one thing I can't get exact muzzle positions), but it's quite close.
User avatar
Licho
Zero-K Developer
Posts: 3803
Joined: 19 May 2006, 19:13

Re: Attack AoE

Post by Licho »

Wow, the widget is pretty amazing :)
Post Reply

Return to “Lua Scripts”