Donkey Kong Forum

General Donkey Kong Discussion => General Donkey Kong Discussion => Topic started by: JCHarrist on July 18, 2013, 09:25:16 pm

Title: Attract mode code breakdown
Post by: JCHarrist on July 18, 2013, 09:25:16 pm
I know I'm not the only attract mode geek here so I decided to brush up on my assembly skills by breaking down the attract mode code.  I've always been kinda fascinated by the seemingly endless number of possible outcomes.

It turns out that it is incredibly simple, with only 28 lines of code to handle Jumpmans movements. The movements are completely hardcoded with no randomness and no barrel/fireball/ladder detection. However, the barrels and fireballs behave exactly like they do in a game, so that is where the variability comes from.

It only becomes interesting if Jumpman is able to grab the hammer and actually smash something because when the screen freezes during the smashes, the script keeps running and the variable number and timing of the smashes is what makes the many different outcomes possible.

The input sequence table starts at 21D1 and only has 15 different moves. The first byte is the input. The second byte is the duration of the FOLLOWING input.

I've expanded on Jeff Willms commenting.

Code: [Select]
21D1  80 FE ; jump
21D3  01 C0 ; run right for 254 frames
21D5  04 50 ; climb ladder for 192 frames( it only takes 54 frames to climb the short ladder so he pauses at the top for 138 frames)
21D7  02 10 ; run left for 80 frames
21D9  82 60 ; jump left for 16 frames
21DB  02 10 ; run left for 96 frames
21DD  82 CA  ; jump left for 16 frames
21DF  01 10 ; run right for 202 frames
21E1  81 FF ; jump right for 16 frames (grabs hammer)
21E3  02 38 ; run left for 255 frames
21E5  01 80 ; run right for 56 frames
21E7  02 FF ; run left for 128 frames
21E9  04 80 ; up for 255 frames
21EB  04 60 ; up 128 frames
21ED  80 ; jump for 96 frames

The code that calls the inputs follows directly after it. It's interesting to note that Jumpman occasionally makes it further than the 15 inputs in the table at which point the code starts using itself as input data. It will take some more experimentation to define those inputs although #16 and #17 seem to make Jumpman run right for at least 220 frames or so. :o

