# Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

## Emulation &amp; ROM Hacking

### Questions? (R/B) - Page 1

Previous Page

- 1

Next Page

#### Questions? (R/B)

Posted by: Spoink
Date: 2015-04-10 09:58:26
Working on a rom hack:

[li]Know any good overworld sprite editors? R/B please.[/li]
[li]How are types stored? R/B only.[/li]

#### Re: Questions? (R/B)

Posted by: Missingnoguy55
Date: 2015-04-10 13:01:05
Just gonna warn you R/B has a very clunky layout when it comes to editing. The script system is awfully unorganized as well.
I don't know any editors unfortunately. Doesn't TileMolester have the ability to edit overworld sprites?

#### Re: Questions? (R/B)

Posted by: Torchickens
Date: 2015-04-10 13:13:42

> [li]Know any good overworld sprite editors? R/B please.[/li]

I unfortunately don't, sorry.

> I don't know any editors unfortunately. Doesn't TileMolester have the ability to edit overworld sprites?

Yeah, Tile-Molester can display the 'images' in a ROM in a certain encoding you want such as "2bpp planar" and I found some overworld sprites there. Editing them is not exactly user friendly, but it doesn't seem too bad.
[img]http://i4.minus.com/ibp1lWfwEviCqf.png[/img]
Perhaps the people at Skeetendo boards may know of a specialized tool?

> [li]How are types stored? R/B only.[/li]

