Author Topic: Attract mode code breakdown  (Read 25452 times)

0 Members and 1 Guest are viewing this topic.

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1530
    • Awards
Re: Attract mode code breakdown
« Reply #15 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?

DK High Score 
1,064,500
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Member for 11 Years Most Time Online DK 1M Point Scorer DK Killscreener Blogger Twitch Streamer

Offline f_symbols

  • Spring Jumper
  • *
  • Posts: 834
  • wht u mean
    • Awards
Re: Attract mode code breakdown
« Reply #16 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.
« Last Edit: July 19, 2013, 03:48:32 pm by f_symbols »
Member for 11 Years IGBY 2016 DKF Team Member Winner of a community event Former DK Remix World Record Holder DK Remix Killscreener IGBY 2015 DKF Team Member DK 1M Point Scorer IGBY 2014 DKF Team Member Blogger DK Killscreener Twitch Streamer

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Attract mode code breakdown
« Reply #17 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.
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1530
    • Awards
Re: Attract mode code breakdown
« Reply #18 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.

DK High Score 
1,064,500
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Member for 11 Years Most Time Online DK 1M Point Scorer DK Killscreener Blogger Twitch Streamer

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Attract mode code breakdown
« Reply #19 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?
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1530
    • Awards
Re: Attract mode code breakdown
« Reply #20 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.

DK High Score 
1,064,500
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Member for 11 Years Most Time Online DK 1M Point Scorer DK Killscreener Blogger Twitch Streamer

Offline f_symbols

  • Spring Jumper
  • *
  • Posts: 834
  • wht u mean
    • Awards
Re: Attract mode code breakdown
« Reply #21 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.
« Last Edit: July 19, 2013, 03:50:48 pm by f_symbols »
Member for 11 Years IGBY 2016 DKF Team Member Winner of a community event Former DK Remix World Record Holder DK Remix Killscreener IGBY 2015 DKF Team Member DK 1M Point Scorer IGBY 2014 DKF Team Member Blogger DK Killscreener Twitch Streamer

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Attract mode code breakdown
« Reply #22 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.
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1530
    • Awards
Re: Attract mode code breakdown
« Reply #23 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).

DK High Score 
1,064,500
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Member for 11 Years Most Time Online DK 1M Point Scorer DK Killscreener Blogger Twitch Streamer

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1530
    • Awards
Re: Attract mode code breakdown
« Reply #24 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.

DK High Score 
1,064,500
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Member for 11 Years Most Time Online DK 1M Point Scorer DK Killscreener Blogger Twitch Streamer

Offline marinomitch13

  • Spring Jumper
  • *
  • Posts: 1806
    • How to Play DK
    • Awards
Re: Attract mode code breakdown
« Reply #25 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!
"Thou hast made us for Thyself, and our heart is restless until it finds its rest in Thee." -Augustine, Confessions.
Member for 11 Years IGBY 2015 DKF Team Member DK Killscreener Blogger Twitch Streamer

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Attract mode code breakdown
« Reply #26 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
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1530
    • Awards
Re: Attract mode code breakdown
« Reply #27 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?

DK High Score 
1,064,500
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Member for 11 Years Most Time Online DK 1M Point Scorer DK Killscreener Blogger Twitch Streamer

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1530
    • Awards
Re: Attract mode code breakdown
« Reply #28 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).

DK High Score 
1,064,500
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Member for 11 Years Most Time Online DK 1M Point Scorer DK Killscreener Blogger Twitch Streamer

Offline JCHarrist

  • Spring Jumper
  • *
  • Posts: 643
    • Donkey Kong Forum
    • Awards
Re: Attract mode code breakdown
« Reply #29 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
Member for 11 Years DKF Founder Former CK World Record Holder - Arcade CK Killscreener DK Killscreener