Pallete?

Shaybe

New member
Can anyone point me in the direction or explain how the pallete system works? In my video.txt I have colordepth to 16. I read a tutorial saying in this mode the entity references one image for the pallete and I tried that and all I got with the new image was inverted looking colors and the purple box around it. The only other tutorial I can find says it's for 8-bit mode only.
My characters and backgrounds all look really bad and I want to fix this first before I start creating all the sprites.

I appreciate all the help, hopefully I can learn a lot soon and contribute a fun game for people to play.
 
1st of all, 1st color in palette will be transparent so if you have purple box, it is likely that purple is not 1st color in palette. You have to move this color there.

2nd, whatever colordepth you are using, every sprite you use for a character must use same palette.

You should fix these 2 issue 1st :)
 
The best thing to do is take a sprite from someone else mod, and copy your sprites into it. That way all of your sprites will at least have the same palette.

Then, if your character lost some colors, you can edit it later by declaring a different palette in the character's text file. That trick is a little more advanced, so I'll let you get used to the basics before I hit you with the trickier stuff.  :)

Attached is a sprite from one of my games. The color palette is pretty vibrant and varied, so you shouldn't have problems using it as a base for your own characters. To use it for your own characters: open it up in something simple like MSPaint, paste your sprite into it, and save it. Then continue to make more sprite frames like that. This'll insure that your character's frames are using the same palette.

Be sure to have colordepth 16 in video.txt!

[attachment deleted by admin]
 
download xnview, save your character spritesheet in it as gif file and you have palette, now go to edit palette in xnview amd change first colour to pink or whatever, save pic as second version (dont overwrite), then paste old pic to new version in paint program.
If you want remap then you must edit the palette , similar way like that change to pink.
 
Thank you so much for the help! I actually figured out a tiny bit after posting this but those made everything more clear.
The only question I still have is about BG's and title screens. Do those HAVE to use the BOR pallete? Or are those tutorials outdated saying that. If they do need it how do you add colors to the BOR pallete?
 
Something almost everyone forgot:

On photoshop you can FORCE the transparent color (the first one, on .GIF and .PNG). Go to mode > indexed image (or hold ALT and input the sequence I M I) .At "forced" hit CUSTOM and a new window will apear. Chose the desired color, that color will be ALWAYS the first one on your sprites.
 
Yeah that's what I do. It's the easiest way.

Also photoshop will consolidate colours, so if you're transparent colour (like pink) has multiple entries, switch between rgb and indexed mode with the colour forced in palette and the extra ones will be removed.

There's no need to paste into other images, this is the worst thing you could possibly do, this can ruin sprites too.  There's no reason to ever need to do this.

Here's an easy way
---------------
- pack all your sprites into a sprite sheet (there is apps that can do it for you).
If using an existing sprite sheet, remove any effects and un needed portraits. 
Make sure to remove any extra stuff added by the sprite ripper too, just the sprites you will use.  Effects can be added later as there own entities.

- save the sheet, open in photoshop. 

- switch to RGB than to indexed mode (if already RGB just choose indexed)

- force the background colour of your sheet as first colour, like O Ilusionista explained,
if you have transparent background, leave transparency ticked ON for now,
but still force the colour you want for background as the first palette entry. 

- Now IF you have transparency in the image, open palette editor again, click on the square that contains the transparency (the true transparency) and change it to our background colour.

- hit OK, now the transparency is removed and is now our pink background (or whatever colour you use)

- Finally switch to RGB mode again, then back to indexed mode. Make sure the background colour is still forced as index 0.

- This sprite sheet image is now your palette with all required colours and the transparent/background colour is index 0.

- go to palette editor, make sure everything is okay, then save the palette to an .act file
this can be used with PalApply to apply the palette to all your sprites. 

If you don't have cropped and aligned sprites yet, you can work from the sheet now without worrying about converting palettes later.

Save any images with the 'Save for Web & Devices' option in photoshop.
This will clear any uneeded data from the images for best use with openbor.

--------------------------------------------------------------------


@shaybe - No you definately don't have to use the 'bor' palette.  256 colour palettes  were the first thing ever added to openbor like 10years ago, that's how outdated that thing is!!!

You do not need a global palette at all now.  When you run in 16bit mode everything use it's own palette. 
So when making palettes make them for each individual entity.

This will explain setting up openbor for 16bit etc.
Resolution is something you should decide too.


http://www.caskeys.com/arc/games/openbor/wiki/index.php?title=Screen_Modes

This is slightly dated info too, you can actually specify any video mode now, rather than choosing from this list.
 
I  want to thank the person who made this post along with everyone posting also have many good advice's. Here is my report I finally got all of Jago colors correct and save his palette to apply for future changes.


 
For some reason when I try to pallete swap enemies it is messing up. I was able to do it before, but now after changing my pallete it is messing up. Here is the sprite sheet I used for the pallete.


