Author Topic: Infinite Pauses: Myth or Reality?  (Read 7637 times)

0 Members and 1 Guest are viewing this topic.

Offline xelnia

  • Administrator
  • Spring Jumper
  • *
  • Posts: 2803
  • Stop using 0.106
    • Twitch
    • Awards
Infinite Pauses: Myth or Reality?
« on: May 22, 2018, 05:50:46 am »
The idea that it's possible to force Kong to pause permanently between barrel releases has been bandied about for years, generally attributed as a Jeff Willms idea. If possible, it would have two major ramifications: the possibility of an infinite score and the possibility of passing the killscreen and reaching 22-6. An infinite score would be possible by forcing Kong to pause indefinitely, allowing the player to leech the fireball(s) for as long as they wanted. Forcing Kong to pause would also give the player enough time to pass the killscreen. The pie and spring boards have a slower timer, akin to level 22 on Crazy Kong, and are passable. There still would not be enough time to pass the rivet screen, so 22-6 would become the ultimate killscreen. This is all TAS-level stuff, so not useful in regular play, but interesting nonetheless.

However...

After extensive testing, I'm beginning to think the infinite pause is not possible. The general idea is that you would manipulate the game's RNG, using some combination of inputs, to force Kong to pause. But as far as I can tell, there is no direct RNG element used in determining the barrels releases. There are series of timers involved in the process, but I see no call to the RNG in any of the instructions involved. Admittedly I'm a novice in the code-reading, but even trying to alter the RNG through inputs has failed me. To be clear, I'm talking about actual player inputs...not manipulating the game/memory through a debugger or lua script.

So, DKF, two requests:

1) I'd like to see a 100% comprehensive description of the barrel release/barrel timer/Kong pause process. Code-level analysis, flow charts, plain English...anything and everything it takes to suss it out.

2) An actual demonstration of an infinite pause, if possible. Some kind of proof-of-concept INP that can be played back in vanilla MAME. Show me it can be done...because I can't do it.

readygokthxbye <3
"Do not criticize, question, suggest or opine anything about an upcoming CAG event, no matter how constructive or positive your intent may be. You will find nothing but pain and frustration, trust me. Just go, or don't go, and :-X either way!" -ChrisP, 3/29/15
Member for 11 Years snek CK Killscreener DK Killscreener Blogger Twitch Streamer

Offline Sock Master

  • Elite Member
  • *
  • Posts: 375
    • Awards
Re: Infinite Pauses: Myth or Reality?
« Reply #1 on: May 22, 2018, 03:25:39 pm »
Without getting into code, I guess the best way to describe it would be with an analogy.
(And this code is a bit of a nightmare to follow let alone explain it, even for me)

