Attack area visualization widget

Attack area visualization widget

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

Moderator: Moderators

Post Reply
a1983
Posts: 55
Joined: 02 Dec 2009, 12:01

Attack area visualization widget

Post by a1983 » 24 Jan 2013, 16:22

Image
Here is attack area visualization widget. Currently its work only for cannons and direct fire towers. It's damned slow, so currently it can be used only to place towers. When you build tower, press meta key to see, where your tower can fire.
There are some ugly maths, may be you guys can help to improve that. Also may be to do something with square - made them more smooth.
Any help would be appreciate.

P.S.
This is continue of this topic
Attachments
gui_attack_area.lua
(18.17 KiB) Downloaded 37 times
AttackRange2.jpg
(222.19 KiB) Downloaded 6 times
0 x

User avatar
smoth
Posts: 22271
Joined: 13 Jan 2005, 00:46

Re: Attack area visualization widget

Post by smoth » 24 Jan 2013, 16:26

neat!
0 x

User avatar
Jools
XTA Developer
Posts: 2767
Joined: 23 Feb 2009, 16:29

Re: Attack area visualization widget

Post by Jools » 24 Jan 2013, 16:35

What is that interface you have? It looks very nice. Especially the build menu.
0 x

User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

Re: Attack area visualization widget

Post by danil_kalina » 24 Jan 2013, 20:10

Can Lua calculate some stuf in other thread and return result by callback when it is done ?
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Attack area visualization widget

Post by jK » 24 Jan 2013, 20:31

Strange I always worked on the related engine code & visualization for ages now. And just a few days ago commited the most important changes. So 92.0 will be able to show a bad attack cursor for positions static defense cannot hit.
I also experimented with the attack range circle, to switch from the estimation function to the 100% correct TryTarget function. But it's damn slow. So won't come with 92.0 yet. Your visualization is great btw :D
0 x

a1983
Posts: 55
Joined: 02 Dec 2009, 12:01

Re: Attack area visualization widget

Post by a1983 » 25 Jan 2013, 08:24

Thx, JK. Waiting for 92 version then :)
0 x

el_matarife
Posts: 933
Joined: 27 Feb 2006, 02:04

Re: Attack area visualization widget

Post by el_matarife » 01 Feb 2013, 23:41

Could you break it out into multiple threads? Seems like it should be able to be parallelized pretty easily since the results of each calculation don't depend on each other.
0 x

User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Attack area visualization widget

Post by jK » 01 Feb 2013, 23:55

Who uses OMP more and more across the whole engine? ;)

Also mt'ing just gives a n-speedup, but the code is like ~100x too slow to be usable, so you need more than threading ;)
0 x

jseah
Posts: 42
Joined: 10 Jun 2008, 03:28

Re: Attack area visualization widget

Post by jseah » 29 Jun 2013, 15:41

I made a similar widget, mine only works on 94.0+ though

http://www.mediafire.com/?6b2r5rxfu5brhw5

Similar work using new 94.0 TryTarget functions. Was not aware of this when I made it.

Pics:
http://i253.photobucket.com/albums/hh47 ... n00006.png
Last edited by jseah on 03 Jul 2013, 04:08, edited 3 times in total.
0 x

User avatar
PepeAmpere
Posts: 577
Joined: 03 Jun 2010, 01:28

Re: Attack area visualization widget

Post by PepeAmpere » 29 Jun 2013, 18:43

jseah wrote:ONLY WORKS ON SPRING 94.0+
Maybe you should specify, that YOUR widget works only with spring 94+, not a1983's work. Otherwise it can cause missunderstanding 8)
0 x

jseah
Posts: 42
Joined: 10 Jun 2008, 03:28

Re: Attack area visualization widget

Post by jseah » 03 Jul 2013, 04:07

PepeAmpere wrote:
jseah wrote:ONLY WORKS ON SPRING 94.0+
Maybe you should specify, that YOUR widget works only with spring 94+, not a1983's work. Otherwise it can cause missunderstanding 8)
Agreed, I have edited my post.
0 x

Post Reply

Return to “Lua Scripts”