MegaGlest Forum

Archives (read only) => Glest Advanced Engine => General discussion => Topic started by: silnarm on 13 July 2011, 13:28:31

Title: Re: alternative ways to show teamcolor
Post by: silnarm on 13 July 2011, 13:28:31
I personally thought the outline idea seemed best, how does that circle look with selection circles as well?

I did outlines (could use some tweaking yet),
(click to show/hide)

A 'tint' (suggested after a bug in a shader that was doing basically this to some people randomly),
(click to show/hide)

and will allow both as an option,
(click to show/hide)

Commit:a05e3904 (http://glestae.git.sourceforge.net/git/gitweb.cgi?p=glestae/glestae;a=commit;h=a05e39041d10504c6d4e846bdee88b128de22bf0)
Title: Re: Re: alternative ways to show teamcolor
Post by: Omega on 13 July 2011, 18:24:42
I must say Silnarm, I think that looks the best, hands down. I'm assuming they will be toggleable, what hotkey will be used by default (keymap.ini will have an entry, I assume)? At either rate, they look fantastic.
Title: Re: Re: alternative ways to show teamcolor
Post by: ultifd on 13 July 2011, 19:44:37
Hmm...After some tweaking the outlines could be also good, but I think the other way is more clean. Still, nice.
Title: Re: Re: alternative ways to show teamcolor
Post by: John.d.h on 13 July 2011, 20:53:31
Could the outline be just around the silhouette of the unit?  It looks a little cluttered being around all of its edges.
Title: Re: Re: alternative ways to show teamcolor
Post by: silnarm on 14 July 2011, 03:32:45
Apologies MG ppl... someone with the power to do so may want to shift the last few posts to the GAE board, I initially posted here to show what I had done and provide a link to the changeset if it was of interest.

I'm assuming they will be toggleable, what hotkey will be used by default (keymap.ini will have an entry, I assume)? At either rate, they look fantastic.

There is currently a keymap entry (default is semi-colon) to toggle 'team colour mode' (but atm it cycles through the different effects), and there will be a config option to select which effect you want to use for it (there is a keymap widget now too, needs a little polish, but you'll be able to change hotkeys in-game soon).

Could the outline be just around the silhouette of the unit?  It looks a little cluttered being around all of its edges.

It's currently outlining edges that have one front facing and one back facing polygon, I agree that it does get a bit cluttered, but fixing it will require disabling writing depth values while drawing the outline, and that will cause other problems as things are done now. The way we draw things (or rather, the order in which we draw things) will need overhauling, which will be good to do for performance reasons, so it will happen, but its a reasonably big job, so we'll have to make do with this for now  :(
Title: Re: alternative ways to show teamcolor
Post by: silnarm on 20 July 2011, 13:28:49
I was perusing my bookmarks earlier and discovered this entry,

flipcode - Object Outlining (http://www.flipcode.com/archives/Object_Outlining.shtml)

Uses the stencil buffer (so no need to mess with the depth buffer), too easy,
(http://i687.photobucket.com/albums/vv231/silnarm/glest/outlining.jpg)
Title: Re: alternative ways to show teamcolor
Post by: will on 20 July 2011, 14:52:39
Thx for the link :)
Title: Re: alternative ways to show teamcolor
Post by: Omega on 20 July 2011, 20:28:39
Looks excellent silnarm! That was exactly what I was thinking of when I thought of outlines.
Title: Re: alternative ways to show teamcolor
Post by: Psychedelic_hands on 21 July 2011, 07:24:57
Woah, thats nice!  :thumbup: Thanks man.
So what hot-key will be used to show this?

What about having this as a particle effect? I could see a pretty cool mutant godzilla scenario coming out of this haha.
Title: Re: alternative ways to show teamcolor
Post by: Omega on 21 July 2011, 19:51:43
What about having this as a particle effect? I could see a pretty cool mutant godzilla scenario coming out of this haha.
That would actually be interesting, provided modders can create it as a "per techtree" thing. Since unit particles have a teamcolor attribute that can be used. Only disadvantage is that there's no way to have the radius be a perfect size for the unit, as well, it may not blend well with existing particles.

Overall, I prefer the outline, though I'm not against the implementation of particles.
Title: Re: alternative ways to show teamcolor
Post by: will on 21 July 2011, 20:43:51
In MG I added "<shape>" attribute so you don't have to have unit particles spawning inside a circle.

That tag could be adopted and used to specify a new shape such as 'outline' where the spawned particles occurred randomly on an edge shared by a forwards and a backwards facing face of a single-sided mesh?  Possibly snapping to nearest such edge if the model rotates?

Other fun shapes to consider would be "flock" ("boid") and such, but that's going off topic...
Title: Re: alternative ways to show teamcolor
Post by: Omega on 22 July 2011, 06:25:49
In MG I added "<shape>" attribute so you don't have to have unit particles spawning inside a circle.
Totally off topic, but could you PM me the syntax or a link to where the syntax would be, as I'm nearly certain that tag isn't documented on the wiki, as I must have missed it.

[/b]
That tag could be adopted and used to specify a new shape such as 'outline' where the spawned particles occurred randomly on an edge shared by a forwards and a backwards facing face of a single-sided mesh?  Possibly snapping to nearest such edge if the model rotates?
That actually sounds really cool. So basically a shape that will be the same shape as the model's base?
Title: Re: alternative ways to show teamcolor
Post by: Psychedelic_hands on 22 July 2011, 14:25:22
What about having this as a particle effect? I could see a pretty cool mutant godzilla scenario coming out of this haha.
That would actually be interesting, provided modders can create it as a "per techtree" thing. Since unit particles have a teamcolor attribute that can be used. Only disadvantage is that there's no way to have the radius be a perfect size for the unit, as well, it may not blend well with existing particles.

Overall, I prefer the outline, though I'm not against the implementation of particles.

Wait, so this effect isn't particles.... Sorry, maybe I was too busy looking at dem purrdy pictures instead of reading the thread  :-[.
Sooooo, what sort of effects are these? Is it the same sorta thing as the move target arrow and such?  :confused:
Title: Re: alternative ways to show teamcolor
Post by: Omega on 22 July 2011, 19:59:02
What about having this as a particle effect? I could see a pretty cool mutant godzilla scenario coming out of this haha.
That would actually be interesting, provided modders can create it as a "per techtree" thing. Since unit particles have a teamcolor attribute that can be used. Only disadvantage is that there's no way to have the radius be a perfect size for the unit, as well, it may not blend well with existing particles.

Overall, I prefer the outline, though I'm not against the implementation of particles.

Wait, so this effect isn't particles.... Sorry, maybe I was too busy looking at dem purrdy pictures instead of reading the thread  :-[.
Sooooo, what sort of effects are these? Is it the same sorta thing as the move target arrow and such?  :confused:
If I understand correctly, it's particles in a certain shape. Normally, particles are a circle, but suppose you could have them in a shape that specifically fits the unit? Though, it is kind of offtopic, and GAE does not yet support some of MG's new particle features (Feature Request (https://forum.megaglest.org/index.php?topic=7252.0)).
Title: Re: alternative ways to show teamcolor
Post by: Yggdrasil on 23 July 2011, 15:56:19
Are you talking about the outline effect? That's just a special way to render the unit, no particles. The first ones are shaders.

The second picture in the first post reminds me about a feature in other RTS-games. When units are hidden behind buildings or trees, they are drawn just in full team color. That way they don't get lost.
Title: Re: alternative ways to show teamcolor
Post by: Omega on 24 July 2011, 05:01:09
Are you talking about the outline effect? That's just a special way to render the unit, no particles. The first ones are shaders.
No, we're talking about the possibility of yet another way to display team color: with particle systems. The shape concept is a way to make the particle systems be restrained to a shape, such as the shape of the unit.

The second picture in the first post reminds me about a feature in other RTS-games. When units are hidden behind buildings or trees, they are drawn just in full team color. That way they don't get lost.
Yeah, AoE2 had that, and it was very helpful.
Title: Re: alternative ways to show teamcolor
Post by: Psychedelic_hands on 24 July 2011, 08:17:54
The second picture in the first post reminds me about a feature in other RTS-games. When units are hidden behind buildings or trees, they are drawn just in full team color. That way they don't get lost.
Yeah, AoE2 had that, and it was very helpful.

I think Wildfire added that feature to 0A.D in alpha 5. Maybe we can ask Phillip how they did it?
http://www.youtube.com/watch?v=zbKKlW7PYyk
Title: Re: alternative ways to show teamcolor
Post by: Philip on 24 July 2011, 19:58:58
Maybe we can ask Phillip how they did it?
See code (http://trac.wildfiregames.com/browser/ps/trunk/source/renderer/Renderer.cpp?rev=9847#L1354) - draw the world as normal, then clear the depth buffer, then draw occluders (terrain, buildings) to depth buffer, then flip the depth test (so only things behind those occluders will get drawn), then draw the units with a solid colour (and if the silhouettes should be partially transparent then enable blending and use the stencil buffer so each pixel only gets drawn once). As an optimisation (which we don't do yet), use some quick ray-casting to only bother drawing units whose bounding box is behind an occluder.
Title: Re: alternative ways to show teamcolor
Post by: Yggdrasil on 29 July 2011, 07:52:15
Thank you very much for this insightful post. Sorry for the late reply. Looks like we all are very busy at the moment. Let's see when we get around to add this.