Author Topic: Developing FF4kster: a comprehensive editor for FF4  (Read 235617 times)

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,425
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: Developing a comprehensive editor for FF4
« Reply #750 on: March 19, 2014, 06:09:11 PM »
It writes the treasures so far before adding on the ones for the current map. So it's writing C9 for map A6 correctly, then seeing that map A6 has no chests, writes C9 again for map A7 (the original has CB instead). Then it adds the 2 chests from map A7 to get CB for map A8 (the original has CD instead). This seems to me to be the original breaking the pattern at this point. The question is, why?

So to make sure I completely understand, it loads A6 then writes $C9 (no chests) then loads A7 and writes $C9 again?  I think your editor may be off by one.  Indeed, Map A7 has a chest index of $CB A8 has a chest index of $CD.  Can you verify this?

*edit*
BTW, Map chest indexes 9E through A6 all should show $C9.  Maybe somewhere around there it gets off by one?

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #751 on: March 19, 2014, 06:28:07 PM »
It's off in relation to the original treasure indexes, but I think it's correct in terms of counting the treasures, meaning the original is off for some reason.

Now... is this at all related to the graphical glitch that seems to accompany any trigger changes?
Sems like that would be a weird association.

Yup this whole treasure index thing seems to be the culprit. The code for updating the map treasure indexes is executed when you leave the trigger editor. So even if you change no triggers, entering and exiting the editor will cause the resulting game to glitch if you saved the rom.
Let's dance!

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,425
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: Developing a comprehensive editor for FF4
« Reply #752 on: March 19, 2014, 06:42:53 PM »
It's off in relation to the original treasure indexes, but I think it's correct in terms of counting the treasures, meaning the original is off for some reason.

Oh hell, that makes things complicated then...

I need to wrap my brain around that. 

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #753 on: March 21, 2014, 04:02:33 AM »
Ok here's what I did. I got it to output to a text file as it was going. I'm dumping the results here; this is how you read it:

Map XXX: YY -> ZZ (N treasures)

XXX is the index of the map, 1-based, hex (i can easily make it decimal or have the name come up or whatever people find more useful)
YY is what the treasure index byte is for that map in the original.
ZZ is what the treasure index byte is as calculated by FF4kster.
N is how many treasures that map has. In theory this should be added to the current total to arrive at the next map's index.