Code: [Select]
21EE  11D121    LD      DE,#21D1 ; load DE with #21D1 (address of start of input table data)
21F1  21CC63    LD      HL,#63CC ; load HL with #63CC (63CC holds the sequence # of the current input)
21F4  7E        LD      A,(HL) ; load A with input sequence #
21F5  07        RLCA    ; multiply A X 2
21F6  83        ADD     A,E ; add A to E (E = hex D1/ decimal 209)
21F7  5F        LD      E,A ; put A into E (this returns DE to the address of the current input )
21F8  1A        LD      A,(DE) ; load A from the address of the current input from table
21F9  321060    LD      (#6010),A ; output A to Jumpman
21FC  2C        INC     L ; increment HL by 1 to 63DC (63DC holds the number of frames remaining to execute the input)
21FD  7E        LD      A,(HL) ; load the # of frames remaining to execute into A
21FE  35        DEC     (HL) ; decrement the # of frames remaining by 1
21FF  A7        AND     A ; clear carry flag
2200  C0        RET     NZ ; return if A is not zero

2201  1C        INC     E ; if A is zero increment E by 1 (advances to next input duration)
2202  1A        LD      A,(DE) ; load A with input duration
2203  77        LD      (HL),A ; store input duration into HL (address 63DC)
2204  2D        DEC     L ; decrement HL to address 63CC
2205  34        INC     (HL) ; increment the input sequence #
2206  C9        RET      ; return


Earlier we were discussing this is in the shoutbox  and Chris P was doing some experimentation using invinciblity cheat and it seems that in order for Jumpman to make it to the third girder he has to smash exactly 3 objects AND be standing at the base of a ladder when the hammer expires.

Discuss, fellow attract mode geeks! ;D


Title: Re: Attract mode code breakdown
Post by: marinomitch13 on July 18, 2013, 09:54:52 pm
Code: [Select]
21E9  04 80 ; up for 255 frames
21EB  04 60 ; up 128 frames
21ED  80 ; jump for 96 frames
So, based on this (the fact that there are no potential movements to the right after climbing to the third girder), it is impossible for Jumpman to get to the 4th girder... correct?
Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 18, 2013, 10:06:21 pm
Code: [Select]
21E9  04 80 ; up for 255 frames
21EB  04 60 ; up 128 frames
21ED  80 ; jump for 96 frames
So, based on this (the fact that there are no potential movements to the right after climbing to the third girder), it is impossible for Jumpman to get to the 4th girder... correct?

Well, as I stated, after the #15th input, the code "overflows" out of the table data and starts reading inputs from the program code itself. It seems that #16 and #17 make him run to the right for around 220 frames, but that's as far as I've ever seen him survive.
Title: Re: Attract mode code breakdown
Post by: corey.chambers on July 18, 2013, 10:28:08 pm
I used the invinsibility cheat along with the always climb cheat. I shut off the always climb while jumpman is half way up Pauline's ladder. He will climb to the top on his own, get to the top and stop. The rom literally stalls, it will not let you play the game. :)
Title: Re: Attract mode code breakdown
Post by: f_symbols on July 18, 2013, 10:34:07 pm
I just realized that this is the only way to actually end the game next to Pauline
Title: Re: Attract mode code breakdown
Post by: alumbrada on July 18, 2013, 10:46:58 pm
I used the invinsibility cheat along with the always climb cheat. I shut off the always climb while jumpman is half way up Pauline's ladder. He will climb to the top on his own, get to the top and stop. The rom literally stalls, it will not let you play the game. :)

A reliable source told me you were on 1.3M pace. Great job!
Title: Re: Attract mode code breakdown
Post by: ChrisP on July 19, 2013, 12:35:43 am
Using the "Always Climb" was a great idea, Corey.

Fascinating that the game stalls. Imagine if it kept going. Somebody could painstakingly put together a kill screen...

We finally got demo-Jumpman through the attract mode! Love it!
Title: Re: Attract mode code breakdown
Post by: stella_blue on July 19, 2013, 05:37:43 am
I used the invinsibility cheat along with the always climb cheat. I shut off the always climb while jumpman is half way up Pauline's ladder. He will climb to the top on his own, get to the top and stop. The rom literally stalls, it will not let you play the game. :)

How do we end up with 9800 on the Bonus Timer?

Title: Re: Attract mode code breakdown
Post by: mikegmi2 on July 19, 2013, 05:46:57 am
Yea 9800 bonus timer, wht da? Is that part of the invincibility cheat, it gives you extra time?

Pretty cool though.
Title: Re: Attract mode code breakdown
Post by: corey.chambers on July 19, 2013, 06:42:04 am
The bonus timer was an additional cheat, infinite bonus timer.
Title: Re: Attract mode code breakdown
Post by: LMDAVE on July 19, 2013, 06:48:38 am
Code: [Select]
21E9  04 80 ; up for 255 frames
21EB  04 60 ; up 128 frames
21ED  80 ; jump for 96 frames
So, based on this (the fact that there are no potential movements to the right after climbing to the third girder), it is impossible for Jumpman to get to the 4th girder... correct?

Well, as I stated, after the #15th input, the code "overflows" out of the table data and starts reading inputs from the program code itself. It seems that #16 and #17 make him run to the right for around 220 frames, but that's as far as I've ever seen him survive.

That is very interesting, at least now I can see there is no programmed input beyond climbing to the 3rd girder, the run to right is strictly an overflow error like you said, but that almost always gets to that point. Maybe the programmer was jsut OK with that happening. But, when he does climb to the 3rd girder, if he ever managers to jump over the barrels, and there is a clear path....he'll run to the right but not fall off, or who knows what the next thing will do after the 220 frames to the right you said.

Would be neat to run the invisibility cheat without "always climb" and wait for him to climb to the 3rd girder and see what happens after the run to the right? You'd have to wait for about 15-20 screens through but should be able to do the fast forward.

BTW, not sure how always climb worked on the attact screen, does he always run in the right direction after climbing?
Title: Re: Attract mode code breakdown
Post by: f_symbols on July 19, 2013, 06:55:59 am
Dave, I believe that Chris said he runs off the right edge of the 3rd girder; apparently most of the "invincible" attract screens end with jump man on the bottom girder, due to survival after falling off the edges...

Perhaps the always climb cheat skips the bottom hammer?  Between the 13 other coded inputs and the overflow, it must've been enough
Title: Re: Attract mode code breakdown
Post by: stella_blue on July 19, 2013, 06:56:27 am
Would be neat to run the invisibility cheat without "always climb" and wait for him to climb to the 3rd girder and see what happens after the run to the right?

How would we know that he's climbed to the 3rd girder, if we can't see him?

Just kidding, Dave.  I know what you meant.   :)

