Setting colors to sprites for strategy game

Get help using Construct 2

Post » Wed Apr 17, 2013 12:36 am

In strategy games, be it turn-based or real-time, you might have 2 or more teams fighting each other using the same units. Each unit has its team color.

So I was looking around the forums with the keyword "palette swap" or the like, turned out I found the following:

http://www.scirra.com/forum/palette-manipulation_topic52691.html : posted almost a year ago, and leaded to the plugin here: http://www.scirra.com/forum/behavior-recolor-sprite_topic51640.html But it's not for a single sprite...?

http://www.scirra.com/forum/effect-color-replace_topic40462.html : but this is for C1

So do we have this feature in vanilla C2 yet?keroberos2013-04-17 00:48:02
I got a game that you multiply, breath fire with two heads and brawl foes to oblivion with your clones: http://www.newgrounds.com/portal/view/660664 (use Chrome on Windows for best performance)

My sites:
http://twinblazar.deviantart.com
http://twinblazar.newgrounds.com
https://twitter.com/twinblazar
http://www.pixiv.net/member.php?id=15072448
B
24
S
9
G
11
Posts: 408
Reputation: 8,040

Post » Wed Apr 17, 2013 2:29 am

You basically have 2 options:

1. Manually recolor each sprite in Photoshop or something, then save these as individual animations for each unit.

PROS:
-Works everywhere.
-Little negative performance impact (provided you are within memory limits).
CONS:
-Extremely laborious.
-More laborious the more colors you want
-Not very maintainable
-Uses up a lot of graphics memory.

2. Use a WebGL effect (Adjust HSL or Tint)

PROS:
-Easy to do
-Uses little graphics memory
-Very maintainable
-More color choices than you will ever need
CONS:
-Doesn't work everywhere, only works where webGL is supported.
-Shader effects are hard on the GPU, especially at high resolutions


I would roll with the second option, but if mobile development is important to you that may not be an option (although option 1 won't be very viable either as phones have very limited graphics memory).
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Wed Apr 17, 2013 5:04 pm

Another solution might be to keep the units looking the same, but add a token or flag or some other item to the unit base (eg: a platform) or something indicating what team they are part of. Lets say you had a tank, and it was sitting on a red circle. That circle would be much easier to deal with changing its color than re-coloring the actual unit. So you could approach it that way as well.

B
50
S
21
G
8
Posts: 844
Reputation: 10,299


Return to How do I....?

Who is online

Users browsing this forum: Skebab and 5 guests