An individual Pokémon's types is part of its base-stats data structure (more information).
Types have the following identifiers:
0x00 - Normal
0x01 - Fighting
0x02 - Flying
0x03 - Poison
0x04 - Rock
0x05 - Ground
0x06 - Bird
0x07 - Bug
0x08 - Ghost
0x14 - Fire
0x15 - Water
0x16 - Grass
0x17 - Electric
0x18 - Psychic
0x19 - Ice
0x1A - Dragon
Type IDs >=0x14 are all Special, the rest are physical. (source) If a Pokémon is single-typed, then internally it has the same type for both its types.
A Pokémon's types according to the summary screen depends on what it is in the base stats data structure mentioned above. As you're likely aware, there are memory addresses that control a party Pokémon's types too (D170, D171 for Pokémon 1). These control the effective typing of a Pokémon in battle and the 'effective' messages for when it is hit, regardless of the Pokémon's typing according to the summary screen. So if you changed the D170/D171 address of Mewtwo to 0x08, 0x08 it would be immune to normal types.
The actual type effectiveness(es) for super-effective, not-very effective or non-effective results are apparently stored in a list.
[quote="Cave of Dragonflies"]
Water 2x vs. Fire
Fire 2x vs. Grass
Fire 2x vs. Ice
Grass 2x vs. Water
Electric 2x vs. Water
Water 2x vs. Rock
Ground 0x vs. Flying
Water 1/2x vs. Water
Fire 1/2x vs. Fire
Electric 1/2x vs. Electric
Ice 1/2x vs. Ice
Grass 1/2x vs. Grass
Psychic 1/2x vs. Psychic
Fire 1/2x vs. Water
Grass 1/2x vs. Fire
Water 1/2x vs. Grass
Electric 1/2x vs. Grass
Normal 1/2x vs. Rock
Normal 0x vs. Ghost
Ghost 2x vs. Ghost
Fire 2x vs. Bug
Fire 1/2x vs. Rock
Water 2x vs. Ground
Electric 0x vs. Ground
Electric 2x vs. Flying
Grass 2x vs. Ground
Grass 1/2x vs. Bug
Grass 1/2x vs. Poison
Grass 2x vs. Rock
Grass 1/2x vs. Flying
Ice 1/2x vs. Water
Ice 2x vs. Grass
Ice 2x vs. Ground
Ice 2x vs. Flying
Fighting 2x vs. Normal
Fighting 1/2x vs. Poison
Fighting 1/2x vs. Flying
Fighting 1/2x vs. Psychic
Fighting 1/2x vs. Bug
Fighting 2x vs. Rock
Fighting 2x vs. Ice
Fighting 0x vs. Ghost
Poison 2x vs. Grass
Poison 1/2x vs. Poison
Poison 1/2x vs. Ground
Poison 2x vs. Bug
Poison 1/2x vs. Rock
Poison 1/2x vs. Ghost
Ground 2x vs. Fire
Ground 2x vs. Electric
Ground 1/2x vs. Grass
Ground 1/2x vs. Bug
Ground 2x vs. Rock
Ground 2x vs. Poison
Flying 1/2x vs. Electric
Flying 2x vs. Fighting
Flying 2x vs. Bug
Flying 2x vs. Grass
Flying 1/2x vs. Rock
Psychic 2x vs. Fighting
Psychic 2x vs. Poison
Bug 1/2x vs. Fire
Bug 2x vs. Grass
Bug 1/2x vs. Fighting
Bug 1/2x vs. Flying
Bug 2x vs. Psychic
Bug 1/2x vs. Ghost
Bug 2x vs. Poison
Rock 2x vs. Fire
Rock 1/2x vs. Fighting
Rock 1/2x vs. Ground
Rock 2x vs. Flying
Rock 2x vs. Bug
Rock 2x vs. Ice
Ghost 0x vs. Normal
Ghost 0x vs. Psychic
Fire 1/2x vs. Dragon
Water 1/2x vs. Dragon
Electric 1/2x vs. Dragon
Grass 1/2x vs. Dragon
Ice 2x vs. Dragon
Dragon 2x vs. Dragon
Unfortunately I don't know the structure in the ROM/relevant offsets. Perhaps if the actual types are stored as bytes in the structure above, you could modify one to a new custom type.
Furthermore, for an event like when you use a Grass-type move on a Water-Flying type Pokémon, there is the dual-typed Pokémon glitch. Here, the actual effectiveness is neutral and that's no bug, but the game tells you that the move was not very effective, because Grass VS Flying can be found later than Grass VS Water in the list above.
At 0x27DE4 you can find a list of type strings in expected encoding, each terminated with a 0x50, which are the names of the types, and probably determine them. Unfortunately I'm unsure how to add a new type string and keep the rest of the types.
Note: You may be wondering why e.g. 94 is apparently "Normal/Ghost", yet it can be hit by Normal-type moves. This is because it is a 0x80, 0x88 type which is referred to as Normal/Ghost but is not effectively Normal/Ghost.

#### Re: Questions? (R/B)

Posted by: hpoké_coloradohugge
Date: 2015-04-10 20:19:04
you can use the program YY-CHR for sprite editing, that's what i use for the most part when doing romhacks.

#### Re: Questions? (R/B)

Posted by: Crystal_
Date: 2015-04-20 16:47:12

> How are types stored? R/B only.

The table is at 0x3e474 (f:6474) in red/blue and the format for each entry is [attacking type][defending type][damage multiplier]. Damage multiplier is 0x05 for not very effective, 0x14 for super-effective, and 0x00 for ineffective. This value will be divided by 0x0A during damage calculation. Any combination not present in that table has a default effectiveness of neutral (10 or 0x0A).
See here: https://github.com/iimarckus/pokered/blob/master/data/type_effects.asm
Type constants: https://github.com/iimarckus/pokered/blob/master/constants/type_constants.asm
Types with an index equal or higher than 0x14 will be treated as special, the rest will be physical.

> Know any good overworld sprite editors? R/B please.

The pokered dissasembly. You just need the sprite in png format and pokered will do the rest for you converting the image to 1bpp/2bpp. Of course, the size must match with the original sprite and you would use 2 and 4 different shades/colors for 1bpp and 2bpp respectively.
https://github.com/iimarckus/pokered/tree/master/gfx/sprites
Previous Page

- 1

Next Page