Title: Re: Attract mode code breakdown
Post by: LMDAVE on July 19, 2013, 07:56:49 am
Dave, I believe that Chris said he runs off the right edge of the 3rd girder; apparently most of the "invincible" attract screens end with jump man on the bottom girder, due to survival after falling off the edges...

Perhaps the always climb cheat skips the bottom hammer?  Between the 13 other coded inputs and the overflow, it must've been enough

You can't run off the edge of the 3 girder to the right.
Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 19, 2013, 01:30:59 pm
Now that I know what the numbers do, and since the barrels always do the same thing the first time through in MAME, it should be a simple matter to program Jumpman to make it to the top.   8)
Title: Re: Attract mode code breakdown
Post by: stella_blue on July 19, 2013, 01:54:58 pm
Now that I know what the numbers do, and since the barrels always do the same thing the first time through in MAME, it should be a simple matter to program Jumpman to make it to the top.   8)

Do you mean a trial and error approach using hard coded values, as opposed to AI?

Title: Re: Attract mode code breakdown
Post by: f_symbols on July 19, 2013, 01:58:09 pm
Dave, I believe that Chris said he runs off the right edge of the 3rd girder; apparently most of the "invincible" attract screens end with jump man on the bottom girder, due to survival after falling off the edges...

Perhaps the always climb cheat skips the bottom hammer?  Between the 13 other coded inputs and the overflow, it must've been enough

You can't run off the edge of the 3 girder to the right.

Well that is true, I havent actually seen the invincible attract or tested it for that matter; perhaps he meant/said the left edge of the 3rd girder?  I was just relaying the results that chris_P gave in the shoutbox.  It was in response to my suggestion that we try to run an attract mode with invincibility to determine the hardcoded path.
Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 19, 2013, 02:04:12 pm
Now that I know what the numbers do, and since the barrels always do the same thing the first time through in MAME, it should be a simple matter to program Jumpman to make it to the top.   8)

Do you mean a trial and error approach using hard coded values, as opposed to AI?

Yes, just a hardcoded script that will work the first time through the attract mode. The problem is getting him there in only 15 moves. Oh, and barrels do steer in attract mode.
Title: Re: Attract mode code breakdown
Post by: stella_blue on July 19, 2013, 02:17:06 pm
Yes, just a hardcoded script that will work the first time through the attract mode. The problem is getting him there in only 15 moves. Oh, and barrels do steer in attract mode.

Yeah, that's what I mean.  Using values that are hard coded, you can control Mario to precisely perform the same actions every time, thereby triggering identical barrel behavior (on that first attract mode run).  An actual player would be highly unlikely to reproduce those same movements exactly; off by a frame or 2 here and there, and the remainder of the stage plays out differently.

Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 19, 2013, 02:52:38 pm
Yes, just a hardcoded script that will work the first time through the attract mode. The problem is getting him there in only 15 moves. Oh, and barrels do steer in attract mode.

