Vermilion Gym: Difference between revisions

every other row is read misaligned because the bytes get read in pairs but there are 9 bytes per row. So the first 10 pairs for the top can are (3,7)(7,9)(9,3)(-1,-1)(4,4)(8,6)(10,8)(4,10)(6,3)(5,7) etc.
(→‎Generation I: I hope my math isn't off...)
(every other row is read misaligned because the bytes get read in pairs but there are 9 bytes per row. So the first 10 pairs for the top can are (3,7)(7,9)(9,3)(-1,-1)(4,4)(8,6)(10,8)(4,10)(6,3)(5,7) etc.)
Line 53: Line 53:
====={{game|Red and Blue|s}}=====
====={{game|Red and Blue|s}}=====
* The first switch can be in one of eight cans, forming a checkerboard pattern starting from the corners.
* The first switch can be in one of eight cans, forming a checkerboard pattern starting from the corners.
* If the first can was one of the two in the middle column that has three neighbors:
* If the first can was one of the two in the middle column (with three neighbors):
** Due to a glitch, the three neighboring cans each have a 25% chance of containing the second switch and the top-left can has a 25% chance (even though it is not adjacent).
** Due to a glitch, the three neighboring cans each have a 25% chance of containing the second switch and the top-left can has a 25% chance (even though it is not adjacent).
* If the first can was one of the other six (that have two or four neighbors):
* If the first can was one of the other six (with two or four neighbors):
** Due to a second glitch on top of the first glitch, there is a 50% chance that the can to the right contains the second switch, and a 50% chance that it is the top-left can. (If there is no can to the right, the 50% chance belongs to the only adjacent one in the same column.) The other one or three neighbors will never contain the second switch.
** Due to a second glitch on top of the first glitch, there is a 50% chance that the can to the right contains the second switch, and a 50% chance that it is the top-left can. (If there is no can to the right, the 50% chance belongs to the only adjacent one in the same column.) The other one or three neighbors will never contain the second switch.


Line 64: Line 64:
* If the first can was one of the four corners:
* If the first can was one of the four corners:
** There is a 25% chance that one neighbor contains the second switch, a 25% chance that the other neighbor contains the second switch, and a 50% chance that both neighbors contain the second switch (in which case either choice will unlock the door).
** There is a 25% chance that one neighbor contains the second switch, a 25% chance that the other neighbor contains the second switch, and a 50% chance that both neighbors contain the second switch (in which case either choice will unlock the door).
* If the first can was the one in the second row:
* If the first can was the one in the second column:
** There is a 50% chance that the west and north neighbors both contain the second switch, a 25% chance that only the south neighbor contains the second switch, and a 25% chance that only the east neighbor contains the second switch.
** There is a 50% chance that the west and north neighbors both contain the second switch, a 25% chance that only the south neighbor contains the second switch, and a 25% chance that only the east neighbor contains the second switch.
* If the first can was the one in the fourth row:
* If the first can was the one in the fourth column:
** There is a 50% chance that the west and north neighbors both contain the second switch, and a 50% chance that the south and east neighbors both contain the second switch.
** There is a 50% chance that the west and north neighbors both contain the second switch, and a 50% chance that the south and east neighbors both contain the second switch.
* If the first can was the top can of the middle row:
* If the first can was the top can of the middle column:
** Due to yet another glitch, the game attempts to randomly pick from 256 possible pairs of cans for the second switch, most of which correspond to blank neighbor data or data about the neighbors of other cans<ref>https://github.com/pret/pokeyellow/blob/793c715ba253e08d2807d04d128765ca305d6b15/engine/vermilion_gym_trash_cans.asm#L70</ref>. As a result, there is a 220/256 (~86%) chance that only the top-left can has the second switch, a 5/256 (~2%) chance that no can has the second switch at all, and a 31/256 (~12%) chance that either one or two unrelated cans in the four rightmost rows has the second switch (with uneven probability).
** Due to yet another glitch, the game attempts to randomly pick from 256 possible pairs of cans for the second switch, most of which correspond to blank neighbor data or partially-invalid data about the neighbors of other cans<ref>https://github.com/pret/pokeyellow/blob/793c715ba253e08d2807d04d128765ca305d6b15/engine/vermilion_gym_trash_cans.asm#L70</ref>. As a result, there is a 216/256 (~84%) chance that only the top-left can has the second switch, a 2/256 (~0.8%) chance that no can has the second switch at all, and a 38/256 (~15%) chance that either one or two unrelated cans in the four rightmost rows have the second switch (with uneven probability).
* If the first can was the bottom can of the middle column:
* If the first can was the bottom can of the middle column:
** The above glitch applies but with slightly different data, resulting in a 228/256 (~89%) chance that only the top-left can has the second switch, a 4/256 (~1.5%) chance that no can has the second switch at all, and a 24/256 (~9.5%) chance that either one or two unrelated cans in the four rightmost rows have the second switch.
** The above glitch applies but with slightly different data, resulting in a 225/256 (~88%) chance that only the top-left can has the second switch, a 1/256 (~0.4%) chance that no can has the second switch at all, and a 30/256 (~12%) chance that either one or two unrelated cans in the four rightmost rows have the second switch.


====[[Generation II]]====
====[[Generation II]]====
2,613

edits