haroldo-ok / choice4genesis

A ChoiceScript clone that generates SGDK-compatible C source for the Sega Genesis
https://haroldo-ok.itch.io/choice4genesis
MIT License
22 stars 2 forks source link

Clarify image requirements #123

Open ti-r2 opened 7 months ago

ti-r2 commented 7 months ago

I tried editing the test project with 3 new PNGs. All of them were saved with the same configuration (PNG-8, 16 colors, 320x224), yet only one of them works, despite being exported from Photoshop with identical configs. The others either don't appear or appear misaligned (in the way the Red Echidna picture also appears wrong when running the test project). Because there's no documentation of how images are converted, it's hard to troubleshoot the situation. bg3 bg2 bg1 Captura de tela 2024-04-16 222757 Captura de tela 2024-04-16 222810

haroldo-ok commented 7 months ago

Hello; internally, the tool uses ImageMagick to automatically resize the images and reduce the color count to the format supported by SGDK; additionally, if the image happens to be already in the correct format (PNG-8, 16 colors, 320x224), the tool will use them directly, without conversion.

That being said, there's always a chance of there being a bug on the tool. Perhaps, if you share the project that was used for testing, I could take a look at it later

ti-r2 commented 7 months ago

Thanks for the quick reply! Big fan of your projects. If you add these pics in place of the 3 in the test project (choice4genesis-0.14.4-standalone\choice4genesis\examples\test) it should reproduce the bug. Adding as zip in case the image uploads messes with the file, but the 3 images in the initial post are supposed to be the files. bgs.zip

haroldo-ok commented 7 months ago

Yes, there's something really weird going on:

image test2.zip

I will have to debug this later.

ti-r2 commented 7 months ago

I'm actually happy it is an actual bug, it means it's not something I'm doing wrong haha. I have a small VN project I'm excited about putting on the Genesis, so hopefully this gets fixed. It does seem to be random, I'll export from the same PS file, with the same configs, only changing the art, and some will work and others not. If it helps, here's two more examples: The village one works, the fairy doesn't. bg1 bg3

haroldo-ok commented 7 months ago

Yes, it's a weird bug; I'll try to make a few more tests later.

haroldo-ok commented 7 months ago

It seems that the routine responsible for decompressing the tiles and loading them into video RAM is running out of memory in some of the images; still trying to figure out why.

In order to test a possible workaround, I used RgbQuant-SMS to reduce the tile count; 1024 tiles for the image with 3 fairies and 768 for the one with a single fairy: image

With those two modifications, those images are showing again, though they lost some detail: image image

Unfortunately, as said. this reduces the amount of details in the image, plus the fact that RgbQuant-SMS isn't really geared towards the Sega Genesis palette, at the moment.

ti-r2 commented 7 months ago

Thanks! This is all placeholder art so I'll try to direct the final art in a way that maximizes tile repetition. Hopefully the bug can be solved regardless, but it's great to at least have a metric of how pictures that don't work can be made to work. Thanks again for the awesome project.

haroldo-ok commented 7 months ago

You're welcome; this bug shall be fixed eventually.