Yeah, that's what I mean.  Using values that are hard coded, you can control Mario to precisely perform the same actions every time, thereby triggering identical barrel behavior (on that first attract mode run).  An actual player would be highly unlikely to reproduce those same movements exactly; off by a frame or 2 here and there, and the remainder of the stage plays out differently.

Ok, now I'm confused.

Who said anything about a player trying to duplicate the movements?
Title: Re: Attract mode code breakdown
Post by: stella_blue on July 19, 2013, 03:21:05 pm

Ok, now I'm confused.

Who said anything about a player trying to duplicate the movements?


I'm just comparing the hard coded values (in attract mode) to an actual player's inputs (using a save state, for example).

A human player could load a save state 100 times, attempting to play the board identically each time.  The odds of performing the same exact actions, frame by frame, for any 2 trials, are close to zero.  The resulting gameplay would vary greatly.

By contrast, the attract mode (initial run) should produce identical results, since the input values are precise.

Title: Re: Attract mode code breakdown
Post by: f_symbols on July 19, 2013, 03:47:01 pm
Scott,  ;)

What about the steering % for the barrels, I'd still think the odds will be no better than 1/10 (it will play a few variants until everything steers "properly").  I don't think the barrels would follow the "same" path every time, unless of course, mame's number generators always start at the same values?  Every time i turn on the cab, it boots with a different attract screen, prior to any user inputs.
Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 19, 2013, 03:59:17 pm
Scott,  ;)

What about the steering % for the barrels, I'd still think the odds will be no better than 1/10 (it will play a few variants until everything steers "properly").  I don't think the barrels would follow the "same" path every time, unless of course, mame's number generators always start at the same values?  Every time i turn on the cab, it boots with a different attract screen, prior to any user inputs.

In MAME, after a hard reboot , the barrels do the same thing every time in attract mode. Jumpman does influence them just like in a game, but they will steer the same way every time , at least in the first attract mode run.

Arcade cabinets are different in this respect. The random number generator must get seeded differently because the attract modes are not predictable.
Title: Re: Attract mode code breakdown
Post by: stella_blue on July 19, 2013, 04:00:09 pm
Scott,  ;)

What about the steering % for the barrels, I'd still think the odds will be no better than 1/10 (it will play a few variants until everything steers "properly").  I don't think the barrels would follow the "same" path every time, unless of course, mame's number generators always start at the same values?  Every time i turn on the cab, it boots with a different attract screen, prior to any user inputs.

Yeah, the other parameters that determine barrel decisions (RNG values, etc.) would have to be the same.  I don't know if those memory locations are initialized when attract mode is first run, or if they contain leftover values (or random garbage).

Title: Re: Attract mode code breakdown
Post by: stella_blue on July 19, 2013, 04:08:08 pm
In MAME, after a hard reboot , the barrels do the same thing every time in attract mode. Jumpman does influence them just like in a game, but they will steer the same way every time , at least in the first attract mode run.

Arcade cabinets are different in this respect. The random number generator must get seeded differently because the attract modes are not predictable.

Ok, I seem to recall a similar discussion on DKF a few months ago.

Title: Re: Attract mode code breakdown
Post by: marinomitch13 on July 19, 2013, 04:14:07 pm
Oh, and barrels do steer in attract mode.

Yes! Finally! An answer! I'd been curious about that for so long!
Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 19, 2013, 04:24:24 pm
Here's as far as I can get him with 15 moves. He runs into the overflow after that last jump. :(

