The Daily Click ::. Forums ::. Klik Coding Help ::. color selection
 

Post Reply  Post Oekaki 
 

Posted By Message

simon kubisch



Registered
  21/09/2008
Points
  13
5th October, 2008 at 16:39:24 -

hi,
im on creating a rts-game at moment.
the different "units" (soldiers) should have different colored shirts (they are green in the animation) and pants (they are grey)

i tried the hole day to replace the colors with the "pixel object" and fastloops
summary: fastloop checks the pixel of the unit for a color with a specific red green and blue-balance (red 24-46, green 39-77, blue 12-2 and replaces them with another color
it doesnt work (i think because the pixel object is not fast as the fastloop)

the units has got 2500+ pics in its animation... so i cant simply change the color
so... is there an alternative (maybe with overlay object?) or examples or tutorials for coloring a unit

[infos]: i use mmf2

Image Edited by the Author.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1960

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
5th October, 2008 at 21:31:15 -

If they're active objects you can just use "replace color" under "animation" in MMF2 no?
No need for any extensions.
If not, I must be misunderstanding something...

 
n/a

simon kubisch



Registered
  21/09/2008
Points
  13
5th October, 2008 at 22:07:29 -

the problem is that the replace colorfunction needs time...
when i create a fastloop which analyses the unit and replaces the right pixels it hangs up the game

the "trick" i use now is:
ive created 2 images-
first image with all colors which has to be replaced (50x50)
second image with the colors to take for the new pixel (50x50)

due the images are only 50x50 and not as big as the unit is, it hangs a bit but dont crashs the game
it works more or less fine... the "new" problem is now, that i need the exact color-palette of the unit to make sure ALL colors are replaced
i got a few pixels which stay in the old color

to solve the problem there are two ways:
1. convert the unit to 32thsd. or 256 colors (-> less quality, bad)
or
2. get a programm which analyses the picture and makes a new picture out of it with all the colors it got

...but i dont find such a program :/ suggestions?

Image Edited by the Author.

 
n/a

traugott.simon



Registered
  23/08/2008
Points
  91
6th October, 2008 at 16:49:57 -

How many units do you have and how many different colours do you like to have?
Mayby it is easier to just clone the units and change their colours manually.

 
n/a

simon kubisch



Registered
  21/09/2008
Points
  13
6th October, 2008 at 18:28:51 -

as i already said my soldiers got (now) 3000+ pics, because of the many animations if created and rendered in 3d programs, so its definitly to much work to clone it and change color

the unit got many hundred colors, because they are generated by the 3d programm (with shaders etc)
i used green for the shirt, grey for the short and skincolor for the skin, so there is not 1-2 or to static colors to replace but colors in a certain field
for the green shirt its the following:
red: 24 - 46
green: 39 - 77
blue: 12 - 28

a loop with all these colors would have (22*38*16) 13376 rounds...
with my 50x50 pixel "colormap" bitmap (50x50 = 2500 rounds) i already have to wait 4-5 seconds before the game unfreezes

see the prob?
any suggestions which program i could use to create correct colormaps?

[edit] i would like to have all colors avaible on the unit, but 5-10 would be okay too

Image Edited by the Author.

 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2976

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
7th October, 2008 at 01:10:23 -

Well, the only solution I see if you intend on using your gfx is to make a gigantuar sprite-sheet out of all the frames and fool around with hue/saturation on the the related areas.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

simon kubisch



Registered
  21/09/2008
Points
  13
7th October, 2008 at 16:22:24 -

when i got u right than this wont work because "gigantuar" is too big... as i already said a color-map in 50x50 needs already 4-5 seconds to replace the right colors

Image Edited by the Author.

 
n/a

Sketchy

Cornwall UK

Registered
  06/11/2004
Points
  1960

VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
7th October, 2008 at 17:18:35 -

Firstly, there's no way you need anything close to 3000 frames of animations for one unit - I dread to think what the download size of the final game would be.

Secondly, presumably if you created all your graphics in another program, then you still have all the images saved somewhere (hopefully in a single spritesheet). Any halfway decent graphics app will let you easily replace a range of colours easily. If all the frames are stored as individual files then you'll need one of the better ones (Photoshop, Paintshop Pro, etc) that supports batch processing. Yes, you will have to import them all into MMF again, but that's too bad.

Thirdly, if I were you I'd be using temporary "placeholder" sprites until I'd got the game engine complete, rather than messing around with thousands of frames of graphics only to find I need to change them again for some reason.



 
n/a

simon kubisch



Registered
  21/09/2008
Points
  13
7th October, 2008 at 22:04:11 -


Originally Posted by Sketchy
Firstly, there's no way you need anything close to 3000 frames of animations for one unit - I dread to think what the download size of the final game would be.


no i need them... i have only animations in 16 and 32 directions, when you compare this to the game "jagged alliance" or other rts games 3000 pictures are not much
i donīt think that anybody cares to download maybe 50mb in the end (i dont know) or 5 if the server is good



Secondly, presumably if you created all your graphics in another program, then you still have all the images saved somewhere (hopefully in a single spritesheet). Any halfway decent graphics app will let you easily replace a range of colours easily. If all the frames are stored as individual files then you'll need one of the better ones (Photoshop, Paintshop Pro, etc) that supports batch processing. Yes, you will have to import them all into MMF again, but that's too bad.



i got the pics in png format, but every picture "alone" (sry for my bad english...)
the importing to mmf takes the most time... i canīt do that with that much pictures



Thirdly, if I were you I'd be using temporary "placeholder" sprites until I'd got the game engine complete, rather than messing around with thousands of frames of graphics only to find I need to change them again for some reason.


i already use placeholders everywhere
i test things which are a bit tricky (pathfinding, coloring) etc in another testgame (without that many grafics) and import them later

oh and i dont "find i need to change them again"... it was planed from the begining

Image Edited by the Author.

 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2976

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
8th October, 2008 at 17:06:07 -


Originally Posted by Sketchy
Secondly, presumably if you created all your graphics in another program, then you still have all the images saved somewhere (hopefully in a single spritesheet). Any halfway decent graphics app will let you easily replace a range of colours easily. If all the frames are stored as individual files then you'll need one of the better ones (Photoshop, Paintshop Pro, etc) that supports batch processing. Yes, you will have to import them all into MMF again, but that's too bad.



This is what I meant!

And it's too bad that it takes time to import them again, but there really isn't any other way to do it. If you wan't to change that many images, it's bound to take time, how ever you decide to do it.

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

simon kubisch



Registered
  21/09/2008
Points
  13
12th October, 2008 at 20:54:34 -

you are wrong... its works with animation -> colorreplacement now

 
n/a

Eternal Man [EE]

Pitied the FOO

Registered
  18/01/2007
Points
  2976

Game of the Week WinnerHero of TimeLOL SignI am an April Fool
12th October, 2008 at 21:51:28 -

Well, we never said it wouldn't, you did!

 
Eternal Entertainment's Code'n'Art Man

E_E = All Indie


...actually Ell Endie, but whatever.
Image
Image

simon kubisch



Registered
  21/09/2008
Points
  13
13th October, 2008 at 02:07:14 -



And it's too bad that it takes time to import them again, but there really isn't any other way to do it. If you wan't to change that many images, it's bound to take time, how ever you decide to do it.



x_x i never said it wont work... i just said you cant create a loop which replaces the colors without those colormaps : [

btw its a bit complicated

i made a second program to create a "colormap"
the program tests every pixel of the current frame and adds (if the color is not already in the colormap) it to the colormap... this for every frame (via fast loops)
then the program filters* colors and sorts them, so i have 4 maps:
for the skin (pink), for the shirt(green), for the pants(red), for the hair(blue)

these maps i use in my game to replace the right colors (there i have two colormaps: the "before" colormap and the "after" colormap which is manipulated in a grafic-program)

in works very well for the animation i made already... just 1-2 pixel are still wrong but i will get them (its a problem about filtering the right colors mentioned *here)

i hope it wont load too long in (beginning of) the game... because many animations needs to be colored for 6 units and it already hangs 2-3 seconds for one part (skin, shirt, pants, hair)
... ideas?

btw sketchy was right... my character needed 160mb of ram ingame, a bit too much
i now reduced the colors, made the animation only in 16 directions and split up the animations in different active objects which load only when needed... i hope this will solve this problem

Image Edited by the Author.

 
n/a

simon kubisch



Registered
  21/09/2008
Points
  13
15th October, 2008 at 19:50:29 -

it takes definatly too long to create the colors in the real game (hours...)
jeah i spend the last week getting nowhere (with color selection and pathfinding)
nice waste of time -.-

 
n/a
   

Post Reply



 



Advertisement

Worth A Click