changing the pallette colors for each individual graphic

Started by
5 comments, last by wrfstudios 20 years, 11 months ago
I posted a similar post in turbo. But i figure someone in "isometric area" has come across this type of situation... Im making a isometric game simliar to rollercoaster tycoon. Im not sure how they change the colors on each of the rides - But since you can make the rides ANY color - im sure they didnt create each piece of the ride in every color imaginable. I think they change the pallette for each image to allow the user to select whatever color they want for each piece of the ride. Has anyone ever done this using Directx? If so... how is it done? - it would help me out if someone has done this in DelphiX but perhaps some puedo code would work too...anyway... Thanks Bill
Last Half of Darkness Developerhttp://www.lasthalfofdarkness.com
Advertisement
I believe Roller Coaster Tycoon uses a 3d renderer, but you could probably implement it in 2d-iso using some simple code (at least it''s simple in 8-bit mode ) and assign a few colors out of the palette that are designated "special colors"; then your code can change those colors based on what color the user has selected. This wouldn''t work for too many different tiles, though, because you''d run out of unique palette entries.
"Pleased to meet youHope you guess my nameBut what's puzzling youIs the nature of my game"-- The Rolling Stones
No I believe Roller Coaster Tycoon is a 2D iso engine. Please correct me if I''m wrong anyone.

David
David"One of the keys to happiness is a bad memory." - Rita Mae Brown
Yeah RollerCoaster is full 2D but it looks like awesome 3d graphics. I''m not sure but mabe they rendered the graphics in 3d.
The tracks behave like if they were in 3D but they are very much 2d.
Yes, I can confirm much of the Roller Coaster Tycoon graphics are prerendered from high poly 3D models.
Yeah - im sure they''re pre-rendered 3d graphics - but how can you change the track, cars, and rides to ANY color in the game?

There''s way too many colors and ride pieces to have pre-rendered each with a different color - theres some sort of way to change the RPG value/palette of each piece of the ride (graphic image)

Anyone know the exact directx syntax to do this?

Thanks
Last Half of Darkness Developerhttp://www.lasthalfofdarkness.com
Read about DirectDrawPalettes in the SDK to find out how to use them. Allocate a certain number of colors in the palette to use as your "team" colors.

For example:
In your default palette you would want to set color entries 1-10 to a color like magenta. So now you have 10 shades of magenta. When you are coloring your graphics, use the 10 magenta colors for the parts that you want to be changed in the game.

Now create your "team" palettes .. just change those 10 magenta shades to say .. 10 red shades. Save the palette and repeat the process for each "team".

Okay, so lets say you have 5 color palettes (default, red, green, blue, orange), in your code create 5 DirectDrawPalette objects, and set each one to one of the palettes .. now when your drawing your sprite, just attach whichever palette you want to the surface. That should change the "Team" colors.

Hope that helps

Oh, and I would use a program like Paint Shop Pro to create the palettes, but there may be some other software out there specifically for this purpose.

[edited by - mstrmynd on May 6, 2003 12:50:15 PM]

This topic is closed to new replies.

Advertisement