Page 2 of 4

Re: TeamCircles

Posted: 26 Jul 2010, 22:07
by Jazcash
Very nice indeed. For an improvement, you could add user-friendly customisation controls. Maybe just some simple things like two sliders for adjusting radius or glow thickness of the circles.

My main query though before I start using this is, is it more or less CPU intensive than Team Platters? Because I know for a fact that turning Team Platters on drastically reduces my FPS.

Re: TeamCircles

Posted: 26 Jul 2010, 23:37
by Lelousius
Atfirst it used about twice as much as teamplatter.. but with the latest fix Team Circles use a little less than teamplatter

But note: as more units as more resources/cpu-time needed
Ok .. if you think the first version is visually fine .. i could apply that speed patch for you and send it to you

To Radar / Jammer :
Radar cannot look through hills, but those circles would pretend to do
For Jammers it might be fine .. but idk, as i do not use them often

Re: TeamCircles

Posted: 27 Jul 2010, 00:24
by Jazcash
Lelousius wrote:Atfirst it used about twice as much as teamplatter.. but with the latest fix Team Circles use a little less than teamplatter

But note: as more units as more resources/cpu-time needed
Ok .. if you think the first version is visually fine .. i could apply that speed patch for you and send it to you
Don't send anything personally, I'm sure there would be more people like me wanting a nice widget that allows easy eye verification of units whilst not damaging FPS too much. Public is profitable, privacy is pitiful.

Re: TeamCircles

Posted: 27 Jul 2010, 02:20
by aegis
speed improvements

Re: TeamCircles

Posted: 27 Jul 2010, 05:39
by aegis
fixed a bug where selection circles would halo around other nearby units
unit_circle_0.42.lua
(12.08 KiB) Downloaded 113 times
and optimized opengl slightly but didn't get the bubble behavior working completely yet, so selection circles overlap (inner circles still don't overlap)
unit_circle_0.43_overlap.lua
(10.7 KiB) Downloaded 119 times
0.42 is about 1.5x faster than 0.4, while 0.43 is about 3x faster (based on profiler data)

Re: TeamCircles

Posted: 27 Jul 2010, 13:24
by Lelousius
Hey you are cool :)

And you removed heading and degrot hmm .. ok .. it is not really needed, but it is nice for planes

Hmm .. could this be optimised too?
udid = spGetUnitDefID(unitID)
=>
udids[unitID] = spGetUnitDefID(unitID)
and use "udids[unitID]" everywhere udid is used?

Ps: It took a while for me to understand your optimised code :)
unit_circle_0.4.4.lua
(11.2 KiB) Downloaded 116 times
Changes
- Protected selected untis form having an selection circle in them

But not protected circles form being drawn twice (Alpha needs to be set 1 or 0 depending on what you draw (circles or "selected"-circle) but that needs some extra seps in opengl slowing the widget down

Stepcounts
0.4.....10
0.4.3...6
0.4.4...7

Re: TeamCircles

Posted: 27 Jul 2010, 15:03
by aegis
oh cool you added comments this time - took me like 45 minutes to figure out what each step of your rendering did the first time I looked ;)

Re: TeamCircles

Posted: 27 Jul 2010, 18:01
by manolo_
a lot of work, but all versions are on SD ;)

Re: TeamCircles

Posted: 27 Jul 2010, 18:34
by Lelousius
Fixed overlapping & bubble-effect
even improved speed a little
unit_circle_0.5.0.lua
(11.92 KiB) Downloaded 116 times
Details:
- kicked out 2 per-unit-loops (Clear-loop / Draw-selected Loop)
- replaced the Cycles per team by only one (wich draws the Alpha)
-> The color is now drawn by a large cycle without a hole in the middle


Hmm .. if you don't mind.. could you replave the screenshot by this one? it is more representative :)
Image
http://www.bilderkiste.org/show/origina ... SPRING.png

Re: TeamCircles

Posted: 27 Jul 2010, 19:28
by aegis
added a platter highlight for unit under mouse cursor

have you tried this widget on a snow map like xenolithic or nuclear winter? we need to fix that ^^

Re: TeamCircles

Posted: 27 Jul 2010, 20:21
by aegis
reduced load on update() when no units are selected, made selected units have a white platter, changed hover highlight to white

Re: TeamCircles

Posted: 27 Jul 2010, 20:59
by Lelousius
Now we have a spotlight for units ^^

hmm .. idk what to do about bright / snow maps
.. we might use black instead of white
but that would not fit all the other maps, and would not fit the dark spots on Blindside and nuclear_winter
Any color would lead to be misinterpreted

Actually I am very happy of what we managed to code :)

(We should get some cool screenshots presenting this, so everyone gets addicted to it ^^)

Re: TeamCircles

Posted: 27 Jul 2010, 22:01
by aegis
one of my test versions used a larger circle of the samecolor and it was easy to spot. I dunno if pure black would be too dark on anything but speedball water and asteroid maps

oh and while the circles look great on units, I think it's weird on some buildings... like I built an aircraft plant and it felt a little awkward having a huge blue circle around it.

Re: TeamCircles

Posted: 27 Jul 2010, 22:42
by CarRepairer
If you care to show ally selected units as well with an alternate highlight graphic, see lines 258-290 in here:
http://trac.caspring.org/browser/trunk/ ... ircle2.lua

It will show you the selected units of allies who have this widget:
http://trac.caspring.org/browser/trunk/ ... onsend.lua

Re: TeamCircles

Posted: 27 Jul 2010, 23:12
by aegis
couldn't the engine just have an onselected callin for allied teams?

Re: TeamCircles

Posted: 27 Jul 2010, 23:25
by CarRepairer
aegis wrote:couldn't the engine just have an onselected callin for allied teams?
If you created such a patch and obsoleted my selectionsend widget, I'd be perfectly fine with it.

Re: TeamCircles

Posted: 28 Jul 2010, 01:51
by Jazcash
I'm using this instead of teamplatters now. Much nicer. My only complaint is that hover brightness is too bright.

Re: TeamCircles

Posted: 28 Jul 2010, 02:39
by aegis
I made it brighter because I thought it was too dark -_-

how's hover brightness in the version before?

Re: TeamCircles

Posted: 30 Jul 2010, 19:51
by SkyStar
aegis' version appears to have trouble handling certain maps:

Code: Select all

[   6440] Error in Initialize(): [string "LuaUI\Widgets\unit_circle_0.5.2.lua"]:211: attempt to index field '?' (a nil value)
[   6440] Removed widget: Unit-Circles 0.5.1
changing line 210 from:

Code: Select all

for udid=1, #UnitDs do
to:

Code: Select all

 for udid,unitDef in pairs(UnitDs) do
fixes it.

Re: TeamCircles

Posted: 30 Jul 2010, 20:19
by aegis
oh fun, you can skip unit ids. that loop only runs once so I guess it doesn't need the performance improvement :)

I'll upload my latest version with your change in a bit (thanks)

partial changelog:
  • applied the above fix
  • reduced highlight brightness by half
  • plays better with other opengl code by using push/popattrib
  • uses GetVisibleUnits instead of GetAllUnits (though there's not much of a speed difference)
working on something cool for it before I upload