Editor, Expert player (2364)
Joined: 5/15/2007
Posts: 3940
Location: Germany
I made a complete game map, for 100% planning http://i.imgur.com/KD56h2N.png
TheKDX7
He/Him
Player (118)
Joined: 7/9/2011
Posts: 393
Location: Switzerland
MUGG wrote:
I made a complete game map, for 100% planning http://i.imgur.com/KD56h2N.png
Great MUGG ! :D
Editor, Expert player (2364)
Joined: 5/15/2007
Posts: 3940
Location: Germany
As I mentioned in the submission thread, killing the 3 fly-guys after inserting the keys will yield a star. I thought that getting this star and skipping another, longer one would allow for a faster run. I determined that it takes 555 frames (~9 seconds) additional time to get the 3 fly-guys star. The star in the snake room in the desert takes ~13-14 seconds additional time to get. But by door requirement, you need to be 10 stars before the Boo fight, so you cannot skip the snake star.... unless you play the toad minigame before the Boo fight, instead of after. The game keeps your item even through Save&Quit. It should not lose anywhere near the prospected 5 sec save to visit Toad before instead of after. Another possible improvement would be in the Ice area, if you can manage to move the ice block on the crack at the same time as getting the star.
Editor, Expert player (2364)
Joined: 5/15/2007
Posts: 3940
Location: Germany
I'm actively TASing this game right now, for any% improvement. It is usually possible to sync rooms, but after switching from Bizhawk 1.12.0-mGBA-0.5.0 to Bizhawk 2.3.1-mGBA-0.6.0, it seems nothing will sync anymore. I empirically verified that the 2nd penguin in the 2nd ice room will _always_ bounce into a different direction compared to the previous TAS. So I have to redo all of the rooms and take some time losses (while also possibly finding new time saves). EDIT: 83 frames saved.
Editor, Expert player (2364)
Joined: 5/15/2007
Posts: 3940
Location: Germany
Get key while dropping down. Unfortunately, you won't get the Yoshi egg, so it's too slow. Doing it like in the gif is only 20-30 frames faster exit than Save&Quit. I found a suitable route change, see below. I'm a good 2 seconds ahead in the TAS. ______ Old route: - Ice (get Yoshi egg - used in Desert) - Desert (get Lightning - used in Fun Fair) - Fun Fair (get Lightning - used in Grass) - Grass - Bowser's Castle New route: - Ice (get Yoshi egg - used in Desert) - Grass - Desert (get Lightning - used in Fun Fair) - Fun Fair (get Lightning - used in Bowser's Castle 3 fly-guys room) - Bowser's Castle Not using Fun Fair's Lightning in Grass costs 2.5 seconds, but you will get the 3-fly-guys star immediately, which should save 7 seconds back. ______
Editor, Expert player (2364)
Joined: 5/15/2007
Posts: 3940
Location: Germany
I was rewatching my TAS and figured out an improvement that I verified in a quick testing. In the room with the 4 penguins and the 1 ice block, if the ice block is pushed to the hole at the same time you get the star, the delays will overlap. It saves at least 90 frames, but I'm sure the fight itself could be further improved to save up to 200 frames. https://www.youtube.com/watch?v=XTaOCJ_ULJA
Editor, Expert player (2364)
Joined: 5/15/2007
Posts: 3940
Location: Germany
I think we should try to bruteforce the game. Every room is basicly separate from each other and the ball can only be influenced by the flippers. It is a similar case like Chef Stef's Arkanoid, with one level at a time (one room at a time) needing a few interactions by the platform (the flippers). Here is a (not detailed, just pseudo-) explanation on how the flippers behave in this game. Each flipper can have about ~10 "altitudes". When the button is pressed, it moves up by like 3 altitudes until the max is reached. If it is let go, it moves down by 2 altitudes. So by pressing F1: A F2: F3: A you can reach a different collision with the ball compared to if you pressed F1: A F2: A F3: A Once the ball is outside the reach of the flippers, it will always move the same and cannot be influenced. There is no "bouncing the table" in this game and pausing doesn't change anything. There is some RNG or frame rules involved, so you cannot always hex-edit in your previous rooms. But that doesn't really prevent you from brute-forcing one room at a time. With what I described above, there are not that many possibilities compared to Arkanoid, so I think we can get away with running a luascript on the game rather than programming a bare bones version of the game like Chef Stef did. I will investigate RAM addresses that can be used for deciding or for goals. Also I will look for the flippers altitude addresses. The bruteforce script itself I will need help. Is anyone interested in helping? Or any guides?
Editor, Expert player (2364)
Joined: 5/15/2007
Posts: 3940
Location: Germany
RAM addresses (possibly useful for brute-forcing) ---------------------------- It seems each of the two flippers can have one of 10 possible altitudes when colliding with the ball. The transition mode address could be used as a finishing point. This list will be updated as I make more findings. Needed: - collision/hitbox related addresses or anything that can be used for figuring out if the ball is touching a flipper, - "star get" delay or anything that tells us we are getting a star / starkey - anything related to "if a star exists", "if a star is descending or ascending", "if a star is grabbable", "star position" - yellow coins / blue coins ----------------------------- IWRAM $14AC Left Flipper Altitude (4-Byte) $14B0 Right Flipper Altitude (4-Byte) $14BC Left Flipper rising speed or something? (4-Byte) $14C0 Right Flipper rising speed or something? (4-Byte) Somewhere around here is also an address for each flipper that makes the ball receive speed if non-zero, but it is always zero. Maybe written to and cleared in-between frames.
$14AC and $14B0 possible values / achieved fastest how:
0x000000

0x00000A	
F1: L
F2: L
F3: L
F4:
F5:
F6:
F7:

0x0AAAA8	
F1: L
F2: 

0x0AAAB2	
F1: L
F2: L
F3: L
F4:
F5:
F6:

0x155550	
F1: L

0x15555A	
F1: L
F2: L
F3: L
F4:
F5:

0x1FFFF8	
F1: L
F2: L
F3:

0x200002	
F1: L
F2: L
F3: L
F4:

0x2AAAA0	
F1: L
F2: L

0x2AAAAA	
F1: L
F2: L
F3: L
$6540 Transition mode (1-Byte)
possible values:
13: None
10: Down
11: Start Credits
12: Title Screen
0: UpLeft
1: Up
2: UpRight
3: World Select
$6532 Ball Size (1-Byte)
12: Mini
19: Normal
28: Big
$6514 Ball X-Pos (4-Byte) $6518 Ball Y-Pos (4-Byte) $651C Ball Z-Pos (4-Byte) $6524 Ball X-Speed (4-Byte) $6528 Ball Y-Speed (4-Byte) $652C Ball Z-Speed (4-Byte) $6558 4 Byte Ball Spin Amount $0014 1 Byte Total Stars $1484 1 Byte Cannon State Somewhere around this may be addresses related to door open/closed state
Possible values:
0: Doesn't Exist
1: Normal
2: Open
3: Opening
4: Closing
$0200 1 Byte Cannon is pulling your ball?
Possible values:
0: No
1: Yes
$000C 1 Byte Current Blue Coins (On the first room, $0200 must be frozen to 0 and $000C to 0 to make L+R presses not reset the cannon and make the ball not enter the toad's tent, if running Basic Bot in Bizhawk.)
Editor, Expert player (2364)
Joined: 5/15/2007
Posts: 3940
Location: Germany
I started working on a luascript. Before I can finish it, it should be researched what outcomes are possible and should be tested. Things to consider:
  • Not counting B-Button item, there are four possible inputs you can do. none none Left none none Right Left Right
  • More importantly, as said before, there are 10 possible altitudes each flipper can have. It takes a few frames until your flipper can have a certain altitude, the longest one taking 7 frames.
  • Keep running the game until 7 frames before the ball is in reach, then start using the input combinations required to obtain each of the 10 altitudes.
  • After you've done that, an additional flipper press can influence the ball further.
  • After you've done that, the other flipper should also have its altitude set up via the 10 input combinations.
  • Assuming you would say "all bets are off after that" and you rely on running the 4 possible inputs each frame, if my math is not wrong that means: (10 input sequences to reach the altitudes * 2 press or no press after touching the flipper) ^ 2 because two flippers (10 * 2) ^ 2 = 400 outcomes and then 400*4^number of frames the ball is in reach of flippers so 400*4^1 = 1600 outcomes for the first subsequent frame 400*4^2 = 6400 outcomes for the second subsequent frame 400*4^3 = 25600 outcomes for the third subsequent frame 400*4^4 = 102400 outcomes for the fourth subsequent frame 400*5^5 = 409600 outcomes for the fifth subsequent frame etc. This is a bad approach, since it blindly runs inputs. We should consider the flipper's altitudes and when the ball is going to reach the flipper's area of effect, instead.
  • Furthermore, some altitudes are so close to each other, we might get away with ignoring some. Needs testing. But... 0x00000A is close to 0x000000 0x0AAAA8 is close to 0x0AAAB2 0x155550 is close to 0x15555A 0x1FFFF8 is close to 0x200002 0x2AAAA0 is close to 0x2AAAAA Maybe it's possible to reduce the altitudes to 5. Then the above math would look like this; (5 * 2) ^ 2 = 100 outcomes 400 outcomes on the first subsequent frame 1600 outcomes on the second subsequent frame 6400 outcomes on the third subsequent frame 25600 outcomes for the fourth subsequent frame etc.
I will keep testing and researching.
Editor, Expert player (2364)
Joined: 5/15/2007
Posts: 3940
Location: Germany
Started work on the lua. As expected, the memory address nearby the flipper addresses is used for applying speed to the ball. The address $14b4 (IWRAM) is written to 4 times per frame with value 1 when the key for the left flipper is pressed. I found that flippers will move differently after a screen freeze (star get, extra ball get, pressing a switch in the pyramid etc.) Example: 1) Hold flipper to the maximum 2) Get star 3) Let go of the flipper's key and wait 4) Notice the flipper will descend differently (will attain different values than otherwise possible) This makes things more complicated :P
Editor, Expert player (2364)
Joined: 5/15/2007
Posts: 3940
Location: Germany
It's not only the flipper's altitude that matters but also its velocity. Although it is possible to write a script that predicts all the math, I think it may be a bit too difficult for me. We need the flipper's hitbox data. (Note that US version has less Z-Height on flipper, if that info helps finding the data...?) With that said, I could do a simplified script but it may or may not work out. I will keep trying. My thought process so far:
(1)   Move the ball 7F before it reaches inside the flipper's area of effect for the first time.