There are a few memory locations for timers and sequencing barrel releases from $6390 to $6393.  Lets just think of them as gears, each with one peg that sticks out... when it does a full rotation that peg can hit a mechanism to engage the next gear and start it into motion...   (This analogy isn't technically correct but good enough for the idea...)

Lets say the first gear rotates continuously, but the other gears stay in their home positions until the peg hits them to start them into motion.   The first gear may change speed depending on the game's internal difficulty but it always  rotates continuously even during a hammer smash animation.   It only hits 'home position' once every rotation, and it's only at that time that it can engage the next gear into motion.

If the 2nd gear is already at home position it will start turning when triggered.   If it was already in a different position when the 'peg' of the previous gear strikes there is no effect (the 2nd gear is already engaged.)

The second gear will take a certain amount of time to complete full rotation/sequence but it's timing might not be aligned with the rotation of the 1st gear..  also when there's a hammer smash, the animation pauses game logic and this gear stops turning during that time while the 1st gear continues spinning.

Once the 2nd gear has completed its rotation it stops when it reaches the home position and will only start into motion again if the first gear hits home position.

If the 1st gear hit home position before the 2nd gear reached home position, the 1st gear will have to make another rotation before it can engage the second gear into motion again.

Then sometimes starting the 2nd gear into motion will be delayed.  But since the 1st gear never stops, it will set the 2nd gear into motion the next time it completes a rotation.

It's the interplay between these desynchronized sequencers that causes randomness in the timing.

A couple of extra complexities; If all 10 barrel slots are full, the 2nd gear will stop right before 'home position' and wait there until a barrel slot is freed (one of the barrels exits the screen.)   So if there are 10 barrels, Kong will never start the sequence to release an 11th.

Smashing something with the hammer might also affect synchronization because the game effectively pauses during the smash animation but some timers keep on rolling.. if they roll past 'home' position during the smash, nothing gets triggered until the next time they reach home position.
« Last Edit: May 22, 2018, 03:29:39 pm by Sock Master »
"Badges? We ain't got no badges. We don't need no badges. I don't have to show you any stinkin' badges!"
Member for 8 Years snek Twitch Streamer

Offline guwu

  • New Member
  • *
  • Posts: 16
    • Awards
Re: Infinite Pauses: Myth or Reality?
« Reply #2 on: May 23, 2018, 12:13:24 pm »
 <confused>
DK (MAME): 270,400
DK (MAME) Start: 102,800
DK (MAME) 1-1: 9,600
Member for 6 Years

Offline danman123456

  • Spring Jumper
  • *
  • Posts: 810
    • Twitch TV Stream
    • Awards
Re: Infinite Pauses: Myth or Reality?
« Reply #3 on: May 24, 2018, 06:45:00 am »
So on the realm of "nothing is truly impossible" simply because there is so much we dont know gonna have to say this is a myth. Is there some crazy combination of inputs that if done at exactly the right frames you could somehow trigger this? Yeah sure its possible but i dont think its practical so naw this will never happen :D
DK High : 1,059,700 (Lvl 22-1 KS!);
DK KS Speedrun : 1 Hr 16 Min 40 Sec - World Record!
DK Lvl 1 - 1: 12,400
Fix-It Felix Jr - 297,000 (World Record)
Fix-IT Felix Jr 1 Hour Limit - 177,000
Fix-It Felix Jr KS Speedrun - 1h33
Member for 11 Years DK 1M Point Scorer DK Killscreener CK Killscreener Blogger

Offline up2ng

  • Senior Member
  • *
  • Posts: 242
    • Awards
Re: Infinite Pauses: Myth or Reality?
« Reply #4 on: May 24, 2018, 07:05:47 am »
Hi Xelnia,

I'll add to sock's analogy with some more concrete descriptions of how I remember this working from when Jeff and I were looking into this years ago.

The first key detail is that rng does not come into play for barrel release until the barrel screen is half way finished (half of the total number of barrels have already been released).  Believe it or not, I think that the programmers were actually trying to simulate Kong getting "tired" after releasing so many barrels.  So, if you are using a Level 5 save state, make sure that you are testing the screen while the Timer is below 4000.

Now for more details.  It takes Kong exactly 97 frames to complete his "cycle" of releasing a barrel (except wild barrels and during hammer smashes, which I will ignore).  Internally, there is this 32 frame counter which loops around and around from 31 to 0.  Note that 32 x 3 equals 96.  That's important.  Next, assuming Level 5, if Kong is "ready" to begin a new cycle while the frame counter reads 4, 3, 2, 1, or 0 then he will do so.  If it's some other number, say, 17, then Kong will do nothing on this frame and check again on the next frame (and will continue this every frame until the counter reads 4. 

Notice that if Kong releases a barrel at 4, the next time that he is ready the counter will be at 3 due to his 97 frame cycle, and after Kong releases 5 barrels in a row (on the early portion of Level 5), the counter will then roll back to 31.  While Kong waits for the frames to go by until the counter gets all the way back down to 4, he "pauses" briefly, causing a noticeable change in barrel spacing.

Next, once Kong gets tired, every time the counter lands on 4, 3, 2, 1 or 0, an extra rng-based check now occurs where there is a 50/50 chance that the frame will be skipped.  So, during this time, instead of 5 barrels in a row being released, Kong will release a variable number of barrels in a row, typically about 2 or 3.  In the rare event that all 5 of the frames are skipped, a "long pause" will occur while Kong waits for the counter to progress from 31 back to 4 again (twice in a row).

Lastly, any time an rng-based check occurs, the result can and often will change based on player input.  This can easily be seen with save states.  Save a state a few frames before a fireball crosses a ladder from left to right.  Upon loading the state, if the player does no input, the fireball will have the same behavior every time (let's say, it passes by the ladder).  But if the state is loaded and the player immediately inputs, then sometimes fireball behavior will change and it will climb the ladder.

Given all of this, it's unclear to me if a TAS could be created that can manipulate unlimited consecutive long pauses.
Donkey Kong:  1,206,800  Kill Screen
Donkey Kong:  898,600     16-5
D2K:                 380,200     L=9
Donkey Kong Junior:  In Progress
Member for 11 Years DK 1.2M Point Scorer Wildcard Rematch Champion Blogger Former DK Level 1-1 World Record Holder Former DK No-Hammer World Record Holder DK 1.1M Point Scorer DK 1M Point Scorer Individual Board Record Holder Former DK World Record Holder - MAME DK Killscreener Twitch Streamer