Skeetendo

’Cause all games were better on the GBC

You are not logged in.

  • Index
  • → Generation I
  • → Problem when using rgbgfx and pkmncompress for adding backsprites

#1 2017-05-26 05:13:42

Torchickens
Member
Registered: 2011-01-02
Post 45/47

Problem when using rgbgfx and pkmncompress for adding backsprites

Hi, I'm new to adding compressed Pokémon sprites into Generation I, and I'd like to directly convert a PNG into 2bpp format and then compressed sprite data to be interpreted by Pokémon Red/Blue/Yellow but I came across a problem.

My intention is to use a new exploit I discovered to add custom sprites into the game without modifying the ROM using arbitrary sprite glitch Pokémon and I intend to make a video tutorial for this.

I can do it already thanks to this post by Danny-E 33, but I want to avoid using Tile Molester because it has a bad name (with target audience in mind as I have a large number of viewers) and I'd rather convert a PNG file directly to RBY's sprite format.

I came across rgbgfx (Stag091's description), and I used rgbgfx -o out.2bpp in.png to convert a simple 32x32 smiley face into 2bpp, and then I used Stag019's tool pkmncompress to create the compressed image, opened it up in a hex editor and then pasted the data to DAC9 in WRAM (which is where glitch Pokémon 0xE6 takes its back sprite in English Yellow).

The sprite resembled the image I created which is a good sign but unfortunately was scrambled.

I didn't cause the inverted sprites glitch and the 4x4 (0x44) dimension is correct for a backsprite but I wonder if maybe I shouldn't be using a PNG directly from Windows 8's Paint or if I shouldn't have made the sprite 32x32 pixels. (This confused me when using the previous method which required that size because when they appear in the game backsprites are 56x56 pixels).

7D8ySJR.png

I used Windows 8 for this and Command Prompt.

Does anybody know what the issue might be and how to fix it? Thanks in advance!

Edit: Using a 56x56 pixel image generated a 7x7 sprite so that wasn't the problem.

Last edited by Torchickens (2017-05-26 05:22:07)

Offline

#2 2017-05-26 05:37:10

Rangi
Member
Registered: 2016-05-09
Post 686/870

Re: Problem when using rgbgfx and pkmncompress for adding backsprites

The sprite tiles are arranged in column-major order, not row-major. Imagine reflecting your back sprite across the diagonal axis: it would become correct.

If pokered behaves like pokecrystal, then running "python gfx.py 2bpp pic/monback/whatever.png" on a 56x56 backsprite will automatically transpose the tiles. Worst-case scenario, you have to do it yourself in Paint before converting.

Edit: The rgbgfx -h flag ("Lay out tiles horizontally rather than vertically") sounds like it would correct the problem.

Last edited by Rangi (2017-05-26 05:38:39)


Pokémon Polished Crystal (GitHub) — version 2.2.0 released
Pokémon Red★ and Blue★: Space World Edition (GitHub) — updated August 19!
Polished Map: pokered+pokecrystal map, tileset, and palette editor — version 3.5.1 released!

Offline

#3 2017-05-26 05:56:52

Torchickens
Member
Registered: 2011-01-02
Post 46/47

Re: Problem when using rgbgfx and pkmncompress for adding backsprites

Rangi wrote:

The sprite tiles are arranged in column-major order, not row-major. Imagine reflecting your back sprite across the diagonal axis: it would become correct.

If pokered behaves like pokecrystal, then running "python gfx.py 2bpp pic/monback/whatever.png" on a 56x56 backsprite will automatically transpose the tiles. Worst-case scenario, you have to do it yourself in Paint before converting.

Edit: The rgbgfx -h flag ("Lay out tiles horizontally rather than vertically") sounds like it would correct the problem.

Adding the -h flag worked perfectly.

n1jRPrB.png

Thank you very much!! :)

Offline

  • Index
  • → Generation I
  • → Problem when using rgbgfx and pkmncompress for adding backsprites

Board footer

Powered by FluxBB