(2)    Save state A.

(3)    Try different inputs so the flipper collides with ball in different ways
        (Previously I considered only the 10 possible flipper positionings (called "altitude" before)
         but we should consider how the ball is hit, from positioning A in one frame to positioning B in the next frame - refered to as "velocity" above.)

        After the tried input, brute force for as long as the ball is still inside the flipper. 
       (2^10 is only 1024 tries for 10 frames of trying pressing or not pressing the flipper, so this is ok.)

        After the ball leaves the flipper's area of effect, check if we reached a new scenario (ball in different position, different speed, etc.) and if yes, save state B.
        After the flipper last collides with the ball, there should be no more input.
        
(4)   For each saved state B, let ball reach to 7F before any flipper and repeat from (1)

       or if there is less than 7F before reaching the next flipper, rewind to state A in read-only and let it run to 7F before the next flipper from there,
       repeat from (1) while replicating the input of the previous flipper.

---

After each frame, check winning conditions. Examples:
- Star key count increased
- Exit reached

After each frame, check losing conditions. Examples:
- Ball reached an undesired transition (i.e. wrong exit)
- Star count below a certain pre-set after certain frame count
- Door to the next room closed after certain frame count
- Fastest record time exceeded
- Ball is too far up in the room after a certain framecount - meant to reduce on unnecessary attempts where ball is not going to be near the exit
- Ball is too low in the room after a certain frame count - meant to reduce on unncessary attempts where ball is not going to be near the exit
- Enemy not hit after certain frame count
- Yellow Coins lower than certain pre-set after certain frame count
- Blue Coins lower than certain pre-set after certain frame count
- (...)