Code: [Select]
Map 001: 0 -> 0 ( 7 treasures)
Map 002: 7 -> 7 ( 3 treasures)
Map 003: 10 -> 10 ( 1 treasures)
Map 004: 11 -> 11 ( 0 treasures)
Map 005: 11 -> 11 ( 3 treasures)
Map 006: 14 -> 14 ( 4 treasures)
Map 007: 18 -> 18 ( 1 treasures)
Map 008: 19 -> 19 ( 0 treasures)
Map 009: 19 -> 19 ( 0 treasures)
Map 00A: 19 -> 19 ( 0 treasures)
Map 00B: 19 -> 19 ( 0 treasures)
Map 00C: 19 -> 19 ( 4 treasures)
Map 00D: 23 -> 23 ( 2 treasures)
Map 00E: 25 -> 25 ( 0 treasures)
Map 00F: 25 -> 25 ( 2 treasures)
Map 010: 27 -> 27 ( 4 treasures)
Map 011: 31 -> 31 ( 0 treasures)
Map 012: 31 -> 31 ( 0 treasures)
Map 013: 31 -> 31 ( 0 treasures)
Map 014: 31 -> 31 ( 0 treasures)
Map 015: 31 -> 31 ( 0 treasures)
Map 016: 31 -> 31 ( 0 treasures)
Map 017: 31 -> 31 ( 0 treasures)
Map 018: 31 -> 31 ( 0 treasures)
Map 019: 31 -> 31 ( 0 treasures)
Map 01A: 31 -> 31 ( 0 treasures)
Map 01B: 31 -> 31 ( 0 treasures)
Map 01C: 31 -> 31 ( 0 treasures)
Map 01D: 31 -> 31 ( 0 treasures)
Map 01E: 31 -> 31 ( 0 treasures)
Map 01F: 31 -> 31 ( 0 treasures)
Map 020: 31 -> 31 ( 0 treasures)
Map 021: 31 -> 31 ( 0 treasures)
Map 022: 31 -> 31 ( 3 treasures)
Map 023: 34 -> 34 ( 0 treasures)
Map 024: 34 -> 34 ( 0 treasures)
Map 025: 34 -> 34 ( 0 treasures)
Map 026: 34 -> 34 ( 0 treasures)
Map 027: 34 -> 34 ( 0 treasures)
Map 028: 34 -> 34 ( 0 treasures)
Map 029: 34 -> 34 ( 0 treasures)
Map 02A: 34 -> 34 ( 0 treasures)
Map 02B: 34 -> 34 ( 3 treasures)
Map 02C: 37 -> 37 ( 0 treasures)
Map 02D: 37 -> 37 ( 0 treasures)
Map 02E: 37 -> 37 ( 0 treasures)
Map 02F: 37 -> 37 ( 6 treasures)
Map 030: 43 -> 43 ( 0 treasures)
Map 031: 43 -> 43 ( 0 treasures)
Map 032: 43 -> 43 ( 0 treasures)
Map 033: 43 -> 43 ( 0 treasures)
Map 034: 43 -> 43 ( 0 treasures)
Map 035: 43 -> 43 ( 0 treasures)
Map 036: 43 -> 43 ( 4 treasures)
Map 037: 47 -> 47 ( 2 treasures)
Map 038: 49 -> 49 ( 5 treasures)
Map 039: 54 -> 54 ( 1 treasures)
Map 03A: 55 -> 55 ( 0 treasures)
Map 03B: 55 -> 55 ( 3 treasures)
Map 03C: 58 -> 58 ( 3 treasures)
Map 03D: 61 -> 61 ( 0 treasures)
Map 03E: 61 -> 61 ( 1 treasures)
Map 03F: 62 -> 62 ( 1 treasures)
Map 040: 63 -> 63 ( 0 treasures)
Map 041: 63 -> 63 ( 1 treasures)
Map 042: 64 -> 64 ( 0 treasures)
Map 043: 64 -> 64 ( 3 treasures)
Map 044: 67 -> 67 ( 9 treasures)
Map 045: 76 -> 76 ( 1 treasures)
Map 046: 77 -> 77 ( 0 treasures)
Map 047: 77 -> 77 ( 0 treasures)
Map 048: 77 -> 77 ( 0 treasures)
Map 049: 77 -> 77 ( 0 treasures)
Map 04A: 77 -> 77 ( 4 treasures)
Map 04B: 81 -> 81 ( 0 treasures)
Map 04C: 81 -> 81 ( 0 treasures)
Map 04D: 81 -> 81 ( 0 treasures)
Map 04E: 81 -> 81 ( 0 treasures)
Map 04F: 81 -> 81 ( 1 treasures)
Map 050: 82 -> 82 ( 1 treasures)
Map 051: 83 -> 83 ( 4 treasures)
Map 052: 87 -> 87 ( 0 treasures)
Map 053: 87 -> 87 ( 0 treasures)
Map 054: 87 -> 87 ( 0 treasures)
Map 055: 87 -> 87 ( 0 treasures)
Map 056: 87 -> 87 ( 0 treasures)
Map 057: 87 -> 87 ( 0 treasures)
Map 058: 87 -> 87 ( 0 treasures)
Map 059: 87 -> 87 ( 0 treasures)
Map 05A: 87 -> 87 ( 0 treasures)
Map 05B: 87 -> 87 ( 0 treasures)
Map 05C: 87 -> 87 ( 1 treasures)
Map 05D: 88 -> 88 ( 8 treasures)
Map 05E: 96 -> 96 ( 18 treasures)
Map 05F: 114 -> 114 ( 1 treasures)
Map 060: 115 -> 115 ( 5 treasures)
Map 061: 120 -> 120 ( 0 treasures)
Map 062: 120 -> 120 ( 2 treasures)
Map 063: 122 -> 122 ( 4 treasures)
Map 064: 126 -> 126 ( 2 treasures)
Map 065: 128 -> 128 ( 5 treasures)
Map 066: 133 -> 133 ( 3 treasures)
Map 067: 136 -> 136 ( 0 treasures)
Map 068: 136 -> 136 ( 0 treasures)
Map 069: 136 -> 136 ( 0 treasures)
Map 06A: 136 -> 136 ( 0 treasures)
Map 06B: 136 -> 136 ( 0 treasures)
Map 06C: 136 -> 136 ( 0 treasures)
Map 06D: 136 -> 136 ( 4 treasures)
Map 06E: 140 -> 140 ( 0 treasures)
Map 06F: 140 -> 140 ( 0 treasures)
Map 070: 140 -> 140 ( 5 treasures)
Map 071: 145 -> 145 ( 3 treasures)
Map 072: 148 -> 148 ( 2 treasures)
Map 073: 150 -> 150 ( 2 treasures)
Map 074: 152 -> 152 ( 4 treasures)
Map 075: 156 -> 156 ( 0 treasures)
Map 076: 156 -> 156 ( 2 treasures)
Map 077: 158 -> 158 ( 2 treasures)
Map 078: 160 -> 160 ( 6 treasures)
Map 079: 166 -> 166 ( 3 treasures)
Map 07A: 169 -> 169 ( 0 treasures)
Map 07B: 169 -> 169 ( 3 treasures)
Map 07C: 172 -> 172 ( 1 treasures)
Map 07D: 173 -> 173 ( 0 treasures)
Map 07E: 173 -> 173 ( 0 treasures)
Map 07F: 173 -> 173 ( 0 treasures)
Map 080: 173 -> 173 ( 1 treasures)
Map 081: 174 -> 174 ( 0 treasures)
Map 082: 174 -> 174 ( 4 treasures)
Map 083: 178 -> 178 ( 0 treasures)
Map 084: 178 -> 178 ( 3 treasures)
Map 085: 181 -> 181 ( 2 treasures)
Map 086: 183 -> 183 ( 0 treasures)
Map 087: 183 -> 183 ( 2 treasures)
Map 088: 185 -> 185 ( 0 treasures)
Map 089: 185 -> 185 ( 0 treasures)
Map 08A: 185 -> 185 ( 0 treasures)
Map 08B: 185 -> 185 ( 0 treasures)
Map 08C: 185 -> 185 ( 0 treasures)
Map 08D: 185 -> 185 ( 2 treasures)
Map 08E: 187 -> 187 ( 1 treasures)
Map 08F: 188 -> 188 ( 2 treasures)
Map 090: 190 -> 190 ( 0 treasures)
Map 091: 190 -> 190 ( 3 treasures)
Map 092: 193 -> 193 ( 1 treasures)
Map 093: 194 -> 194 ( 0 treasures)
Map 094: 194 -> 194 ( 1 treasures)
Map 095: 195 -> 195 ( 0 treasures)
Map 096: 195 -> 195 ( 0 treasures)
Map 097: 195 -> 195 ( 0 treasures)
Map 098: 195 -> 195 ( 0 treasures)
Map 099: 195 -> 195 ( 1 treasures)
Map 09A: 196 -> 196 ( 1 treasures)
Map 09B: 197 -> 197 ( 0 treasures)
Map 09C: 197 -> 197 ( 0 treasures)
Map 09D: 197 -> 197 ( 0 treasures)
Map 09E: 197 -> 197 ( 4 treasures)
Map 09F: 201 -> 201 ( 0 treasures)
Map 0A0: 201 -> 201 ( 0 treasures)
Map 0A1: 201 -> 201 ( 0 treasures)
Map 0A2: 201 -> 201 ( 0 treasures)
Map 0A3: 201 -> 201 ( 0 treasures)
Map 0A4: 201 -> 201 ( 0 treasures)
Map 0A5: 201 -> 201 ( 0 treasures)
Map 0A6: 201 -> 201 ( 0 treasures)
Map 0A7: 201 -> 201 ( 0 treasures)
Map 0A8: 203 -> 201 ( 2 treasures)
Map 0A9: 205 -> 203 ( 1 treasures)
Map 0AA: 206 -> 204 ( 1 treasures)
Map 0AB: 207 -> 205 ( 1 treasures)
Map 0AC: 208 -> 206 ( 0 treasures)
Map 0AD: 208 -> 206 ( 1 treasures)
Map 0AE: 209 -> 207 ( 0 treasures)
Map 0AF: 212 -> 207 ( 0 treasures)
Map 0B0: 214 -> 207 ( 0 treasures)
Map 0B1: 214 -> 207 ( 0 treasures)
Map 0B2: 214 -> 207 ( 0 treasures)
Map 0B3: 214 -> 207 ( 0 treasures)
Map 0B4: 214 -> 207 ( 0 treasures)
Map 0B5: 214 -> 207 ( 0 treasures)
Map 0B6: 214 -> 207 ( 0 treasures)
Map 0B7: 214 -> 207 ( 0 treasures)
Map 0B8: 214 -> 207 ( 5 treasures)
Map 0B9: 219 -> 212 ( 0 treasures)
Map 0BA: 219 -> 212 ( 2 treasures)
Map 0BB: 221 -> 214 ( 1 treasures)
Map 0BC: 222 -> 215 ( 0 treasures)
Map 0BD: 222 -> 215 ( 0 treasures)
Map 0BE: 222 -> 215 ( 0 treasures)
Map 0BF: 222 -> 215 ( 0 treasures)
Map 0C0: 222 -> 215 ( 0 treasures)
Map 0C1: 222 -> 215 ( 0 treasures)
Map 0C2: 222 -> 215 ( 0 treasures)
Map 0C3: 222 -> 215 ( 0 treasures)
Map 0C4: 222 -> 215 ( 0 treasures)
Map 0C5: 222 -> 215 ( 0 treasures)
Map 0C6: 222 -> 215 ( 0 treasures)
Map 0C7: 222 -> 215 ( 0 treasures)
Map 0C8: 222 -> 215 ( 3 treasures)
Map 0C9: 225 -> 218 ( 0 treasures)
Map 0CA: 225 -> 218 ( 12 treasures)
Map 0CB: 237 -> 230 ( 4 treasures)
Map 0CC: 241 -> 234 ( 0 treasures)
Map 0CD: 241 -> 234 ( 0 treasures)
Map 0CE: 241 -> 234 ( 1 treasures)
Map 0CF: 242 -> 235 ( 2 treasures)
Map 0D0: 244 -> 237 ( 1 treasures)
Map 0D1: 245 -> 238 ( 0 treasures)
Map 0D2: 245 -> 238 ( 1 treasures)
Map 0D3: 246 -> 239 ( 1 treasures)
Map 0D4: 247 -> 240 ( 1 treasures)
Map 0D5: 248 -> 241 ( 1 treasures)
Map 0D6: 249 -> 242 ( 0 treasures)
Map 0D7: 249 -> 242 ( 0 treasures)
Map 0D8: 249 -> 242 ( 0 treasures)
Map 0D9: 249 -> 242 ( 0 treasures)
Map 0DA: 249 -> 242 ( 0 treasures)
Map 0DB: 249 -> 242 ( 0 treasures)
Map 0DC: 249 -> 242 ( 0 treasures)
Map 0DD: 249 -> 242 ( 0 treasures)
Map 0DE: 249 -> 242 ( 0 treasures)
Map 0DF: 249 -> 242 ( 0 treasures)
Map 0E0: 249 -> 242 ( 0 treasures)
Map 0E1: 249 -> 242 ( 0 treasures)
Map 0E2: 249 -> 242 ( 0 treasures)
Map 0E3: 249 -> 242 ( 0 treasures)
Map 0E4: 249 -> 242 ( 0 treasures)
Map 0E5: 249 -> 242 ( 0 treasures)
Map 0E6: 249 -> 242 ( 0 treasures)
Map 0E7: 249 -> 242 ( 0 treasures)
Map 0E8: 249 -> 242 ( 0 treasures)
Map 0E9: 249 -> 242 ( 0 treasures)
Map 0EA: 249 -> 242 ( 0 treasures)
Map 0EB: 249 -> 242 ( 0 treasures)
Map 0EC: 249 -> 242 ( 0 treasures)
Map 0ED: 249 -> 242 ( 0 treasures)
Map 0EE: 249 -> 242 ( 0 treasures)
Map 0EF: 249 -> 242 ( 0 treasures)
Map 0F0: 249 -> 242 ( 0 treasures)
Map 0F1: 249 -> 242 ( 0 treasures)
Map 0F2: 249 -> 242 ( 0 treasures)
Map 0F3: 249 -> 242 ( 0 treasures)
Map 0F4: 249 -> 242 ( 0 treasures)
Map 0F5: 249 -> 242 ( 0 treasures)
Map 0F6: 249 -> 242 ( 0 treasures)
Map 0F7: 249 -> 242 ( 0 treasures)
Map 0F8: 249 -> 242 ( 0 treasures)
Map 0F9: 249 -> 242 ( 0 treasures)
Map 0FA: 249 -> 242 ( 0 treasures)
Map 0FB: 249 -> 242 ( 0 treasures)
Map 0FC: 249 -> 242 ( 0 treasures)
Map 0FD: 249 -> 242 ( 0 treasures)
Map 0FE: 249 -> 242 ( 0 treasures)
Map 0FF: 249 -> 242 ( 0 treasures)
Map 100: 249 -> 242 ( 0 treasures)
Map 101: 0 -> 0 ( 0 treasures)
Map 102: 0 -> 0 ( 0 treasures)
Map 103: 0 -> 0 ( 3 treasures)
Map 104: 3 -> 3 ( 1 treasures)
Map 105: 4 -> 4 ( 0 treasures)
Map 106: 4 -> 4 ( 0 treasures)
Map 107: 4 -> 4 ( 6 treasures)
Map 108: 10 -> 10 ( 0 treasures)
Map 109: 10 -> 10 ( 0 treasures)
Map 10A: 10 -> 10 ( 0 treasures)
Map 10B: 10 -> 10 ( 3 treasures)
Map 10C: 13 -> 13 ( 3 treasures)
Map 10D: 16 -> 16 ( 0 treasures)
Map 10E: 16 -> 16 ( 0 treasures)
Map 10F: 16 -> 16 ( 0 treasures)
Map 110: 16 -> 16 ( 0 treasures)
Map 111: 16 -> 16 ( 1 treasures)
Map 112: 17 -> 17 ( 1 treasures)
Map 113: 18 -> 18 ( 0 treasures)
Map 114: 18 -> 18 ( 0 treasures)
Map 115: 18 -> 18 ( 0 treasures)
Map 116: 18 -> 18 ( 1 treasures)
Map 117: 19 -> 19 ( 1 treasures)
Map 118: 20 -> 20 ( 1 treasures)
Map 119: 21 -> 21 ( 1 treasures)
Map 11A: 22 -> 22 ( 4 treasures)
Map 11B: 26 -> 26 ( 4 treasures)
Map 11C: 30 -> 30 ( 2 treasures)
Map 11D: 32 -> 32 ( 0 treasures)
Map 11E: 32 -> 32 ( 1 treasures)
Map 11F: 33 -> 33 ( 0 treasures)
Map 120: 34 -> 33 ( 1 treasures)
Map 121: 35 -> 34 ( 0 treasures)
Map 122: 35 -> 34 ( 3 treasures)
Map 123: 38 -> 37 ( 1 treasures)
Map 124: 39 -> 38 ( 3 treasures)
Map 125: 42 -> 41 ( 2 treasures)
Map 126: 44 -> 43 ( 2 treasures)
Map 127: 46 -> 45 ( 1 treasures)
Map 128: 47 -> 46 ( 1 treasures)
Map 129: 48 -> 47 ( 1 treasures)
Map 12A: 49 -> 48 ( 0 treasures)
Map 12B: 49 -> 48 ( 0 treasures)
Map 12C: 49 -> 48 ( 0 treasures)
Map 12D: 49 -> 48 ( 0 treasures)
Map 12E: 49 -> 48 ( 0 treasures)
Map 12F: 49 -> 48 ( 0 treasures)
Map 130: 49 -> 48 ( 0 treasures)
Map 131: 49 -> 48 ( 0 treasures)
Map 132: 49 -> 48 ( 0 treasures)
Map 133: 49 -> 48 ( 0 treasures)
Map 134: 49 -> 48 ( 0 treasures)
Map 135: 49 -> 48 ( 0 treasures)
Map 136: 49 -> 48 ( 0 treasures)
Map 137: 49 -> 48 ( 3 treasures)
Map 138: 52 -> 51 ( 2 treasures)
Map 139: 54 -> 53 ( 6 treasures)
Map 13A: 60 -> 59 ( 0 treasures)
Map 13B: 61 -> 59 ( 5 treasures)
Map 13C: 66 -> 64 ( 4 treasures)
Map 13D: 70 -> 68 ( 0 treasures)
Map 13E: 70 -> 68 ( 2 treasures)
Map 13F: 72 -> 70 ( 0 treasures)
Map 140: 72 -> 70 ( 0 treasures)
Map 141: 72 -> 70 ( 0 treasures)
Map 142: 72 -> 70 ( 0 treasures)
Map 143: 72 -> 70 ( 0 treasures)
Map 144: 72 -> 70 ( 0 treasures)
Map 145: 72 -> 70 ( 0 treasures)
Map 146: 72 -> 70 ( 10 treasures)
Map 147: 82 -> 80 ( 10 treasures)
Map 148: 92 -> 90 ( 4 treasures)
Map 149: 96 -> 94 ( 6 treasures)
Map 14A: 102 -> 100 ( 2 treasures)
Map 14B: 104 -> 102 ( 1 treasures)
Map 14C: 105 -> 103 ( 2 treasures)
Map 14D: 107 -> 105 ( 2 treasures)
Map 14E: 109 -> 107 ( 2 treasures)
Map 14F: 111 -> 109 ( 2 treasures)
Map 150: 113 -> 111 ( 3 treasures)
Map 151: 116 -> 114 ( 1 treasures)
Map 152: 117 -> 115 ( 1 treasures)
Map 153: 118 -> 116 ( 1 treasures)
Map 154: 119 -> 117 ( 2 treasures)
Map 155: 121 -> 119 ( 2 treasures)
Map 156: 123 -> 121 ( 0 treasures)
Map 157: 125 -> 121 ( 0 treasures)
Map 158: 125 -> 121 ( 0 treasures)
Map 159: 125 -> 121 ( 0 treasures)
Map 15A: 125 -> 121 ( 0 treasures)
Map 15B: 125 -> 121 ( 2 treasures)
Map 15C: 127 -> 123 ( 2 treasures)
Map 15D: 129 -> 125 ( 0 treasures)
Map 15E: 129 -> 125 ( 0 treasures)
Map 15F: 129 -> 125 ( 0 treasures)
Map 160: 129 -> 125 ( 0 treasures)
Map 161: 129 -> 125 ( 0 treasures)
Map 162: 131 -> 125 ( 0 treasures)
Map 163: 131 -> 125 ( 0 treasures)
Map 164: 131 -> 125 ( 3 treasures)
Map 165: 134 -> 128 ( 0 treasures)
Map 166: 134 -> 128 ( 0 treasures)
Map 167: 134 -> 128 ( 0 treasures)
Map 168: 134 -> 128 ( 1 treasures)
Map 169: 135 -> 129 ( 3 treasures)
Map 16A: 138 -> 132 ( 3 treasures)
Map 16B: 142 -> 135 ( 2 treasures)
Map 16C: 144 -> 137 ( 5 treasures)
Map 16D: 150 -> 142 ( 4 treasures)
Map 16E: 154 -> 146 ( 0 treasures)
Map 16F: 154 -> 146 ( 2 treasures)
Map 170: 156 -> 148 ( 2 treasures)
Map 171: 158 -> 150 ( 2 treasures)
Map 172: 160 -> 152 ( 0 treasures)
Map 173: 160 -> 152 ( 0 treasures)
Map 174: 160 -> 152 ( 1 treasures)
Map 175: 161 -> 153 ( 2 treasures)
Map 176: 163 -> 155 ( 1 treasures)
Map 177: 164 -> 156 ( 1 treasures)
Map 178: 165 -> 157 ( 1 treasures)
Map 179: 166 -> 158 ( 0 treasures)
Map 17A: 166 -> 158 ( 1 treasures)
Map 17B: 167 -> 159 ( 0 treasures)
Map 17C: 168 -> 159 ( 0 treasures)
Map 17D: 168 -> 159 ( 2 treasures)
Map 17E: 170 -> 161 ( 0 treasures)
Map 17F: 170 -> 161 ( 0 treasures)
Map 180: 169 -> 161 ( 0 treasures)
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #754 on: March 21, 2014, 09:36:07 AM »
So if I'm reading this right then the original game, at a few particular spots, increases the "treasure index" byte by an amount not equal to the amount of treasures in the previous map.
This occurs at:
Code: [Select]
0A8 by +002
0AF by +003
0B0 by +002
120 by +001
13B by +001
157 by +002
162 by +002
16B by +001
16D by +001
17C by +001
180 by -001

