Author Topic: Palettes and such - Assistance please  (Read 453 times)

wyndcrosser

  • Full Member
  • ***
  • Posts: 227
Palettes and such - Assistance please
« on: December 31, 2013, 02:54:18 AM »
So, Ive gotten a basic main menu and sound, pressing 'Run' gets you into the game itself. Now I'm trying to figure out a few things.

Update: Grafx2 fixes my saving issues, however if I try to add any "new" color to the original .PCX file, I'm getting "Invalid Color Index Found" while compiling in HuC.

Update 2: Duh... you're only allowed 16 palettes, and 0 is one of those 16 (0-15). I'm dumb.

I'm using Photoshop to do the 32x32 character, so I'm assuming I've messed it up with how the PCX file is saved.

#incpal(bonkpal, "warrior.pcx");    /This command should be pulling the palette from the .pcx to make it work, but the character is all black.

When modifying an already created .PCX, it seems to stick me with the original pcx's colors. I even tried to use the same color palette that the original .PCX used, but it's still black (so I think saving the file in photoshop is messing it up)

What are my palette limitations exactly and what sprite programs do you guys use?

Some sprites I'm working with now. The pieces of "up for use", so I'm going to see what I can do with them in a 32x32 pixel area etc.





Thanks

« Last Edit: December 31, 2013, 07:06:13 AM by wyndcrosser »

seieienbu

  • Hero Member
  • *****
  • Posts: 1992
Re: Palettes and such - Assistance please
« Reply #1 on: December 31, 2013, 03:09:50 AM »
Those are some pretty good looking sprites, can't wait to see what they're used for.

I don't know enough to really warrant having an opinion, but on the second page of this thread, http://www.pcenginefx.com/forums/index.php?topic=15765.0 there's a good discussion about what tools people use/are good for artistic assets in PCE development before an awful lot of internet happens.
Current want list:  Bomberman 93

wyndcrosser

  • Full Member
  • ***
  • Posts: 227
Re: Palettes and such - Assistance please
« Reply #2 on: December 31, 2013, 03:35:20 AM »
Those are some pretty good looking sprites, can't wait to see what they're used for.

I don't know enough to really warrant having an opinion, but on the second page of this thread, http://www.pcenginefx.com/forums/index.php?topic=15765.0 there's a good discussion about what tools people use/are good for artistic assets in PCE development before an awful lot of internet happens.


Thanks, I'll look into it. I'm actually thinking once I get this stuff down, I want to make a platformer where you have a World War II Marine, who gets shot back in time, or to another dimension. So you get the run and gun mechanics, but you'll have to do ammo pickups (rocks, etc.) after your ammo from the "future" runs out.

nodtveidt

  • Guest
Re: Palettes and such - Assistance please
« Reply #3 on: December 31, 2013, 05:07:17 AM »
Paint Shop Pro 7 and previous versions work the best for PCE graphics, in terms of major apps. PSP8 and later versions try to be Photoshop, complete with bloat. Photoshop and 4-bit graphics don't get along very well; Paint Shop Pro has a 4-bit mode which makes it impossible to use too many color indexes. It's the old tool phrase... use the right tool for the job. PSP is more suited to low-color pixel work, PS is more suited to high-color photo work.

fragmare

  • Hero Member
  • *****
  • Posts: 676
Re: Palettes and such - Assistance please
« Reply #4 on: December 31, 2013, 05:35:08 AM »
I get what Rover is saying, but I still use Photoshart for everything.  It's a one stop graphical shop.

If you want to make 4-bit pixels using a 9-bit global palette, simply manipulate each RGB color value manually in the color changer thingy.  Pretend the only colors you can make are in RGB value increments of *36*.  So where you normally input the RGB values ranging from 0-255, pretend the only values you can use are 0, 36, 72, 108, 144, 180, 216, and 252.  You can also "force" any image you've already made into a 9-bit color space by going to Image > Posterize > Levels = 8

I will say to ALWAYS use 'Save As' in photoshop when working with PCX files.  For some reason, the 'Save' function will sometimes corrupt the image.

Bonknuts

  • Hero Member
  • *****
  • Posts: 3292
Re: Palettes and such - Assistance please
« Reply #5 on: December 31, 2013, 06:24:49 AM »
Like Frag, I use Photoshop. I have a bunch of support utilities that go along with it. I'm able to embedded subpalette reference directly into PCE colors on Photoshop. Since you use stepping of base 36 for R/G/B, I have a util that creates slight differences between the steps. I have a utility as well as a lookup chart (for manually editing stuffs). Each embedded color corresponds to a 0 to 15 number (aka subpalette). The other method, is just to create a palette map to overlap top of the pic/map/etc that you're working on. I use 8x8 grid blocking on the palette layer, a total of 16 colors and each color is a subpalette. Where ever the 8x8 color from the palette layer overlaps a 8x8 area of the pic underneath, that means that 'tile' or cell underneath belongs to that subpalette. I export both layers as BMPs and have util that creates, the tiles, supalettes, tilemap, etc. It also creates a few other files increase I want to bring it into a different program (like a tile editor). Etc
 I do this for sprites as well, when they are made up of smaller sprites with different subpalettes.

 It sounds complicated, but it's fairly easy to use. I've also used photoshop to make game maps. You can use PS as a pseudo tile map editor. Far credit due; I learned a ~lot~ of my Photoshop kung-fu from Fragmare.

 Can't really help you out on the HuC pcx stuff. I don't use those functions of PCEAS (which HuC just passes along). I usually need a lot more flexibility than what it can give you. I don't even use PCEAS anymore (HuC generates ASM code and passes it along to PCEAS). I'm created a new fork (PCEAS2) with some new directives and such. One of these days, I'll add BMP support to it - with embedded color  subpalette decoding option, as well as a few other options (like remove redundant tiles, etc). Not that I need it, but sometimes you just want some quick and dirty support to test things out.

 Btw, is that your stuff (original)?
« Last Edit: December 31, 2013, 06:26:46 AM by Bonknuts »

TheOldMan

  • Hero Member
  • *****
  • Posts: 958
Re: Palettes and such - Assistance please
« Reply #6 on: December 31, 2013, 06:36:21 AM »
Quote
#incpal(bonkpal, "warrior.pcx");    /This command should be pulling the palette from the .pcx to make it work, but the character is all black.

Yep. Photoshop tends to flip the palette slots in .pcx files. Use gimp to flip them back. That's one of the reasons people use other tools for graphics.

wyndcrosser

  • Full Member
  • ***
  • Posts: 227
Re: Palettes and such - Assistance please
« Reply #7 on: December 31, 2013, 06:42:28 AM »
Bonknuts,

It's not, the individual said I could use some of his concepts, so I've been playing around with them. I've done about 15 various "Amazon" characters, with different hair styles, armor, weapons etc. I just got done with about 10 different "levels", Very interesting stuff. After I do the artwork, that's when I'll start getting into the coding portion. I've seen A LOT of people who start coding and leave art til the end and it shows. A simple game with simple graphics might be okay, but giving it a facelift is great (see the Mega Man 1-6 remastered hacks, the graphics are great).

I've had to recreate everything, as to fix it in 32x32 pixels. Anything bigger, makes me think "Art of Fighting" and isn't good for a platformer.

The guy who does the artwork is SUPER talented, but has no interest in gaming. The attached pictures are just for reference.

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Palettes and such - Assistance please
« Reply #8 on: December 31, 2013, 09:51:43 AM »
What code are you using to load the palette?

#incpal only includes the palettes for use.  If you don't load them, you'll get nothing.

you should have something like set_spr_pal(bonkPal, 16);  < loads 16 palettes
or load_palette(16, bonkPal, 16); < loads 16 palettes starting at the 16th index, which is where sprite palettes begin.

all #incpal(bonkPal, "warrior.pcx") does is extract as many palettes as possible from your source image, and creates that many palette entries.  bonkPal becomes a pointer to the very first one it created, and they will all run sequentially in memory after that.


edit: oh, and you need to remember to set the palette to the sprite, also.  so:

spr_set(*insert sprite number here*);
spr_pal(*insert palette number here*);
[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.

wyndcrosser

  • Full Member
  • ***
  • Posts: 227
Re: Palettes and such - Assistance please
« Reply #9 on: December 31, 2013, 05:21:49 PM »
Hey Arkhan, your right I just wrote that one part as I was making sure that code did what I thought it did. Thanks.

Are there more tutorials or command lists for HuC? I enjoy getting my feet wet.

Arkhan

  • Hero Member
  • *****
  • Posts: 14142
  • Fuck Elmer.
    • Incessant Negativity Software
Re: Palettes and such - Assistance please
« Reply #10 on: December 31, 2013, 07:26:45 PM »
Hey Arkhan, your right I just wrote that one part as I was making sure that code did what I thought it did. Thanks.

Are there more tutorials or command lists for HuC? I enjoy getting my feet wet.


Obeybrew.com has stuff, but it's not done, so expect 404s.

http://archaicpixels.com/index.php/Main_Page  << has a reference. 

[Fri 19:34]<nectarsis> been wanting to try that one for awhile now Ope
[Fri 19:33]<Opethian> l;ol huge dong

I'm a max level Forum Warrior.  I'm immortal.
If you're not ready to defend your claims, don't post em.