TeamCircles - Page 2

TeamCircles

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

Moderator: Moderators

User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: TeamCircles

Post 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.
Lelousius
Posts: 11
Joined: 22 Jul 2010, 19:37

Re: TeamCircles

Post 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
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: TeamCircles

Post 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.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: TeamCircles

Post by aegis »

speed improvements
Attachments
unit_circle_0.41.lua
(12.08 KiB) Downloaded 21 times
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: TeamCircles

Post 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)
Lelousius
Posts: 11
Joined: 22 Jul 2010, 19:37

Re: TeamCircles

Post 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
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: TeamCircles

Post 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 ;)
User avatar
manolo_
Posts: 1370
Joined: 01 Jul 2008, 00:08

Re: TeamCircles

Post by manolo_ »

a lot of work, but all versions are on SD ;)
Lelousius
Posts: 11
Joined: 22 Jul 2010, 19:37

Re: TeamCircles

Post 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
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: TeamCircles

Post 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 ^^
Attachments
unit_circle_0.5.1.lua
(12.68 KiB) Downloaded 112 times
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: TeamCircles

Post by aegis »

reduced load on update() when no units are selected, made selected units have a white platter, changed hover highlight to white
Attachments
unit_circle_0.5.2.lua
(13.48 KiB) Downloaded 132 times
Lelousius
Posts: 11
Joined: 22 Jul 2010, 19:37

Re: TeamCircles

Post 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 ^^)
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: TeamCircles

Post 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.
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: TeamCircles

Post 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
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: TeamCircles

Post by aegis »

couldn't the engine just have an onselected callin for allied teams?
User avatar
CarRepairer
Cursed Zero-K Developer
Posts: 3359
Joined: 07 Nov 2007, 21:48

Re: TeamCircles

Post 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.
User avatar
Jazcash
Posts: 5309
Joined: 08 Dec 2007, 17:39

Re: TeamCircles

Post by Jazcash »

I'm using this instead of teamplatters now. Much nicer. My only complaint is that hover brightness is too bright.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: TeamCircles

Post by aegis »

I made it brighter because I thought it was too dark -_-

how's hover brightness in the version before?
SkyStar
Engines Of War Developer
Posts: 23
Joined: 08 Jul 2009, 15:05

Re: TeamCircles

Post 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.
User avatar
aegis
Posts: 2456
Joined: 11 Jul 2007, 17:47

Re: TeamCircles

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

Return to “Lua Scripts”