Latest Posts

Topic: Player Color Adjustment

chuckw
Avatar
Topic Opener
Joined: 2010-03-15, 16:23
Posts: 945
Ranking
One Elder of Players
Location: New York - USA
Posted at: 2011-09-23, 22:16

I realize that for being the "Elder of Graphics" I come across as rather un-technical and even un-knowledgeable regarding the mechanics of HOW the game engine renders the graphic files we graphicians produce. That is why I pose my questions the way I do. In my defense, I can only argue that the smelter doesn't need to know ALL about the blacksmith's trade in order to produce usable metal. (Hmmm, Maybe I HAVE been working with the barbarians too long!) face-grin.png

At any rate, I offer my apologies to the technicians if I am questioning things of which I SHOULD be aware. I have to admit that it is rather fun poking in the code, but I'll never be able to converse in THAT language. face-smile.png


I see little people.

Top Quote
Astuur
Avatar
Joined: 2009-02-28, 10:08
Posts: 733
Ranking
One Elder of Players
Location: Frankfurt / Germany
Posted at: 2011-09-24, 06:48

I admire your bravery (and obvious competence), Chuck!
I think this color change adds a lot to make the fabric look more real, doesn't it?
It is indeed what I had in mind.
Now let the regulars speak and tell us if they'd also support such a change.


Being no programmer, I apologize for all my suggestions that imply undue workload and for other misjudgements due to lack of expertise or relevant skills.
I am on Win32, have no means to compile, and rely on prefabricated distributions (Thanks to Tino).

Top Quote
SirVer

Joined: 2009-02-19, 15:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2011-09-24, 13:21

You put myself to shame... I am a coder and SHOULD know how the PlayerColor stuff works, but I do not remember the gory details. I will inquire and write again.


Top Quote
SirVer

Joined: 2009-02-19, 15:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2011-09-24, 14:45

Alrighty, I have news now: From the values in g_playercolors, only the following were used:

index 3 for chat, statistics menu, minimap and animation coloring index 2 for soldier health bars.

I will rework this so that index 3 is used for all colors and the other colors will be removed. If it turns out that soldier health bars are too dark then, I will readd a color entry specially for this.


Top Quote
chuckw
Avatar
Topic Opener
Joined: 2010-03-15, 16:23
Posts: 945
Ranking
One Elder of Players
Location: New York - USA
Posted at: 2011-09-24, 14:57

@SirVer: No shame intended. It is not like there are just a handful of components, features and nuances in Widelands to keep track of.

I'm just after the answers that will help the graphicians do a better and smarter job in maintaining the current graphics, and developing new graphics for the game. I deeply admire and appreciate anyone who can interpret all that C++ language, let alone create it! I think it was Archimedes who once said, "It's all Greek to me!" (or maybe it was someone else...) face-smile.png

Thanks for the help.


I see little people.

Top Quote
chuckw
Avatar
Topic Opener
Joined: 2010-03-15, 16:23
Posts: 945
Ranking
One Elder of Players
Location: New York - USA
Posted at: 2011-09-24, 16:37

Astuur wrote: Chuck, don't you think that the variations of "blue" that you discovered might simply be the different shades used in the game? I don't think WL really supports 4 times 8 players. The Player Color is not one color, but gets modified. You can best see this with the flags.

In my defense, the occurrence of "const uint8_t g_playercolors[MAX_PLAYERS][12]" gave me the impression that, here at least, up to 12 players was supported. In that event, I reasoned that an iterative approach (like an array) to assigning the RGB values was being used. Edit - (It just occurred to me that the [12] probably indicates the length of the constant. "MAX_PLAYERS" is likely a variable that gets defined elsewhere and here helps set the dimensions of the array.)
Such is the peril of taking anything, especially program code, out of context (and letting a graphics guy poke his nose in the code in the first place). face-smile.png

We have learned now from SirVer that the old PlayerColor logic which required multiple hues to be defined for each PlayerColor was at one time also controlled in this area of the code, but the new PlayerColor logic uses only a subset of the the values currently displayed. The process of rendering shades is handled more expertly elsewhere.

If I may sum up:

  • The various PlayerColors are defined in the editor_game_base.cc source code file
  • There is currently a maximum of 8 distinct playercolors, each define by its RGB values.
  • Shading of the PlayerColors in the game engine is handled dynamically without the need to specify particular hues.
  • SirVer will implement a change to eliminate the now obsolete and unused code which will reduce the RGB entries to one hue per player number which will be used throughout the game. A second entry for the Soldier Health bar may be implemented later if a hue other than the general playercolor for a player number is deemed desirable.

Does that cover it?

Edited: 2011-09-24, 16:50

I see little people.

Top Quote
SirVer

Joined: 2009-02-19, 15:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2011-09-24, 19:19

precisely.


Top Quote
SirVer

Joined: 2009-02-19, 15:18
Posts: 1445
Ranking
One Elder of Players
Location: Germany - Munich
Posted at: 2011-09-24, 22:43

Note: I have pushed the changes in r5990. The colors are now defined in logic/player.cc.


Top Quote
Astuur
Avatar
Joined: 2009-02-28, 10:08
Posts: 733
Ranking
One Elder of Players
Location: Frankfurt / Germany
Posted at: 2011-09-25, 19:01

Nice -- even I can understand that, when Chuck translates face-grin.png


Being no programmer, I apologize for all my suggestions that imply undue workload and for other misjudgements due to lack of expertise or relevant skills.
I am on Win32, have no means to compile, and rely on prefabricated distributions (Thanks to Tino).

Top Quote
chuckw
Avatar
Topic Opener
Joined: 2010-03-15, 16:23
Posts: 945
Ranking
One Elder of Players
Location: New York - USA
Posted at: 2012-05-11, 17:08

Well, it has certainly taken me long enough to address this issue, more specifically Bug #732142 which sprang from this discussion.

In that bug report, Astuur requested the consideration of a lighter shade of blue to be used as the player color for Player #1. His reason is that the current shade is difficult to distinguish from black in the soldiers' health bar.

Earlier in this thread, Astuur suggested an RGB value of 66,73,254 (displayed here along with all of the current values): newblue

Here is a comparison between the current shade and this new proposal:
orig
new

I am amenable to using the shade Astuur has proposed.

Comments, questions, suggestions? face-smile.png


I see little people.

Top Quote