Active Object Colour Replacement?

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I have a character with many animation frames, and I want to be able to change the colour of various parts of her uniform at runtime. There are too many possible colour combinations to do this with new animations, given the high number of frames to begin with.

    I've been playing around with Animation --> Replace Color within Fast Loops, but I can only get this to work for about half of the various shades of colour in the article of clothing, at best.

    I can't use different objects for the character and clothing because they don't always seem to stay in sync (Always --> Set Position To...) so when one object's position lags behind by a couple of pixels, you can clearly see that it's two objects.

    Does anybody know of an effective way that I could recolor the pixels within a particular RGB range, or palette swap an Active Object? Or maybe there's another way that I'm missing?

    .: Nuclear Powered Games :.
    coming soon...

  • The only way I've been able to do it is to manually replace each color one at a time. Also and you may have noticed already but there's a slight pause that happens when you replace colors within an active. If you replace the colors upon the start of frame that might be helpful and make the pause less noticible.

    Sorry man, I don't think there's an easier way to do it at least not that I've seen yet.

    Weebish Mines, my retro Metroidvania!
    Please login to see this link.

  • I've been replacing them one at a time, but within a Fast Loop reading from an Array file containing a list of individual RGB values taken from the image. There is indeed a pause when you use the Replace Color function. When my loop goes through 256 colour replacements, it pauses the game for about 20 seconds - and the image has much greater than 256 colour depth :(

    I'm guessing this leaves me in need of a palette swap method, or some kind of a filter I could hang over the active, if it wasn't going to slow things down too much...

    .: Nuclear Powered Games :.
    coming soon...

  • Well the trouble with achieving different color combinations through different animations is that I want to have different parts of the Active Object color changeable by the user. Sort of like how a Sims player can customise the appearance of their character(s) - although I'm not aiming for anywhere near that extent of customisation.

    Let's say conservatively I have 4 options for hair color, 4 options for clothing color one, and 4 options for clothing color two. That would require me to produce 64 versions of every single animation, to include all possible chosen color combinations. The time factor and the resulting file size would make this an unworkable option, not to mention the risk of a cardiac arrest if I had to go back and revise any animations.

    Alternatively, I could create a single version of each animation and then find a way to manipulate the image, say with a palette swap, some kind of filter or after effect.

    .: Nuclear Powered Games :.
    coming soon...

  • Well the trouble with achieving different color combinations through different animations is that I want to have different parts of the Active Object color changeable by the user. Sort of like how a Sims player can customise the appearance of their character(s) - although I'm not aiming for anywhere near that extent of customisation.

    Let's say conservatively I have 4 options for hair color, 4 options for clothing color one, and 4 options for clothing color two. That would require me to produce 64 versions of every single animation, to include all possible chosen color combinations. The time factor and the resulting file size would make this an unworkable option, not to mention the risk of a cardiac arrest if I had to go back and revise any animations.

    Alternatively, I could create a single version of each animation and then find a way to manipulate the image, say with a palette swap, some kind of filter or after effect.

    Let's not kill this guy, Marv, that's a lot of animations!

    Colonial Settler: Maybe the best way to do it is to have your different color possibilities tied to global values and then do a single group of events upon frame start to change those colors all at once after all. For example if you want to do a Sims-type of deal than the player will most likely not be able to change their hair or skin color much after character creation (I assume). Then depending on whatever the global's value is you'd replace the color that one time per frame only and the pause could be considered part of the "level loading.." splash screen or whathaveyou.

    Ex. Player chooses Green hair where HAIRCOLOR 1 = black, 2 = brown, and 3 = green. White is the default or something.

    Start of Frame
    + HAIRCOLOR = 1
    -> Replace color of "Player Character" (255,255,255) with (0,0,1)

    Start of Frame
    + HAIRCOLOR = 2
    -> Replace color of "Player Character" (255,255,255) with (128,64,0)

    Start of Frame
    + HAIRCOLOR = 3
    -> Replace color of "Player Character" (255,255,255) with (0,255,0)

    *NOTE- The black here's 0,0,1 because MMF has that true black thing as default transparency.

    In the past I've used the color replacer at runtimes other than frame load but only when there's very few colors to be replaced. A good example is when one of my characters in a game got diseased their skin would turn greenish-blue for a short time and then change back to normal after the disease wore off. There was still a pause, but it was hardly noticible because I only had to change 2 or 3 colors total.

    Weebish Mines, my retro Metroidvania!
    Please login to see this link.

  • If this is strictly for PC... you could use shaders and just change the color that way.

    Please login to see this link.

    My examples:
    Please login to see this link.
    Please login to see this link.
    Please login to see this link.

  • Del_Duio: The big problem is, the character is a rendered image so the hair, clothes etc aren't a single RGB color. It would be really simple if it was, but it's an image with 24 bit color depth, so there's a few thousand colors. I've been playing around with algorithms and tricks to change pixels of various RGB values, but so far unable to find a workable method to change them all (so many different pixels with different RGB values to account for). It would be easier if I dropped the color depth of my character to 256 colors, but that does degrade the quality somewhat.

    Konidas: It is planned strictly for PC at this stage. Do you know of any way to change the color of specific parts of an active object using shaders?

    .: Nuclear Powered Games :.
    coming soon...

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!