I see no discernible pattern.
Seems this would indicate that this byte has some second, as-yet-undiscovered, significance.

For the sake of a working FF4kster, might it help to change the way it calculates this byte?
Say, instead of counting total treasures per location and assigning potentially brand new values to each location's treasure index... maybe logging the changes made in the current session and increasing the existing value for every relevant (subsequent, within the same 0x100) map?

Granted, I'm not a programmer, so I have no idea how feasible this idea would be.

Alternatively, you could take these particular discrepancies into account and try simply implementing them after the initial calculations are done.

avaquizzer

  • Mist Dragon
  • *
  • Posts: 1
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #755 on: March 21, 2014, 10:08:00 AM »
I had a thought, though it might very well be completely unrelated.  If so, please forgive my ignorance.  Also, since this is my first post, "Hello everyone!"

I recall reading (on the website http://arcanelore.net/articles/ff4wrong/  at the very bottom) that there are several "treasures" in the game that aren't really treasures at all.  And the first one of these occurs in the Tower of Bab-il (although, on floor 7F, not B1F).  The second one occurs in the Sealed Cave, which is in the underground (and PinkPuff mentions that this screwy treasure index problem seems to occur in the Tower of Bab-il, and again in the underworld).  Could this be the source of the error?

I just want to say, I've been following this website for quite some time and am really impressed with the progress being made on hashing out all of the behind-the-scenes stuff of my favorite game.  I'm also impressed with the statistical regressions of LordGaramonde.  Just to give some background, I'm a math and computer science teacher (though I only know the very basics of CS, not nearly as much as PinkPuff or the hex-editing community here; I basically teach an AP CS course using Java so we stay away from memory management).  I just find this project absolutely fascinating.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #756 on: March 21, 2014, 10:37:46 AM »
I see no discernible pattern.
Seems this would indicate that this byte has some second, as-yet-undiscovered, significance.

Either that or, something happened at some point during development (maps were moved around or rearranged entirely, treasures removed, etc) and the treasure index was not updated and it still expects those "ghost chests" to be accounted for.

However I kinda suspect that you're right, it could be affecting something else that we don't know about. Like, why would the graphics glitch from a simple treasure pointer misalignment... ??? You would think it would just cause screwy treasure contents or maybe some of the other triggers to mess up, like teleporters or event triggers.

For the sake of a working FF4kster, might it help to change the way it calculates this byte?
Say, instead of counting total treasures per location and assigning potentially brand new values to each location's treasure index... maybe logging the changes made in the current session and increasing the existing value for every relevant (subsequent, within the same 0x100) map?

Granted, I'm not a programmer, so I have no idea how feasible this idea would be.

Alternatively, you could take these particular discrepancies into account and try simply implementing them after the initial calculations are done.

I think I'll try the second one; sounds like the same result but easier. Hopefully it won't mess anything else up.
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #757 on: March 21, 2014, 10:43:17 AM »
hmm... that's pretty curious, avaquizzer (and, welcome!).

Yep, it looks like each of those maps are on the list of those that precede index oddities.
In order to determine from the index above which map has the "wrong" amount of treasures accounted for, you would subtract 2 from its map index - one because the treasure index references the amount of treasures from the previous map, and one because Pinkpuff started counting at 001 instead of 000.
The others are inaccessible maps (backgrounds, foregrounds, etc.), with the exception of I believe one save point room (perhaps there are a few undiscovered hidden treasures?).

Each is also located "within" a trigger point, it seems (so approaching the trigger point like a chest yields the treasure, instead of standing on it). I'd be willing to bet the parameters of the treasures collected match those of the teleport or event call.

Most likely though, these hidden treasures are an unintentional byproduct of the index oddities.

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #758 on: March 21, 2014, 11:53:00 AM »
This is interesting... if I don't change the treasure index of the final map... no graphical glitches!

Current version posted, let me know if it messes up for you guys now. And if it doesn't, let me know if adding/removing treasures works correctly.
Let's dance!

JCE3000GT

  • Master of FF4
  • *
  • Posts: 1,425
  • Gender: Male
  • Vladof
    • View Profile
    • BlitzKrieg Innovations
Re: Developing a comprehensive editor for FF4
« Reply #759 on: March 21, 2014, 01:49:51 PM »
I came in here about to post some stuff but seems my input wouldn't be as helpful as chilyfeez's.  I'll test the app this evening when I have time to sit down in front of the computer.  :)

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #760 on: March 22, 2014, 11:22:36 AM »
Well, granted that my ability to test is limited by knowledge of which RAM bits to change in order to unlock certain locations or my patience to change things in FF4kster in order to circumvent said limitations, but it seems like things are working perfectly from what I can tell.
 :cookie: for you!

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #761 on: March 25, 2014, 06:58:19 AM »
Updated again! This time... ...

... ... wait for it ... ...

ITEM DESCRIPTIONS!!

Here's how it works: In the Features editor you can change the range of items that have descriptions. In the Messages editor, you can edit what the descriptions themselves say (their text). In the editors for the various kinds of items, you can edit which item has which description index, if that item is within the range of items that have descriptions. It will be in the same box with the name and other misc info.

As usual, have at 'er and let me know what kinds of horrible game-destroying bugs I've introduced this time ^_^;
Let's dance!

Grimoire LD

  • FF4 Hacker
  • *
  • Posts: 1,682
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #762 on: March 25, 2014, 04:22:47 PM »
Wonderful! Sorry I haven't been around lately. My free time has been Absorbed by Bravely Default (A more apt love-letter to FF and FF4 in particular I've never seen, with similar themes in some respects I would urge any fans of classic FF to pick this gem up) but just beat it yesterday. Just in time for Dynasty Warriors 8 Xtreme Legends. I will test the editor and see if all the new portions work correctly.

 :edit: Whoa ho! 60 Descriptions available?! I was not counting on that by any means! Unfortunately, though you can give description assignments to weapons and armor, they don't actually show up because it seems the extra message box isn't called for those items, I think Lenophis posted a fix for this at one point... I'd have to take a look.

Looks like switching around labels and descriptions works fine. Fantastic update Pinkpuff! And there's room to spare because the vast majority of the text is "Dummy" rather than "D".

 :edit: 2: http://slickproductions.org/forum/index.php?topic=1804.msg20683#new Ahem... right. Seems I should learn to read. I'll try that out now then as well.

Yes indeed! They work great! You could give specific descriptions to anything you like now! Excellent job PinkPuff!
« Last Edit: March 25, 2014, 04:36:29 PM by Grimoire LD »

Pinkpuff

  • Flan Princess
  • *
  • Posts: 923
  • Find a Megalixir in Unprecedented Crisis!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #763 on: March 26, 2014, 05:47:33 AM »
 :childish: Yay for things working correctly!

I should warn though that there is currently no safeguard for data bleeding with the item descriptions, so be careful not to be too verbose...
Let's dance!

chillyfeez

  • FF4 Hacker
  • *
  • Posts: 1,234
  • Gender: Male
  • Go ahead, ask me about Angel Feathers!
    • View Profile
Re: Developing a comprehensive editor for FF4
« Reply #764 on: March 26, 2014, 08:42:24 AM »
I was wondering about that. Good to know.