How do I use wisely the "replace color"?

0 favourites
  • 8 posts
From the Asset Store
Creepy Sprite Font suitable font for your Dark/Horror/Halloween games.
  • Hello! I would like to make a game with a specific number of colors in a palette, however, I would like to change these colors to provide differences among the levels.

    In these months I have tried some things by using the "replace color" effect.

    For example, I used multiple "replace color" effects for some objects

    That worked alright, except that it was ok only for high-end PCs. playing on low-end PCs brought a high level of latency; therefore, the game ran with less than 20fps.

    I tried the same thing, only on specific layers. For unknown reasons to me, the game was less stressed out by this and could run smoothly enough. But I don't want this.

    I want that the game is optimized enough to run decently everywhere.

    To pick the first sentence, I would like to ask you if you have a better way to introduce a change in palette color for the objects on Construct 3.

    Thank you!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm curious about this too. Palette swapping has always been such a fundemental tool in game development it would be amazing if we could just load palette files in and swap them as needed. I've never had results with replace colour that I am satisfied with and it's also a pain to set up, expensive on processing etc.

  • Some effects are bad for performance, especially when you add them to many objects. Applying the effect to the layer instead is a common way to fix this.

    Without seeing the game it's difficult to suggest, but the obvious solution is to make multiple copies of the same objects with different colors, or multiple animations in a sprite.

    If the objects are static and not animated, you can apply the effect on the start of layout, then paste them on a drawing canvas, then destroy the original objects or make them invisible.

  • Some effects are bad for performance, especially when you add them to many objects. Applying the effect to the layer instead is a common way to fix this.

    Without seeing the game it's difficult to suggest, but the obvious solution is to make multiple copies of the same objects with different colors, or multiple animations in a sprite.

    If the objects are static and not animated, you can apply the effect on the start of layout, then paste them on a drawing canvas, then destroy the original objects or make them invisible.

    Thank you for the kind answer!

    To be honest I did try all you said here. Applying these effects on objects seems to not work well, so I am back to applying effects via layers, although it's not as customizable as I wished to.

    The solution of making multiple copies of the same objects with different colors isn't exactly the thing I want to make for my game.

    At the moment, the idea of making an out-of-palette object (while following the color theory) may help make the objects more unique in shape and color, but ultimately my color change idea comes to an end quickly... Which is actually an option to consider, maybe...

    About the drawing canvas, I did try something similar to what you said, but it did not work as intended. I am about to try your suggestion, but I am not positive about this solution due to the fact that there are many objects that can be moved.

    So in short, it's either keeping the replace the color effect of layers or start making copies of the same objects with different colors.

    One thing, though: Thanks to you I have the confirmation that applying the effects on multiple objects can cause a bad execution process!

  • You can try contacting people who develop effects and shaders. Maybe someone could make a more performance-friendly effect which works for your game.

  • I have remembered i found a video by a guy name winstreak who has made an easy way for editing a color palette even in game save me time on art work

  • I have remembered i found a video by a guy name winstreak who has made an easy way for editing a color palette even in game save me time on art work

    Thank you for the suggestion! With your input I have found the video, which is basically what I did in my game. The problem with this technique, as explained by dop2000, is that this does not work well at all if there are multiple objects.

    If it's just a single object, like the player, it runs normally, but my intention is to apply this effect to most of the objects in the room, by selection.

    The middle ground is to apply the effect on the layer instead of the object.

    The game seems to work better this way.

  • I'm curious about this too. Palette swapping has always been such a fundemental tool in game development it would be amazing if we could just load palette files in and swap them as needed. I've never had results with replace colour that I am satisfied with and it's also a pain to set up, expensive on processing etc.

    Well now, I have had this experiment for a while, and I think it's, at the moment, the best match. In fact, it's a mix between what I want and what I can with Construct 3.

    As we said, if you use the replace color effect directly with the object, for some reason it does not work well enough, especially with low-end PCs (and other devices as well).

    As dop2000 said, the best solution for a palette system would be to use the layer where these objects are going to be placed to apply the effect. In this way, the objects can change color without corrupting the performance.

    Now, my game is divided into many layers since it's a top-down game, but by excluding the HUD we have 3 major layers:

    - LayerBG1 (the objects you can see they're above everything)

    - LayerBGz (the objects with most of the aesthetic choices and are connected with the z escalation and the player)

    - LayerBG0 (the objects which are below everything, like the ground or stuff that don't require z escalation).

    These 3 layers are all connected to the main layer, which I called "GAMEMAP".

    In GAMEMAP you can add as many effects as you want - the "replace color" effect works well enough in this way. However, as you might notice, the palette changes ALL the objects in these 3 sub-layers.

    My middle-ground solution would be to use part of the "replace color" effect on the other 3 layers as well, in this way that effect will only be applied to the selected layer. For example, if you have a chair in LayerBGz and a parquet in LayerBG0, you can use the same effect with two different results, like I can turn the chair red and the parquet blue.

    I hope it helps someone. Again, it's not the best way for me, but instead of getting everything in one color, you can have a little bit more of freedom.

    Additionally, you can add a boolean valuable to the objects in question in case you want that these effects should or should not replace color.

    Overall, these are my experiment results during these 2-3 weeks.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)