0 Favourites

Color swap issues

  • Hello,

    In my game (for desktop, not mobile devices), I want to use the "replace color" effect to change the color of my character's clothes, decorative elements, etc...

    I ran a few tests and it works quite well, but I have a some questions :

    • I use 25% tolerance with this effect to change the color I want and the shadows for this color (basically it is the same color with a black form with 20% opacity on top of it in Inkscape). It works most of the time without impacting other colors, but for some colors the color is changed but not the shadows for this color, so I was wondering how does Construct 2 determine that a color is close or not according to tolerance ?
    • Furthermore, and that may be the real issue here, I wanted to use this effect a lot in my project to avoid creating new sprites, but is it a good idea ? I mean I don't want too much effects to damage the performances of the game, or getting a suspicious-looking display on some computers because the effect is not supported... Is it better to create new sprites everytime at the risk of weighing down the game a lot ?
  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Good question, I am facing the same issue and I was working on hidden images that appear only with the colour changing. So I was for example having a pixel at Red 201, Green 200 and Blue 200 (with tolerance 1) hidden on an area with R, G and B all at 200. It doesn't work. It works only if I put the Red to 202 but another pixel next to it at 205 is lightly influenced. When instead I activate the pixel with 205 it doesn't influence the 202... Quite hard to get it.

    I am wondering if you have find out it by yourself.

  • Ok I have figure it out that having one of the three channels with at least a difference of value of 3 gives enough good result. In the next days I will link the example. It will be on my website that I am developing.

  • Hi Biim it's been a long time since I opened this thread, so I'm really surprised to get an answer now ^^

    I didn't find it out by myself, there where always some colors that weren't changed so I didn't use this feature after all (not the way I intended to at least ^^')

    I'm really happy that you figured it out, and it's really nice of you to share your results, I look forward to your example

  • Thank you Ratmaster, I am refining few other things and I should be ready in a week or so I guess. I will keep you posted!

    For your kind of feature I also suggest you to use Spriter if you don't know it already.

    I did this coulor changing just because I am old and I have been fascinated how in the old times people animated static images just changing the colour palette. I was curious to test and I have discover how much fun it is, even if not sure if worth the time spent on it

  • Biim thanks

    Well I tried Spriter but I think animations aren't as fluid and natural as I'd like, so I prefer making classic sprite animation ^^

    Also I wanted to use the color swap feature for a zelda-like and I think spriter is better for side-scrolling games :-p

    If I figure out how to use it properly I could use it for all kinds of assets (characters, trees, FX, etc...)

    I could easily create new sprites with another color every time, but the game would be much heavier, that's why I was wondering what the best choice is >_<' :

    • a lighter game with color swap (I hope it doesn't lag because of it though)
    • a heavier game with no color swap ^^
  • Have a look at they RPG Hero Pack:

    Subscribe to Construct videos now
    Subscribe to Construct videos now

    Spriter also have a built in colour replacement function, I will try to find it later but I think it is written in their online manual. Anyway they says that not all the systems support it so I am not sure it can be used on Construct 2. However you can still use the C2 colour replacement for that.

    I haven't played much with Spriter but smooth animation I guess comes with lots of experience <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":-)" title="Smile">

  • Thanks Biim it didn't exist yet when I used this software ^^

    However I still think the animation with spriter looks really unnatural and jerky (even the ones made by the creators of the software) so I prefer to use classic frame-by-frame animation. :-p

    For example I'm very impressed by the work of Paul Robertson (the animator behind games like "Scott Pilgrim vs the World" or "Mercenary Kings"). The character are much more lively and you can't obtain something like that with bone-based sprite animation. ^^

  • Yes, I understand your point. I think it also really depends on the style of the game you are going to create. In my case, I am not an artist, and therefore using Spriter will save me lot of time even though the result will not be perfect for the eyes but still more enjoyable than me drawing each single frame

    I am looking forward to see your game and animations

  • Biim Thanks

    I understand, if you don't really like to draw or animate, Spriter is indeed a good solution ^^

  • Yes, I am planning to make a living on that too. I have postpone the idea for too long since it came out (more than 30 years ago), now it is time to make it real. Need to do so many games before die!

    Actually I quite enjoy doing pixel art, it bring my memories when I was a child drawing sprites on the paper 8 x 8 pixels in b/w and then bring it on my MSX even if at that time I couldn't create a real game. Now much easier with C2, I wish to had a similar tool back in time

  • Biim yes let's go for it !

    It sure is a lot more simple with C2, so it would be a shame not to take advantage of it ^^

    I made a few simple games before but to be honest coding can take a lot of time and sometimes bug solving can be really boring ^^' I prefer to think about the algorithm rather than pure code

  • Hi Ratmaster, I link you to the topic about my website just uploaded so you can try it:

    https://www.scirra.com/forum/viewtopic.php?f=180&t=192635

    For you to see the colour changing on the sea and one of the flower tiles do this:

    At the beginning of the game follow the crab while it is going on the right, after it moves back go at the "T" peninsula and collect the red pill.

    Enjoy!

  • Hi Biim Ok I'll take a look right now ^^

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
300 118,427
blackhornet's avatar
blackhornet
Unread hot topic
0 Favourites
Spam issue
201 16,837
Tom's avatar
Tom Construct Team Founder
Unread hot topic
157 12,695
megatronx's avatar
megatronx