Bennu Game Development

English Forums => Helpdesk => Topic started by: KeiDash on May 11, 2018, 02:28:07 PM

Title: What that hell it's going on with FPGEdit and 8Bits color pallete?
Post by: KeiDash on May 11, 2018, 02:28:07 PM
Hi developers,

A recent discovering (for me part, not that I discovered) bug for BennuGD in Dreamcast port, provoques that we never will be able to free or liberate elements in the Dreamcast RAM and when you use around 14 o 15 mb of ram, the game crashed for erros like out of memory, etc.

I want to continue my game. it's no viable for me right now, make it from zero in other framework like KOS, then, one of my personal possible solition is work with 8bits FPGFiles and use 8BITS_MODE in BennuGD instead of 16BITS_MODE (between 3 ~ 4 Mb in ram of difference).

Ok, let's work. To do this I'm using:
- Photoshop CS 2016
- Corel Paint Shop Pro 9
- FPGEdit2009

Ok, let's do it begining, in my case, with Photoshop as main image editor.

1) Creating the image. It's simple, I edited the image in photoshop, something like this.
(https://s9.postimg.cc/hvoy9xqbz/Image_001.jpg)

2) Convert image to 8bits color depth. I'm going to Image > Mode > Indexed color to do this.
(https://s9.postimg.cc/c8slc3sun/Image_002.jpg)

3) Check the pallete colors. Check if the first color is black for transparency and the rest of colors are correct. Aparently, all it's correct, so I'm going to save the pallete as .PAL extension compatible with Windows colors and supposedly with FPGEdit.
(https://s9.postimg.cc/55kpwmslr/Image_003.jpg)

4) Ok, let's go to FPGEdit to create a new FPG file with 8bits for BennuGD and the pallete that I was created in Photoshop
(https://s9.postimg.cc/nz6itp3pb/Image_004.jpg)
(https://s9.postimg.cc/s8b8w1mfz/Image_005.jpg)

And then (ERROR:PAL not contains 256 colors)...Wops! The .PAL file created with Photoshop it's not compatible?
(https://s9.postimg.cc/sl2n2a9vj/Image_006.jpg)

5) Ok, no problem...Let's try to do the pallete on Corel Paint Shop Pro. Open the image with all colors and palete applied
(https://s9.postimg.cc/6nfczo4e7/Image_007.jpg)

6) I going to load the PAL generated with Photoshop on the image. All it's correct (apparently..)
(https://s9.postimg.cc/hn0kbf7pr/Image_008.jpg)
(https://s9.postimg.cc/6anytq6rj/Image_009.jpg)

7) And then, I'm going to save the .PAL file to use late on FPGEdit
(https://s9.postimg.cc/47djljz3j/Image_010.jpg)

8) Ok, the final try! Load this new palete on FPG edit.
(https://s9.postimg.cc/k5m9bs127/Image_011.jpg)

9) OK NO ERRORS HERE BUT...WHAT HAPPENING AT THE COLORS?
(https://s9.postimg.cc/o1zl7t427/Image_012.jpg)

Al blue colors was replaced for brow colors, but only in FPGEdit. On Photoshop or PSP the pallete has the correct colors...

I don't understood anything about this. Someone can help me please?

Title: Re:What that hell it's going on with FPGEdit and 8Bits color pallete?
Post by: panreyes on May 11, 2018, 02:40:41 PM
I would recommend you using old DIV2's FPG creator for that purpose (8 bit palleting).
Maybe DIVDX will also do the trick :)
Title: Re:What that hell it's going on with FPGEdit and 8Bits color pallete?
Post by: JaViS on May 11, 2018, 03:15:41 PM
Smart FPG Editor also have a good palete support
Title: Re:What that hell it's going on with FPGEdit and 8Bits color pallete?
Post by: KeiDash on May 11, 2018, 05:32:44 PM
Thanks for your fast reply. I downloaded Smart FPG Editor and looks better.

I'm going to try it.

Regards,
Title: Re:What that hell it's going on with FPGEdit and 8Bits color pallete?
Post by: Drumpi on May 12, 2018, 12:37:06 AM
Be careful, because I think that FPGEdit (at least, the 2005 version) can only read FENIX PAL formats, and maybe some old versions of some painting program (I don't remember if Paint Shop Pro, Photoshop or Corel Draw... yes, that old!).

Also, you can create a 16bits FPG, add your image, save it, clone the FPG, and convert it to 8bits. That way it will give you the option to generate a Bennu PAL file.
So as a trick, put all your images that share the same palette on the same file, create the PAL file or just save it as 8bits FPG. Then create a new FPG and use that PAL or 8bitsFPG as a palette, and put your individual images into the new FPG.
Title: Re:What that hell it's going on with FPGEdit and 8Bits color pallete?
Post by: KeiDash on May 12, 2018, 02:32:30 PM
Quote from: Drumpi on May 12, 2018, 12:37:06 AM
Be careful, because I think that FPGEdit (at least, the 2005 version) can only read FENIX PAL formats, and maybe some old versions of some painting program (I don't remember if Paint Shop Pro, Photoshop or Corel Draw... yes, that old!).

Also, you can create a 16bits FPG, add your image, save it, clone the FPG, and convert it to 8bits. That way it will give you the option to generate a Bennu PAL file.
So as a trick, put all your images that share the same palette on the same file, create the PAL file or just save it as 8bits FPG. Then create a new FPG and use that PAL or 8bitsFPG as a palette, and put your individual images into the new FPG.

Perfect! I can do it with this and works perfect on PC and Dreamcast (pheeww....)
This is the best mode that I try to make a 8bits fpg files compatible with Bennu. If this is hopefull for someone, this are the steps.

1) Create new 16Bits FPG file in FPGEdit2009
2) Add a unique png file with all colors that you will use in the rest of png files. This png file should be a, 256 indexed color depth with all colors include the black colors.
3) Go to menu and convert it as 8 bits fpg file and save it.
4) Go to menu FPG > Export fpg resources. Select Microsoft PAL and the name as name
(https://s7.postimg.cc/86nj1iyzv/Image_1.png)

5) Now, create a new 8bits FPG file using the pallete that you just saved and check it.
(https://s7.postimg.cc/d7ux326i3/Image_2.png)
6) Include all separated images for this fpg file with the same pal, 256 indexed colors depth and all should and all it's gona be all right
7) Now in bennugd code, set the color depth as 8bits like this


set_mode(640,480, MODE_8BITS);
fpg = load_fpg("/cd/8bitsfile.fpg");
pal = load_pal(/cd/8bitsfile.pal");


Nothing more :-)

Thanks all for help me in this issue