DK attract mode reprogrammed (http://www.youtube.com/watch?v=ohtHJEW3Duw#ws)
Title: Re: Attract mode code breakdown
Post by: stella_blue on July 19, 2013, 04:30:04 pm
Ok, I seem to recall a similar discussion on DKF a few months ago.

I managed to locate the thread I alluded to earlier.

The relevant discussion begins here:

Elevator Stage, how do you get from safe spot to safe spot? (https://donkeykongforum.net/index.php?topic=120.msg2014#msg2014)

Title: Re: Attract mode code breakdown
Post by: stella_blue on July 19, 2013, 04:53:46 pm
Here's as far as I can get him with 15 moves. He runs into the overflow after that last jump. :(

Just curious, did you experiment with different combinations of values for the "run left", "run right", and "climb up" moves?  I'm wondering if an adjustment to the number of frames (increase/decrease by 1 or 2) might reduce the number of necessary barrel jumps (sort of like the Level 1-1 4000 Challenge).

Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 19, 2013, 05:08:44 pm
Here's as far as I can get him with 15 moves. He runs into the overflow after that last jump. :(

Just curious, did you experiment with different combinations of values for the "run left", "run right", and "climb up" moves?  I'm wondering if an adjustment to the number of frames (increase/decrease by 1 or 2) might reduce the number of necessary barrel jumps (sort of like the Level 1-1 4000 Challenge).

Yeah, I'm still playing around with it. I think I see a way to save one more move. That should get him up the ladder to the 6th girder. :D
Title: Re: Attract mode code breakdown
Post by: stella_blue on July 19, 2013, 05:20:18 pm
Yeah, I'm still playing around with it. I think I see a way to save one more move. That should get him up the ladder to the 6th girder. :D

Nice!  Of course, I could just tackle this myself, sparing you the annoyance of a backseat driver.   ;)

Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 19, 2013, 05:28:24 pm
Fkn hell. So close! I need one more jump and one more climb!

DK attract mode reprogrammed 2 (http://www.youtube.com/watch?v=P5SmxYxkEw8#ws)
Title: Re: Attract mode code breakdown
Post by: corey.chambers on July 19, 2013, 05:37:42 pm
Nice video, Jeff! Very cool stuff indeed.
Title: Re: Attract mode code breakdown
Post by: up2ng on July 19, 2013, 06:10:42 pm
Perhaps try using some vertical jumps (80) which seems to require only one byte instead of two, so you can use more than 15 moves.

Of course, I assume that getting to the top Will hang the program like what happened to Corey.  I think the main loop of the software needs to detect a death to be able to exit out of this mode of assuming that subsequent program instructions are user inputs.  So, the program will run to the end of file trying to give inputs to Jumpman and when the end of file is reached the main program loop is caught in an infinite loop, resulting in a software hang.

Still a fun exercise though...
Title: Re: Attract mode code breakdown
Post by: Jeffw on July 19, 2013, 06:28:03 pm
Really? I post the code and the first thing you guys look at is attract mode?  ::)

I think the real challenge is to see how high you can make Mario climb without any kind of ROM modification. You can use the coin-insert button to manipulate the random number generator and produce any kind of randomness you want. Depending on how Mario behaves after overflowing out of the input table, there is a small chance that it's possible to finish the first screen given the right randomness, so someone might be able to make a TAS that consists only of coin-insert button presses in which Mario finishes the first screen in attract mode. Any takers?

Edit: Ah, never mind. It seems doing a coin-insert causes it to leave attract mode. It still could be possible to finish the first screen given the right randomness but I don't think there's a good way of manipulating the RNG.
Title: Re: Attract mode code breakdown
Post by: qnz on July 19, 2013, 06:59:35 pm
Fkn hell. So close! I need one more jump and one more climb!

I assume you're modifying the ROM bytes that it normally reads to have some other values, so you're limited by space?

Instead, you can probably find an unused part of the ROM with more space available, put your new values there, and then modify the code to point there instead of the original place.


Todd
Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 19, 2013, 07:06:20 pm

Nice!  Of course, I could just tackle this myself, sparing you the annoyance of a backseat driver.   ;)

Ok, give it a shot.