If winning condition is reached and it beats the previous fastest time, then save a state and update the fastest time variable (that is checked by "losing condition: fastest record time exceeded"). Then discard the current attempt.

If losing condition is reached, discard the current attempt.
Editor, Expert player (2364)
Joined: 5/15/2007
Posts: 3940
Location: Germany
Complete list of possible flipper altitudes achievable either directly or after one screen freeze
Possible Flipper AltitudeNo.Achieved by
0x00000001- - - - - - - - - - - L - - L L L - - - - -
0x00000A02L L L - - - -
0x02AAAA03Achievable after screen freeze while flipper is 0x0AAAA8
0x02AAB404Achievable after screen freeze while flipper is 0x2AAAAA Achievable after screen freeze while flipper is 0x0AAAB2
0x05555405Achievable after screen freeze while flipper is 0x000000
0x05555E06Achievable after screen freeze while flipper is 0x00000A
0x0AAAA807- - - - - L - - - L L - - -
0x0AAAB208- L L L - - -
0x0D555209Achievable after screen freeze while flipper is 0x0AAAA8 Achievable after screen freeze while flipper is 0x155550
0x0D555C10Achievable after screen freeze while flipper is 0x2AAAAA Achievable after screen freeze while flipper is 0x15555A
0x0FFFFC11Achievable after screen freeze while flipper is 0x000000
0x10000612Achievable after screen freeze while flipper is 0x00000A
0x15555013- - - - - - L - - - L L - -
0x15555A14- - L L L - - L L L - - - - L
0x17FFFA15Achievable after screen freeze while flipper is 0x0AAAA8 Achievable after screen freeze while flipper is 0x1FFFF8
0x18000416Achievable after screen freeze while flipper is 0x2AAAAA Achievable after screen freeze while flipper is 0x200002
0x1AAAA417Achievable after screen freeze while flipper is 0x000000 Achievable after screen freeze while flipper is 0x0AAAA8
0x1AAAAE18Achievable after screen freeze while flipper is 0x00000A Achievable after screen freeze while flipper is 0x0AAAB2
0x1FFFF819- - - - L L - - - - - L - L
0x20000220- - - L L L - L L L - - - L
0x22AAA221Achievable after screen freeze while flipper is 0x0AAAA8 Achievable after screen freeze while flipper is 0x2AAAA0
0x22AAAC22Achievable after screen freeze while flipper is 0x2AAAAA
0x25554C23Achievable after screen freeze while flipper is 0x000000 Achievable after screen freeze while flipper is 0x155550 Achievable after screen freeze while flipper is 0x1FFFF8
0x25555624Achievable after screen freeze while flipper is 0x00000A Achievable after screen freeze while flipper is 0x15555A
0x2AAAA025- - - - - L L
0x2AAAAA26- - - - L L L