Advertisement
entrpntr

buffered vs unbuffered saves

Feb 5th, 2018
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.59 KB | None | 0 0
  1. [11:26 PM] Exarion: [unknown] pokemonred40.dem 5.55 KB
  2. [11:26 PM] Exarion: ^failure from 00:05:07:52 with u-->U npc
  3. [11:28 PM] Exarion: and I just played the demo that generated a successful manip earlier, and it also got that failure from the same save file
  4. [11:31 PM] Exarion: and I redownloaded the successful save file that I posted on monday, then ran pokemonred3.dem through that, and it did not fail
  5. [11:31 PM] Exarion: so unless I am blanking on something, it has to be a save file difference, not printletterdelay
  6. [11:43 PM] entrpntr: agree with it being a save file difference
  7. [11:43 PM] entrpntr: exciting!
  8. [11:44 PM] entrpntr: everything is exactly the same on the first joypad hit in overworld after Nido catch
  9. [11:44 PM] entrpntr: it is diverging before entering Viridian gate
  10. [11:45 PM] entrpntr: C4 54 vs C7 53 for hra+hrs, internal divider is the same
  11. [12:00 AM] entrpntr: it is diverging when reloading first Viridian NPC
  12. [12:00 AM] entrpntr: lollolokl
  13. [12:00 AM] entrpntr: @Dabomstew
  14. [12:01 AM] Dabomstew: where could that possibly be stored
  15. [12:05 AM] Dabomstew: some old data must somehow be getting used
  16. [12:32 AM] entrpntr: ya, I didn't see anything that would be different, but I may very easily have overlooked something
  17. [12:36 AM] entrpntr: I just broke on 0:0F4D (joypadOverworld) until I found the divergence
  18. [12:36 AM] entrpntr: and it was a tile after NPC gets loaded (first tile his sprite is visible, at least with that breakpoint)
  19. [12:37 AM] entrpntr: 57 06 vs 56 06
  20. [12:38 AM] entrpntr: being hra+hrs at the first joypadOverworld with divergence
  21. [12:51 AM] entrpntr: sprite data at that point is also not the same
  22. [12:52 AM] Dabomstew: what fields differ
  23. [12:55 AM] entrpntr: C119; C102, C107, C108, C302, C306, C30A, C30E
  24. [12:55 AM] entrpntr: so, mostly players, and what I think is NPC's step counter (which wouldn't be surprising)
  25. [12:55 AM] entrpntr: first thought was that it might be buffered vs unbuffered save but idk
  26. [12:57 AM] entrpntr:
  27.  
  28. C10x (S) -- 01 00 0E 00 3C 01 40 03 02 0C 40 40 00 00 00 00
  29. C30x (S) -- 4C 50 08 20 4C 48 09 20 54 50 0A 22 54 48 0B 23
  30.  
  31. C10x (F) -- 01 00 0F 00 3C 01 40 00 03 0C 40 40 00 00 00 00
  32. C30x (F) -- 4C 50 88 20 4C 48 89 20 54 50 8A 22 54 48 8B 23
  33.  
  34. [12:58 AM] entrpntr: post-divergence, maybe I didn't pay close attention at what was going on pre-
  35. [1:04 AM] entrpntr: yeah I think it's buffered vs unbuffered
  36. [1:05 AM] entrpntr: and that must only matter when you load other sprites
  37. [1:06 AM] entrpntr: failure is on the buffered save
  38. [1:09 AM] Dabomstew: it's the very first random call after the last matching joypadoverworld
  39. [1:09 AM] Dabomstew: being called 22 cycles later
  40. [1:22 AM] Dabomstew: unbuffered arrives at UpdateNPCSprite later
  41. [1:22 AM] Dabomstew: checking more stuff
  42. [1:26 AM] Dabomstew: confirmed that it is a divergence in UpdatePlayerSprite (okay, that wasn't exactly rocket science)
  43. [1:33 AM] Dabomstew: oh it's actually 44 cycles not 22
  44. [1:33 AM] Dabomstew: derped on the internal divider stuff
  45. [1:33 AM] Dabomstew: in any case
  46. [1:34 AM] Dabomstew: the divergence for this specific part is caused by hitting or missing this https://github.com/pret/pokered/blob/46a94c63fc287e7290502776d02648476bc44171/engine/overworld/movement.asm#L71
  47. [1:34 AM] Dabomstew: failure (buffered) takes the jump, success (unbuffered) doesn't and spends 44 additional cycles
  48. [1:34 AM] Dabomstew: what it actually means is quite another question
  49. [1:37 AM] Dabomstew: but it should imply a ~44/256 chance of an RNG divergence between buffered and unbuffered for each NPC timer reset
  50. [1:39 AM] Dabomstew: the crucial bit of state being c107
  51. [1:45 AM] Dabomstew: just means that yes: buffered vs non-buffered matters for everything
  52. [1:46 AM] Dabomstew: unless you are doing a manip in an npcless environment
  53. [1:46 AM] Dabomstew: but it also means that it is 100% reasonable that a manip does not show any signs of buffered vs non-buffered mattering even if it does load a few NPCs
  54. [1:58 AM] entrpntr: yeah and for Moon it probably only matters until the first ladder
  55. -
  56. [11:44 PM] gifvex: the difference between un/buffered saves is d528 wPlayerMovingDirection being zero (unbuffered) vs nonzero (buffered)
  57. [11:45 PM] gifvex: it causes c107 PlayerIntraAnimFrameCounter to start at a different value and take the jump @Dabomstew noted previously at a different time https://github.com/pret/pokered/blob/46a94c63fc287e7290502776d02648476bc44171/engine/overworld/movement.asm#L71
  58. [11:46 PM] gifvex: in fact since it's an anim counter, the difference could have been seen this whole time (these are same frame of a demo playback from un/buffered saves) http://imgur.com/a/ZG4Xd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement