Talk:Save data structure (Generation I)

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search

Need To Create Page

I have information regarding this page, but I don't appear to have the rights to create it. Halp? --GuyPerfect (talk) 17:20, 8 April 2013 (UTC)

To create pages you need to be autoconfirmed, which is achieved by performing a certain number of edits. The number of edits required is unknown. Lady Ariel 21:28, 8 April 2013 (UTC)
I'm sure I'll reach that number while working on this page. Could someone start it for me? (-: --GuyPerfect (talk) 19:59, 9 April 2013 (UTC)
Until you are able to create pages, it would be best if you worked on the page in the Sandbox. Lady Ariel 21:40, 9 April 2013 (UTC)

Split

The character encoding is not a unique feature of the save data structure. It is used by basically any string in the ROM. While no current data structure page for Gen I uses it, I'm sure there are data structures which could be given articles which would use the character encoding. The character encoding simply does not belong in a section here on the save data structure page. Tiddlywinks (talk) 03:51, 1 April 2014 (UTC)

I think the issue with this split is that it is not significant enough to have its own page. That's just my opinion though. --Spriteit (talk) 13:59, 25 April 2014 (UTC)
I think the fact that it doesn't belong on this page is a much more significant issue. As someone who has previously searched this site for this information (and couldn't find it), this isn't the page I would've expected it to be on. While I agree that it'd be pointless to have a page for each generation, we should have one page that includes them all, and talks about the similarities and differences between eacher generation's character encoding. - unsigned comment from Goukazaru (talkcontribs)

More fields?

There are a lot of fields missing from the table. I could add ALL of them, but I wonder if this is of interest to anyone, or would just clutter the page. For example, starting at 0x25A3 this whole block of WRAM is written: https://github.com/iimarckus/pokered/blob/master/wram.asm#L1438-L2266 - unsigned comment from Pepijndevos (talkcontribs)

I don't quite understand, since that page you linked says things like "enemymon", but if you know how to fill in some blanks, I'd say you should. Tiddlywinks (talk) 18:17, 5 April 2015 (UTC)
Oh yeah, on a side note, did you just change the size for the player's name to 11 because there was a gap, or can you point to somewhere the game actually treats the whole 11 bytes as the name or something? Tiddlywinks (talk) 18:20, 5 April 2015 (UTC)
While some bytes might be unlabelled or cryptic, a lot of them can be added. Yes I did change it to 11. While the UI lets you only type 7(+end byte), the save code explicitly copies 11 bytes: https://github.com/iimarckus/pokered/blob/master/engine/save.asm#L56-L58 Pepijndevos (talk) 07:35, 7 April 2015 (UTC)
The 8-11 bytes might actually be of interest in performing the Old man glitch Pepijndevos (talk) 08:57, 7 April 2015 (UTC)
I later noticed that things like Pokemon names/nicknames have a max length of 10, so I could suppose that's the basis of all user-input names. I've just noticed, in the first link you gave, the code "ds 11" after "PlayerName" and "RivalName", and the rival name field has the same discrepancy player name did, so I'll change it to 11 as well. Tiddlywinks (talk) 12:30, 7 April 2015 (UTC)

Rebattle Trainers

For the life of me I can't figure out why it is impossible to find on the internet the offsets to the flags which control if you have fought a trainer before or not. If you set the value of the byte at offset 0x2A9F to 0 (and update the checksum accordingly), you can rebattle the girl to the left of the entrance of Viridian Forest (Pokemon Version Yellow, U.S. edition, it works for me at least). I do not know the other offsets, particularly the minimum or the maximum range, but I will work to find them. If anyone would like to help with this that would be awesome. A simple script that updates all these values back to their defaults would be an easy way to add replayability to the game. Oaoutpost0 (talk) 01:42, 13 February 2018 (UTC)

I have an update. I believe that all of the flags are located between the offset 0x29C0 and may extend as far up as 0x2B2E. Zeroing out most of these values should enable you to rebattle trainers. Although, I cannot confirm if there are any side effects, if there are also event flags mixed in this range, or if all trainers are covered with this range. Oaoutpost0 (talk) 02:01, 13 February 2018 (UTC)
Take a look at this page. There's two things in here.
One: this seems to identify addresses that are different from what you've identified, starting at 0xD747. Now, I believe the save file is basically just a portion of the game's working RAM that's saved, so it's possible that the addresses you've identified above for the save file are equivalent to these addresses, but I can't say for sure.
Two: these flags have many spaces between the "BEAT" flags, meaning it looks like you would indeed be messing with other flags if you just zeroed out everything between the first "beat" flag and the last. This is also complicated by the fact that these flags are single bits, meaning you also can't just set a whole byte to zero without still potentially messing with an unintended flag.
I haven't tested this in any way myself. But the ROM disassembly is usually very reliable. And I believe it should mostly correspond to Red, Blue, and Yellow, at least the English versions, but the safest thing would be to just experiment with setting/resetting a desired flag in Red or Blue (and/or checking what changes when you trigger specific flags in those games).
If you can make that list correspond to the save file, then you can just filter for all the lines with "BEAT" to identify which flags are for Trainer battles. Give or take a few like "BEAT_ZAPDOS". Tiddlywinks (talk) 03:15, 13 February 2018 (UTC)
Thank you, that is a good source of information (although I'll use the Yellow edition in my testing since that is what ROM I've been working with). I suspect that the offsets are different because, as you said, the save file is just a portion of the RAM, not the whole thing. Also, these constants would suggest that the range of the flags goes form 0x29C0 to 0x2AFF (assuming I found the correct starting point), which isn't as high as I originally estimated (but I did think my original estimate was too high to begin with). It isn't surprising at all that there are other flags mixed in here, or that they are controlled with bits instead of bytes. The values that the flags were changed to before and after the battle were not easily predictable (that is, it seemed like certain bits were being set as opposed to the whole byte). Oaoutpost0 (talk) 22:44, 13 February 2018 (UTC)
Update. The Veridian forest trainer flags are found in offset 0x2A9F, which is an offset of AC more than the first value in the constants file. This suggests the starting point for the flags is 0x29F3 and the ending is 0x2B32, higher than my original estimate. I'm not sure what data is held below that down to 0x29C0, but zeroing that part out didn't seem to damage my save file in any noticeable way for the few minutes I tested it. If there are no objections I will add to the article where the event flags start, what their size is, and a brief textual section on what that means for the reader. Oaoutpost0 (talk) 23:06, 13 February 2018 (UTC)
Update 2. I must be bad at math or the offsets in the assembly file don't correspond to offsets in the save file. I think the event flags start immediately or soon after the casino coins and go at least through the end of the offset described earlier. I know this because the flag to check if you have the town map comes before offset 0x29F3 (I copied over a bunch of values from a prefight save state that I had made so I don't know which one exactly it corresponds to). Oaoutpost0 (talk) 03:29, 14 February 2018 (UTC)

Did a rewrite of the page

So I did a rewrite of the page completing all of the Pokémon Red and Blue save file sections and trying to better adhere it to Bulbapedia standards. In this rewrite I merged the latest contributions in. I hope it's now complete in regards to red and blue and Bulbapedia standards. If anything needs to be brought to my attention or if I broke any rules let me know since it's my first contribution on Bulbapedia but everything should be correct and all Bulbapedia style formatting, structuring, grammar, spelling, etc should be followed. Junebug12851 (talk) 08:09, 28 July 2018 (UTC)