This is what I have:

Code: [Select]
21D1  01 CE ; run right(no duration)
21D3  01 39 ; run right for 206 frames
21D5  04 82 ; climb ladder for 57 frames
21D7  02 55 ; run left for 130 frames
21D9  04 10 ; climb ladder for 85 frames
21DB  81 C0 ; jump right for 16 frames
21DD  04 10 ; climb ladder for 192 frames(big pause at the top)
21DF  82 38 ; jump left for 16 frames
21E1  02 4F ; run left for 56 frames
21E3  04 30 ; climb ladder for 79 frames
21E5  81 74 ; jump right for 48 frames (2 jumps over 2 barrels)
21E7  01 10 ; run right for 116 frames
21E9  81 60 ; jump right for 16 frames
21EB  04 80 ; climb ladder for 96 frames
21ED  02 ; run left for 128 frames


I think it's gonna be very tough to get him all the way to the top with the number of moves available, but it is a neat challenge.
Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 19, 2013, 07:08:26 pm
Perhaps try using some vertical jumps (80) which seems to require only one byte instead of two, so you can use more than 15 moves.


Dean, the long jumps and the straight jumps both only take one byte. The 2nd byte is the duration of the next input.
Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 19, 2013, 07:09:44 pm
Really? I post the code and the first thing you guys look at is attract mode?  ::)


Haha! At least I'm doing SOMETHING with it. ;)
Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 19, 2013, 07:11:51 pm
Fkn hell. So close! I need one more jump and one more climb!

I assume you're modifying the ROM bytes that it normally reads to have some other values, so you're limited by space?

Instead, you can probably find an unused part of the ROM with more space available, put your new values there, and then modify the code to point there instead of the original place.

Todd

Yeah, that will be plan B I guess, but let's see if anyone can fit it in the available space first. :D

Welcome to the forum! :)
Title: Re: Attract mode code breakdown
Post by: up2ng on July 19, 2013, 07:31:53 pm
Hmm, using your example, are you sure you can't say

21DB     80     ;
21DC . . .               (Not 21DD)

I'm not really sure if that works, just throwing it out there.
Title: Re: Attract mode code breakdown
Post by: stella_blue on July 19, 2013, 07:43:26 pm
Really? I post the code and the first thing you guys look at is attract mode?  ::)

Yeah, isn't it great?

JC, Mitch and I were discussing our next assignment.  We plan to replace a few sprites, so that players will have more options when entering their initials.

Vincent specifically requested an "E", with an accent grave:

XÈR

It's an exciting project!   ;)

Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 19, 2013, 07:44:56 pm
Hmm, using your example, are you sure you can't say

21DB     80     ;
21DC . . .               (Not 21DD)

I'm not really sure if that works, just throwing it out there.

Not sure if I'm following you, but the 81 at 21DB is the right jump on the 3rd girder that clears a barrel AND puts jumpman right under the next ladder, so it's actually saving a move. The CO (decimal 192) at 21DC is the duration of the ladder climb at 21DD (04).

The way the code is written, the 2nd byte has to be used as a duration. It couldn't be used as another input.

Title: Re: Attract mode code breakdown
Post by: phantomdj on July 20, 2013, 12:13:52 am
Another way to have fun with this is to make the attract mode playable.

You can do this using the MAME debugger console by adding the following lines:

Code: [Select]
bp 80,1,{pc=87 ; g}
bp 1977,1,{pc=197a ; g}

You can also enable sound in attract mode with this line:

Code: [Select]
bp e9,1,{pc=eb ; g}
I will see if I can find another hack to make it so the game doesn't freak out when jumpman makes it to the top in attract mode.

edit:  found it.  The following hack fixes attract mode if jumpman should finish the level:

Code: [Select]
bp 746,{b@600a==16},{b@600a=5; g}
More fun with attract mode.  Set the screen played:

Code: [Select]
bp 770,1,{b@6227=2 ; g}
The above code sets the screen to 2 [conveyors] during attract mode.  Change the 2 to 3 for elevators, or to 4 for rivets.



Don Hodges
Title: Re: Attract mode code breakdown
Post by: ChrisP on July 20, 2013, 05:13:22 am
This is too much fun.

If you thought demo-Jumpman was bad on barrels, check him out on rivets.

Though he's still not as bad as D2K demo-Jumpman.
Title: Re: Attract mode code breakdown
Post by: stella_blue on July 20, 2013, 05:18:25 am

Thank you, Don.  Those are some great suggestions!  I tried them all.

Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 20, 2013, 09:30:14 am
Another way to have fun with this is to make the attract mode playable.

You can do this using the MAME debugger console by adding the following lines:

Code: [Select]
bp 80,1,{pc=87 ; g}
bp 1977,1,{pc=197a ; g}

You can also enable sound in attract mode with this line:

Code: [Select]
bp e9,1,{pc=eb ; g}
I will see if I can find another hack to make it so the game doesn't freak out when jumpman makes it to the top in attract mode.

edit:  found it.  The following hack fixes attract mode if jumpman should finish the level:

Code: [Select]
bp 746,{b@600a==16},{b@600a=5; g}
More fun with attract mode.  Set the screen played:

Code: [Select]
bp 770,1,{b@6227=2 ; g}
The above code sets the screen to 2 [conveyors] during attract mode.  Change the 2 to 3 for elevators, or to 4 for rivets.



Don Hodges

Oh man, just when I thought I was going to get some playing time in today.  ;D

Thanks Don!
Title: Re: Attract mode code breakdown
Post by: stella_blue on July 20, 2013, 09:41:01 am
DK Attract Mode, as you've never seen it before!

