Page 1 of 2

[Widget] Green Squares

Posted: 24 May 2010, 12:24
by Pressure Line
Well, I was playing around with teamplatters, when i thought "hmm, I've always thought it would be nice to have the green square that shows up when you select a unit be tied to the unit's rotation." (also, iirc TA did it like this too, so good for a bit of nostalgia value too.) so after a bit of experimenting (and some wtf's to do with fighters and bombers not returning a value for Spring.GetUnitHeading.) I give you gui_greensquares_v3.lua! It even works on non-square units so when you change the build facing it has the square appropriately aligned.

Image
Image
Image
Enjoy!

*edit* fixed a grammatical error and added the 3rd screenshot to first post

Re: [Widget] Green Squares

Posted: 24 May 2010, 12:58
by Das Bruce
Does the units non square base rotate in a meaningful sense? I remember they didn't but I'm not sure if this has changed.

Re: [Widget] Green Squares

Posted: 24 May 2010, 13:03
by Jazcash
It would be cool to get a customizable version of this with user customizable colours, line thickness or fill.

Re: [Widget] Green Squares

Posted: 24 May 2010, 13:07
by Pressure Line
Image

2 wide x 3 long footprint, so yeah, it works fine in terms of the widget display, although having mobile units with non-square footprints doesn't work all that well because as far as the engine is concened, the footprint doesnt rotate.

I wouldnt even know where to start on that Jaz.

Re: [Widget] Green Squares

Posted: 24 May 2010, 13:43
by hoijui
i though widgets are by nature user configurable.

but maybe he means, configurable through spring settings. i remember having seen a Lua function that lets you query a config value.

Re: [Widget] Green Squares

Posted: 24 May 2010, 15:43
by AF
A version of this which draws the squares of all structures when placing buildings would be nice, as well as team colours.

Re: [Widget] Green Squares

Posted: 24 May 2010, 18:12
by Jazcash
AF wrote:A version of this which draws the squares of all structures when placing buildings would be nice, as well as team colours.
On a completely irrelevant note, I just it would be nice if there was a widget/engine change which outlined all queued buildings to be built with a faint white outline so you can see what units are in queue to be built without holding shift on a unit or w/e.

Re: [Widget] Green Squares

Posted: 25 May 2010, 14:00
by zwzsg
Instead of green, I like it better when the selection square color is used to convey another information. TA:K had the right idea with health colored selections IMO.

Code: Select all

local health,maxHealth=Spring.GetUnitHealth(unitID)
gl.Color(
    health>maxHealth/2 and 2-2*health/maxHealth or 1, -- red
    health>maxHealth/2 and 1 or 2*health/maxHealth, -- green
    0, -- blue
    alpha) -- alpha

Re: [Widget] Green Squares

Posted: 25 May 2010, 16:08
by Gota
How many resources does this take with many units..

Re: [Widget] Green Squares

Posted: 25 May 2010, 18:54
by CarRepairer
zwzsg wrote:Instead of green, I like it better when the selection square color is used to convey another information. TA:K had the right idea with health colored selections IMO.

Code: Select all

local health,maxHealth=Spring.GetUnitHealth(unitID)
gl.Color(
    health>maxHealth/2 and 2-2*health/maxHealth or 1, -- red
    health>maxHealth/2 and 1 or 2*health/maxHealth, -- green
    0, -- blue
    alpha) -- alpha
Redundant, there are already health bars.

In CA, green is for your selected units, yellow for allied selected units, cyan for hovered unit.

Re: [Widget] Green Squares

Posted: 25 May 2010, 20:43
by KaiserJ
let me be the first to say : good fking job *thumbs up*

i like it

Re: [Widget] Green Squares

Posted: 26 May 2010, 08:20
by Pressure Line
Gota wrote:How many resources does this take with many units..
Less than teamplatters I'd imagine. I doubt you would even notice any extra slowdown.

Re: [Widget] Green Squares

Posted: 26 May 2010, 10:03
by zwzsg
CarRepairer wrote:Redundant, there are already health bars.
Healthbars are ugly, they are tiny billboarded rectangle floating over every unit breaking my feeling of immersion, so I gladly play without them given the chance.

Besides, the redundance would be to have the info spread two indicators where one combined indicator would suffice.

Re: [Widget] Green Squares

Posted: 26 May 2010, 14:19
by luckywaldo7
The color changing based on health sounds cool, although I think it means you cannot see the hp of enemy units D:

Next we need a selection thingy that looks more like other modern rts, with some nice gradients and maybe some animation pretty eye-candy stuff.



Not to downplay the nostalgia factor on this one of course, but while people happen to be looking at it :wink:

Re: [Widget] Green Squares

Posted: 26 May 2010, 15:42
by Gota
Pressure Line wrote:
Gota wrote:How many resources does this take with many units..
Less than teamplatters I'd imagine. I doubt you would even notice any extra slowdown.
Ima test it and if its ok I'll add it to next SA release.

Re: [Widget] Green Squares

Posted: 26 May 2010, 17:03
by CarRepairer
luckywaldo7 wrote:The color changing based on health sounds cool, although I think it means you cannot see the hp of enemy units D:
Not to mention ally units, and any of your own units that aren't selected at the moment.

Re: [Widget] Green Squares

Posted: 26 May 2010, 17:22
by zwzsg
The thing is, for allied, enemy, or others not selected units you only need a vague idea of their health, which can be conveyed just by the smoke lightness and cadence (or blood dripping, or missing limbs, or torn clothes, or cracked metal plate, ...). It's only for units that you are controlling now that you need an immediate feedback and more precise idea of how hurt they are. Because they are the only unit you can dance.

Anyway, this is probably my personal view of how games should be: A simulation where graphics represent gameplay, instead of pretty graphics unrelated to gameplay and that can be safely ignored, with a surimposition of bars, icons, numbers and charts to read what really matters.

Re: [Widget] Green Squares

Posted: 26 May 2010, 17:35
by JohannesH
gotta target those low hp enemies that you know you can kill with 1 shot, seeing enemy hp matters

But I like the idea of graphical effects instead of bars... But then it just should be for all units, and for all players.

Re: [Widget] Green Squares

Posted: 26 May 2010, 17:38
by luckywaldo7
I agree with Johannes, on a competitive level you would be gimping yourself, but if it was part of the game design consistent for every player it would work fine.

Actually I would be rather interested to see a game that used this.

Re: [Widget] Green Squares

Posted: 26 May 2010, 17:48
by Pxtl
zwzsg wrote:Anyway, this is probably my personal view of how games should be: A simulation where graphics represent gameplay, instead of pretty graphics unrelated to gameplay and that can be safely ignored, with a surimposition of bars, icons, numbers and charts to read what really matters.
There are times you need more precision than ambiguous visual cues can provide. Health is one of those. Sometimes you just need HUD information.

In a large-scale RTS with very no individually important units, you might be able to get away with that... but in most of the BA-family games where you have the Comm and your first fac and whatnot, knowing exactly how much health you've got left isn't optional.