Mod ideas

Discussion in 'Mod Discussions' started by trialq, January 28, 2014.

  1. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    Last edited: September 28, 2014
  2. Fr33Lancer

    Fr33Lancer Well-Known Member

    Messages:
    595
    Likes Received:
    288
    Got a request in private (@Prezombie ), not sure it's reasonably doable :

    Technically, it is possible.
    It's not based on shaders modification though, as it's not ingame.
    It would imply modifying the commanders images located under "media\ui\main\shared\img\commanders".
    Quick maths :
    24 images * [9 colors (main) * 2 possibilities (secondary)] = 432
    If you add black and white having 5 possibilities as secondary color (24*2*5=240), it's 672.
    On top of that, some basic logic needs to be implemented to override the stock image with the good one.

    Keeping in mind they will add new commanders after each update, this mod idea seems unrealistic.
    Even with some image processing software that would do the job automatically, I'm not sure it would be possible.
  3. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    It could probably be done with canvas, though not perhaps without color identification errors.

    Possibly also with the masking technique used for commander icons.

    Slightly more brute force, doing the primary and secondary colors in separate layers would cut down the number of images considerably.
    Fr33Lancer likes this.
  4. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    Oh, of course it is possible. It's as simple as using the intermediate results from the render process. Store the color channel from team color textures separately, perform color mapping, and the recombine. Requires a small number of additional pictures per commander, just what you would need for classic deferred rendering. Final composition is possible using basic canvas.
    Fr33Lancer likes this.
  5. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Why all that complicated stuff? Why not just make a white base image for every commander and then use js to color it?
  6. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    Because it isn't simple at all to color something. You need a separate map which contains precise information which color was to be applied to which pixel. That map however can't contain information about lighting or anything else, since the color channels are already at full capacity.

    You have no other choice than to ship intermediate buffers, transform these according to player colors, and perform the lighting pass manually on the client. Or just render the commanders model right away.
    Fr33Lancer likes this.
  7. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    There is no render, we are talking about these images:
    [​IMG]
    The files are in: \media\ui\main\shared\img\commanders
    You'd have to edit the files by hand in some image editing tool to replace the blue parts (or whatever else parts you want) with gray shadings (Though I think that might be scriptable if it is all blue -> white). Then have js recolor them. I am not sure how to determine best where to apply color. My first idea would be to create a 2nd image for every commander from the image editing that has black pixles on the exact positions that need to be colored.
    But dunno, somebody well versed with image editing probably could come up with something better.

    Though that's still a bit of work just for those few seconds this is visible.
    Last edited: September 27, 2014
  8. Fr33Lancer

    Fr33Lancer Well-Known Member

    Messages:
    595
    Likes Received:
    288
    I like the fact that given my patent lack of knowledge regarding images editing, you all came up with potential solutions :)

    My thought exactly.

    If anyone is up to the challenge, go ahead ;)
  9. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Thinking more it might even be possible to write some js that converts all "blue" pixels into the respective teamcolors directly.
    The images all seem to use blue only for the teamcolor. So just replace all blue pixles with the target color using the same brightness
  10. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    That's not how it works. Trust me, I tried to cheat around a very similar issue about 3 years ago.

    You can neither extract the team colors that easily, nor can you replace them directly. You have no other choice but to recompute the lighting process with the new teamcolors.
  11. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    And all those people who only edit images that are not even rendered can never ever recolor images?
    ... no photoshop proves that wrong?
  12. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Not true; hueshifting is a wonderful thing (and CSS has a hueshift filter you can use on images, making this a good option for an in-game solution). You just need to isolate the areas that contain the team color, which can be done easily enough, although it's time consuming. Here's the result for the Raptor Centurion.

    Original:

    img_raptor_centurion.png

    Team Colour areas:

    img_raptor_centurion_team_colour.png

    Team Colour areas hueshifted:

    img_raptor_centurion_team_colour_green.png

    Re-combined over original image:
    img_raptor_centurion_green.png

    Edit: scaled down images

    Because hueshift doesn't affect greys, it doesn't matter that there are different levels of blue involved. You could even isolate everything except for the team colour and greys, if that was easier (it probably would have been for this image :p). Here's the original picture with the same hueshift applied over the whole image:
    img_raptor_centurion_hueshift.png
    Last edited: September 27, 2014
  13. exterminans

    exterminans Post Master General

    Messages:
    1,881
    Likes Received:
    986
    Yes, but this is a special case. Because you were able to clearly isolate the team color areas from every other colored area. There was no color bleeding, no mixed areas, no immediate overlaps between 3rd color light sources with team colors, no transparent objects or visible aliased edges. Plus you only shifted hue, but neither saturation nor brightness.

    It only works when these conditions are all met, otherwise it produces artifacts.
  14. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Good thing we are not looking for a completely general solution, but just for a solution to recolor 10-20 given png files that all are pretty similar. A completely general solution probably is much harder, you are probably right about that.
  15. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
  16. Prezombie

    Prezombie New Member

    Messages:
    21
    Likes Received:
    9
    The commander sighted alert popup says the type of commander, wouldn't it make more sense to say the name of the player instead?
  17. wondible

    wondible Post Master General

    Messages:
    3,315
    Likes Received:
    2,089
    You might be able to say the name of the team, which will be the same as the player excepting shared armies. Shared armies could make for a very long message, so perhaps it would need to have names for the known colors.
  18. Prezombie

    Prezombie New Member

    Messages:
    21
    Likes Received:
    9
    Good point. Could the hypothetical mod tell the difference between a team with shared armies and one without, and use the name for unshared, and the color for shared?
  19. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Yes
    thetrophysystem and reptarking like this.
  20. stuart98

    stuart98 Post Master General

    Messages:
    6,009
    Likes Received:
    3,888
    @Fr33Lancer Would you consider making a mod that replaces the primary of uber cannon equipped coms with something that resembles a smaller, shorter uber cannon? As you know, I'm on a quest to rid the game of boring yellow projectiles and I have yet to come up with something that makes sense.
    Colored like your uber cannon color mod pl0x!

Share This Page