The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary Hack Research & Development (https://www.pokecommunity.com/forumdisplay.php?f=195)
-   -   Development Longer names (https://www.pokecommunity.com/showthread.php?t=352399)

Touched July 18th, 2015 6:58 AM

Longer names
 
Introduction
It came to my attention that some Gen VI items names are too long to fit into the 13 characters allocated by the Generation III games, Mega Stones in particular. So I thought, "Why not hack the limit?".
This basically works by having the first word of an item be 0xFFFFFFFF, and the next word being a pointer to the new, longer name. This makes it backwards compatible with the old item table (Only longer items need be repointed) and compatible with tools (They'll show a blank name due to the first character being 0xFF). This method should work for any other names I try to extend, but I'm kicking things off with items.

Table of Name Lengths
I tried to make this as accurate as possible. If you notice anything that is incorrect, please comment with an example name (and the new length). This will be used as a target for any adjustments.

Category
Current Limit
Gen VI Max
Gen VI Example
New Limit

Items
12
15
Weakness Policy
17

Pokemon
10
12
Nickname
-

Moves
12
16
Precipice Blades
-

Abilities
12
14
Primordial Sea
-

Longer Item Names
This hack just changes the code. The tilemap for the status screen needs to be altered to fit the code changes, but I'll just post offsets for the tiles and tilemap in the hope that some kind soul changes the tilemap and posts the hex for it here (hint hint).
Spoiler:

Step 1: Insert and hook
Code:

.align 2
.thumb

@ 00 4A 10 47 XX + 1 XX XX 08 at 0x09A8D0 (0809A8D0 via r2)
hook_name:
    add r0, r1

    @ Item name is 14 bytes long, we can use this for other data
    @ Check if first word is 0xFFFFFFFF
    ldr r1, [r0]
    add r1, #1
    bcc return

    @ First word was 0xFFFFFFFF, second word is therefore a pointer
    @ to the real item name
    ldr r0, [r0, #4]
return:
    pop {pc}


Step 2: Fixing the bag strings

Put B2 00 94 1B E4 00 A4 1B at both 0x108450 and 0x10848E.

Step 3: Making the bag allocate more space

Write DD 03 00 00 at 0x108420

Step 4: Making the mart have larger strings (and malloc more)

Put 0x12 at 0x09B1DE, 0x09B1A4 and 0x09B1FA

Step 5: Changing the x position of the held item name in the status screen

Put 6 at 0x137056 (or whatever position you want, really).

Step 6: Fix Gender Issue

Write 1A 33 00 00 at 0x134540 and then assemble and hook:
Code:

.align 2
.thumb

    @ 00 4B 18 47 XX + 1 XX XX 08 at 0x13704C (0813704C via r3)
hook_name:
    str r4, [sp, #0x4]
    add r7, #0x8
    ldr r3, =0x3308
    add r1, r3
    str r1, [sp, #0x8]
    ldr r3, return
    bx r3

.align 2
return: .word 0x08137054 + 1


The maximum name length is now technically 17, but 16 looks better imo. Here are some screens of what it looks like. See below for how "POTIONPOTIONPOTIO" (17 characters) ends up being right next to the "x" or the currency symbol, which looks strange.

http://i.imgur.com/kD4YaKa.pnghttp://i.imgur.com/yPC50OQ.pnghttp://i.imgur.com/7odVsDx.pnghttp://i.imgur.com/7d6WLMe.pnghttp://i.imgur.com/mpeg02V.png

The status screen looks terrible, because the tilemap is bad. The tilemap for the first page is at 0x135B34. I'll find the tiles later.
EDIT: Fixed last letter of long items overwriting the gender symbol.

Xencleamas July 18th, 2015 7:58 AM

Wow! This is really I wanted to see. I have been always wondering if we can extend the limit of names. Will you also do it for Pokemon, Moves, and Abilities as well?

Touched July 18th, 2015 8:29 AM

Quote:

Originally Posted by Sky High (Post 8851459)
Wow! This is really I wanted to see. I have been always wondering if we can extend the limit of names. Will you also do it for Pokemon, Moves, and Abilities as well?

I will definitely investigate them. Some of them (like Pokemon) aren't exactly feasible due to the number of restrictions on space. But abilities should be fairly easy. Moves might also be a challenge due to the sheer number of interfaces they appear in (Bag, Move Deleter/Reminder, Status screen, Battle, etc.). But items weren't as hard as I expected to be, so who knows?

daniilS July 18th, 2015 9:23 AM

Here's an image to replace the one at 0xE9A460 so that item names look okay in the status screen: https://www.dropbox.com/s/r18n26nv3cc9bhy/%40.bmp?dl=0 You need to use 1A for the x position with this.

Z-nogyroP July 18th, 2015 2:24 PM

Oh, hey, I've wanted something like this for a while!

I can't really help because I have absolutely no idea how to ASM, but I do want to point out that, while Fletchinder is the longest Pokemon name and has 11 characters, I'm pretty sure the limit is actually 12, because that's how many characters you can write while nicknaming something.

Touched July 18th, 2015 2:29 PM

Quote:

Originally Posted by Z-nogyroP (Post 8851776)
Oh, hey, I've wanted something like this for a while!

I can't really help because I have absolutely no idea how to ASM, but I do want to point out that, while Fletchinder is the longest Pokemon name and has 11 characters, I'm pretty sure the limit is actually 12, because that's how many characters you can write while nicknaming something.

I don't doubt that it is more. Project Pokemon says it's actually closer to 23 characters, but if the nickname interface gives 12 spaces, then that's probably the maximum that it will ever go. Thanks for that information; I'll change it in the table.

FamiliaWerneck July 19th, 2015 3:25 AM

What about your character name?
Never could use my first name, 'cause it's only 7 digit long...
Possible to change its limit too?

Touched July 19th, 2015 5:45 AM

Quote:

Originally Posted by FamiliaWerneck (Post 8852380)
What about your character name?
Never could use my first name, 'cause it's only 7 digit long...
Possible to change its limit too?

The OT Name is stored in the Pokemon Data, which means we are limited by that for length. Since there is limited space in that structure, we could only get about 2 characters extra. However, I want to use that space for longer Pokemon Names, so I don't think this is going to happen.

Xencleamas July 19th, 2015 6:40 AM

Quote:

Originally Posted by Touched (Post 8851481)
I will definitely investigate them. Some of them (like Pokemon) aren't exactly feasible due to the number of restrictions on space. But abilities should be fairly easy. Moves might also be a challenge due to the sheer number of interfaces they appear in (Bag, Move Deleter/Reminder, Status screen, Battle, etc.). But items weren't as hard as I expected to be, so who knows?

Yeah! Items are very easy. I bet Abilities and Moves will come first before Pokemon. You might wanna change the "naming" part and it would be too hard. Oh! Adjusting Pokemon names might also ruin saves at all (unless planned to move them). Forgot to tell also if you would be able to adjust the limit of Player (and Rival, for FR) names. Oh dang! That would be also a ruination to save data.

FamiliaWerneck July 19th, 2015 6:50 AM

Quote:

Originally Posted by Touched (Post 8852476)
The OT Name is stored in the Pokemon Data, which means we are limited by that for length. Since there is limited space in that structure, we could only get about 2 characters extra. However, I want to use that space for longer Pokemon Names, so I don't think this is going to happen.

No problem, just wondering if that was possible. Thanks Touched!

Criminon July 19th, 2015 5:13 PM

This is fantastic. With this change, does it effect editors? Or will they still save the same amount as before? Not quite sure if it makes it go down to a certain # of characters because there is no room or because its programmed that way.

Joexv July 19th, 2015 5:36 PM

Quote:

Originally Posted by Criminon (Post 8853263)
This is fantastic. With this change, does it effect editors? Or will they still save the same amount as before? Not quite sure if it makes it go down to a certain # of characters because there is no room or because its programmed that way.

This will fuck up editors big time. So depending on how Touched does the Pokemon name adjustment, it may break all editors that dont support different name lengths. Im an idito I was thinking of the Pokemon in RAM, lol. No it will mess up editors unless they support changing of name length. G3HS supports this. Idk if G3T does though. It might. I dont remember....

Although moves, abilities and items probably will only have part of their names cut off.

Criminon July 19th, 2015 6:52 PM

Quote:

Originally Posted by joexv (Post 8853284)
This will psyduck up editors big time. So depending on how Touched does the Pokemon name adjustment, it may break all editors that dont support different name lengths. Im an idito I was thinking of the Pokemon in RAM, lol. No it will mess up editors unless they support changing of name length. G3HS supports this. Idk if G3T does though. It might. I dont remember....

Although moves, abilities and items probably will only have part of their names cut off.

That's what I was afraid of. I'm hoping it just does the later vs not working at all. Would be a shame having to do all of those last minute. Regardless, very cool that we have this feature now. Would be nice to see it incorporated into G3HS.

Touched July 20th, 2015 1:09 PM

Quote:

Originally Posted by Criminon (Post 8853357)
That's what I was afraid of. I'm hoping it just does the later vs not working at all. Would be a shame having to do all of those last minute. Regardless, very cool that we have this feature now. Would be nice to see it incorporated into G3HS.

Longer names won't work in tools at all because the first byte is 0xFF (the string terminating character), and will be like this for all of the length adjustment hacks. This should show up as a blank string on most tools. However, the other items (or other names in the future) will be exactly the same and thus will still work in tools. This means that you'll probably have to hex edit the names you want to be longer, but that shouldn't be too much of an issue since it will only be a few names that don't fit into this limit.

Jaizu July 30th, 2015 8:30 AM

This is pretty awesome, but tbh, we "can't" adapt all the graphics to longer names.
And this is the perfect example
http://i.imgur.com/kD4YaKa.png

daniilS July 30th, 2015 8:32 AM

Quote:

Originally Posted by Jaizu (Post 8869581)
This is pretty awesome, but tbh, we "can't" adapt all the graphics to longer names.
And this is the perfect example

Read the fourth post on this thread because tbh, we "can".

Jaizu July 30th, 2015 9:18 AM

Quote:

Originally Posted by daniilS (Post 8869585)
Read the fourth post on this thread because tbh, we "can".

That was only an example, if you plan to addapt all the images go ahead, that will be nice.

daniilS July 30th, 2015 9:22 AM

Quote:

Originally Posted by Jaizu (Post 8869623)
That was only an example, if you plan to addapt all the images go ahead, that will be nice.

For items this is all that needs to be done. If Touched runs into graphical problems while expanding other names, I'll gladly edit those images too because I "can".

Lance32497 October 30th, 2015 10:56 PM

Don't know why it makes the screen look like this :(
http://i.imgur.com/LxlpcH4.png

EDIT: Upon giving one of my pokemon an item to be held, the gender doesn't appear
http://i.imgur.com/opHWTmj.png

Venia Silente November 7th, 2015 9:46 AM

Congratulations on developing this. The short charlimit on item and move names has always been a thing that has thrown me off when playing Pokémon, in particular since we're no longer in the '80s.

iBlank August 26th, 2016 8:39 AM

Hello uhm im Newbie in Rom Hacking and can you tell me what Script Editing are you using cos XSE doesn't work. Thanks

Wüfzhéévk December 13th, 2016 8:20 PM

I would only expand the number of characters for pokemon names as someones are a bit longer like FLETCHINDER and CRABOMINABLE, in order to reduce the chance of having errors/bugs/glitches.


Lance32497 December 14th, 2016 1:59 AM

Quote:

Originally Posted by iBlank (Post 9382879)
Hello uhm im Newbie in Rom Hacking and can you tell me what Script Editing are you using cos XSE doesn't work. Thanks

Yeah XSE wouldn't work. That's ASM dude, or Assembly. You need an assemble to compile it. Try KarateKid's THUMB Assembler.

Wüfzhéévk December 24th, 2016 4:37 PM

Wonder if there could be a method to add new characters to the names like the PKMN simbol, the PK character was separated from the MN, this reduced the space instead of writing the four letters in just two..
this could fix problems with the space..

BluRose December 24th, 2016 5:29 PM

Quote:

Originally Posted by Wüfzhéévk (Post 9528260)
Wonder if there could be a method to add new characters to the names like the PKMN simbol, the PK character was separated from the MN, this reduced the space instead of writing the four letters in just two..
this could fix problems with the space..

mate those are already in
character number 0x53, 0x54, 0x55, and 0x56 are...
[pk], [mn], [po], [ké], respectfully
probably accessed by "[pk]" being typed, but definitely accessible via \h commands

so like PKMN would be two separate characters and in xse would either look like [pk][mn] or \h53\h54

and besides, the easiest way to do that for characters that don't appear at all would be simply to replace an old defunct character


All times are GMT -8. The time now is 8:39 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.