Then I use
remap data/chars/saibaman/idle01.gif data/chars/saibaman/pal1.gif
with this image


Then in the level when I spawn the character I use Map 1. I've tried giving the red one it's own pallete, and pasting it into the original sheet and using that pallete on all images, but no matter what it comes out looking like this in the game.


I don't know what I did before to make this work, but I can't figure it out anymore.
 
Red in the second picture to your character
gif image for pal's supposed to be.
so that the problem does not look at this example.
characters and other images on the same pal gift.



 
Thank you for the response, I think I understand what you were saying. I copied all my alternate pallete images to the main sheet and made the pallete from that image. I am still getting the messed up blue colors though and I don't know why.
 
Remaps must use the same indexes as the original sprite. 

I did this quick for an example -

Here's the main palette

palette_help1.png


- index 0 is pink (index 0 used for transparent colour in openbor)
- index 1 is BLUE
- index 2 is YELLOW
- index 3 is RED

-----------------------

For my new remap palette I want blue to be green, so I change it like this,
click the Blue colour, index 1.

palette_help2.png


--------------------------------------

Then choose new colour.
If you need to copy colours from existing sprites, just keep a sprite open and copy the colours from there, or make a colour chart before hand.
palette_help3.png


Save the image as new file and use it for your remap.



 
I feel like I'm really stupid or crazy because I can't get this to work! Here is my idle picture with pallete.
pallete.png

and here is the remap
remap.png


Here is the code in the enemy txt file
remap data/chars/s2/idle1.gif data/chars/s2/pal.gif
But it still comes out looking like the above picture! The weirdest thing is that I deleted pal.gif and forgot to take it out the code and it still made the characters looked messed up. Then I changed it to remap to a picture that didn't even exist and it made the characters still look messed up. Shouldn't I have gotten an error from BOR saying that the remap image doesn't exist?
 
No no, the remap palette is the exact same palette as the normal map. The difference is, the placement of the colors on the image is different, and BOR will use that to colorswap all sprites in the entity. Let me show you an example...

This is the normal color of the character:
qo6p77.png


This is the remap:
2r39yz4.png


They both use the same palette. It's just that the colors are swapped in their positions on the actual sprite, not in their positions in the palette.

EDIT: The method that Beastie showed you is for the alternatepal command, not remap.

alternatepal {path}

~This is to set alternate palette for this entity. ONLY compatible with truecolor mode (see video.txt above)!.
~{path} is the location of the image whose palette will be used as alternate palette. The {path} is relative to OpenBoR.
~Used in conjunction with 'pallette' above.
 
NickyP said:
No no, the remap palette is the exact same palette as the normal map. The difference is, the placement of the colors on the image is different, and BOR will use that to colorswap all sprites in the entity. Let me show you an example...

Sorry Nick, but I'm afraid Beastie is correct on this one. Your method is only for 8-bit mode, and why you choose to use it is beyond me. In 16-bit or 32-bit mode, matching indexes and swapping the entire palette is exactly what you do, and for most people is a far simpler process to understand and master. That's why we never recommend beginners use 8-bit mode.

Even if your whole module will only have a few colors we always recommend one of the more powerful color modes because they are simpler to work with. These days 8-bit mode isn't even worth the memory and speed savings due to improvements in the engine's sprite handling efficiency. The only reason it's still there is for backward compatibility.

DC
 
Alright, thank you everyone for your help. I actually finally got it working. I put every alternate color enemy into one pallete, then it turns out I had to move the remap further down in the charact txt.
alternatepal does sound a lot easier if I want to add other colors later. How do I selects which pallete I want to use when I spawn the enemy?
 
Damon Caskey said:
Your method is only for 8-bit mode, and why you choose to use it is beyond me. In 16-bit or 32-bit mode, matching indexes and swapping the entire palette is exactly what you do, and for most people is a far simpler process to understand and master. That's why we never recommend beginners use 8-bit mode.

Actually, it does indeed work in 16/32-bit mode. Individual entities can have their own global palettes, but the 8-bit remap system still works as long as the remap uses the same palette as the entity. Paxplode ClaFan if you don't believe me.  ;)
 
I'll take your word for it, but that's still a masochistic way to go about it. You'll get a lot more bang for your buck switching out the palette as opposed to using pixel remaps, in time spent if nothing else.

DC
 
I really appreciate everyones help. I decided to just go with the alternatepal because this will work best in case I come up with different color schemes.
I am glad that so many people are willing to help, I promise I will have more questions very soon (I already have some I'm waiting to try and figure out on my own first).
I hope that I will be able to contribute a game that people will enjoy playing!
 
Back
Top Bottom