Not Your Typical DK Attract Mode (https://www.twitch.tv/stella_blue/v/50173433)

The highlight video features 2 somewhat unusual examples of attract mode.

The 1st part illustrates how not to play the Pie Factory.  As the bonus timer reaches 1500 (and then again at 1100), I can't even begin to guess what Mario is doing.  At least he has the good sense to leech the fireball for 100 points before dying.

Ever wonder what happens if you switch screen types during attract mode?  The 2nd part is an interesting hybrid of the Conveyor and Rivet stages.  Again, Mario doesn't survive, but he does collect the hat and purse (a 600 point "good death").

EDIT:  The video highlight, originally hosted at Justin TV, is currently 1 minute 20 seconds of a blank screen.

Title: Re: Attract mode code breakdown
Post by: f_symbols on July 20, 2013, 09:52:31 am
that rivet treadmill :D  Blue pies FTW
Title: Re: Attract mode code breakdown
Post by: marinomitch13 on July 20, 2013, 09:53:31 am
OMG, there has GOT to be a Rivet Hack made like that for people to play!
Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 20, 2013, 09:56:00 am

DK Attract Mode, as you've never seen it before!

Not Your Typical DK Attract Mode (http://www.justin.tv/stella_blue/c/2605139)

The highlight video features 2 somewhat unusual examples of attract mode.

The 1st part illustrates how not to play the Pie Factory.  As the bonus timer reaches 1500 (and then again at 1100), I can't even begin to guess what Mario is doing.  At least he has the good sense to leech the fireball for 100 points before dying.

Ever wonder what happens if you switch screen types during attract mode?  The 2nd part is an interesting hybrid of the Conveyor and Rivet stages.  Again, Mario doesn't survive, but he does collect the hat and purse (a 600 point "good death").

That's cool. We can see what happens in the overflow much more clearly without the barrels spoiling the fun. He hits the overflow at 45 seconds in the video on the pie factory.

Also interesting that he did climb the ladder toward the end of the rivet/pie factory hybrid board. :D
Title: Re: Attract mode code breakdown
Post by: JCHarrist on July 20, 2013, 10:12:53 am
So I gave up on trying to get him to the top on the first attract mode cycle. I decided to just put in a script that would potentially get him to the top and sit back and watch.

On the 27th cycle.... success!

DK attract mode reprogram success! (http://www.youtube.com/watch?v=j3JWqZvY71c#ws)

And it does indeed crash the game.
Title: Re: Attract mode code breakdown
Post by: stella_blue on July 20, 2013, 10:15:15 am
That's cool. We can see what happens in the overflow much more clearly without the barrels spoiling the fun. He hits the overflow at 45 seconds in the video on the pie factory.

There was another Pie Factory example where the fireballs left him alone, and he eventually died after the bonus timer reached 000.

The elevator stage isn't very interesting, as Mario runs past the edge of the starting platform, and dies immediately.  If you make it playable instead, you'll notice that everything moves very slowly (it is Level 00, after all).

Title: Re: Attract mode code breakdown
Post by: stella_blue on July 20, 2013, 10:21:34 am
So I gave up on trying to get him to the top on the first attract mode cycle. I decided to just put in a script that would potentially get him to the top and sit back and watch.

On the 27th cycle.... success!

[noembed]DK attract mode reprogram success! (http://www.youtube.com/watch?v=j3JWqZvY71c#ws)[/noembed]

And it does indeed crash the game.

Outstanding!  I especially enjoyed the quintuple jump on the 5th girder.   8)

Title: Re: Attract mode code breakdown
Post by: f_symbols on July 20, 2013, 10:41:21 am
Just a thought about the riv-pie...  spoiler alert!---------------->TOTALLY OFF TOPIC

Would DK be harder easier/the same if; we removed the rivets and pies and replaced it with 1 riv-pie screen?  It would essentially subtract a minimum of 19 screens from the 117, but I think that the increased difficulty of this screen might actually offset the loss of boards.  Basically, i think that getting to level 22 on a game that only had 98 screens but included the riv-pie would be just as hard, if not harder, than getting to level 22 in standard DK.

What do you guys think?

Title: Re: Attract mode code breakdown
Post by: up2ng on July 20, 2013, 01:55:57 pm
The elevator stage isn't very interesting, as Mario runs past the edge of the starting platform, and dies immediately.  If you make it playable instead, you'll notice that everything moves very slowly (it is Level 00, after all).

It seems like it would be straightforward to create an attract mode that passes an elevator screen.
Title: Re: Attract mode code breakdown
Post by: ChrisP on July 20, 2013, 03:11:42 pm
You could never guarantee the position of the between-elevator fireball, so that would cause problems, but maybe there's a way around that?
Title: Re: Attract mode code breakdown
Post by: SQUIIDUX on July 21, 2013, 04:50:46 am
http://kotaku.com/this-guy-wrote-a-program-that-teaches-itself-to-play-ne-472451152 (http://kotaku.com/this-guy-wrote-a-program-that-teaches-itself-to-play-ne-472451152)

found this made me think of you guys
Title: Re: Attract mode code breakdown
Post by: Xermon54 on July 21, 2013, 08:32:01 am
Insane, Jeff! That's awesome to know what happens when Jumpman finishes the first screen on the attract mode. Tears to my eyes mate!
Title: Re: Attract mode code breakdown
Post by: giv on July 21, 2013, 08:54:23 am
I just realized that this is the only way to actually end the game next to Pauline

I can't help thinking that the symbolism here has strong alchemical overtones.

The great work is complete.
Title: Re: Attract mode code breakdown
Post by: f_symbols on July 21, 2013, 11:22:23 am
I just realized that this is the only way to actually end the game next to Pauline

I can't help thinking that the symbolism here has strong alchemical overtones.

The great work is complete.

Perhaps the tale of the Monkey King :D
Title: Re: Attract mode code breakdown
Post by: Bliss1083 on July 25, 2013, 10:39:17 pm
i finally got my first jumpman climbing up to the third girder in attract mode recorded. Lol.