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 »

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 43 times
AttackRange2.jpg
(222.19 KiB) Downloaded 6 times
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Attack area visualization widget

Post by smoth »

neat!
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: Attack area visualization widget

Post by Jools »

What is that interface you have? It looks very nice. Especially the build menu.
User avatar
danil_kalina
Posts: 505
Joined: 08 Feb 2010, 22:21

Re: Attack area visualization widget

Post by danil_kalina »

Can Lua calculate some stuf in other thread and return result by callback when it is done ?
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Attack area visualization widget

Post by jK »

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
a1983
Posts: 55
Joined: 02 Dec 2009, 12:01

Re: Attack area visualization widget

Post by a1983 »

Thx, JK. Waiting for 92 version then :)
el_matarife
Posts: 933
Joined: 27 Feb 2006, 02:04

Re: Attack area visualization widget

Post by el_matarife »

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.
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Attack area visualization widget

Post by jK »

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 ;)
jseah
Posts: 42
Joined: 10 Jun 2008, 03:28

Re: Attack area visualization widget

Post by jseah »

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.
User avatar
PepeAmpere
Posts: 589
Joined: 03 Jun 2010, 01:28

Re: Attack area visualization widget

Post by PepeAmpere »

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)
jseah
Posts: 42
Joined: 10 Jun 2008, 03:28

Re: Attack area visualization widget

Post by jseah »

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.
Post Reply

Return to “Lua Scripts”