Author Topic: Donkey Kong Trainer  (Read 17404 times)

0 Members and 1 Guest are viewing this topic.

Offline Sock Master

  • Senior Member
  • *
  • Posts: 230
Re: Donkey Kong Trainer
« Reply #30 on: June 09, 2016, 09:06:48 PM »
The DK trainer rom has been slightly revised to use the averages Jeremy provided as the basis for inter-conversions between L1 through L4 scores into L5 scores and vice versa.   I've made a few other adjustments the prediction math as well.   It should generate more sane pace values now, but this is still a work in progress.

I'll look into dropping the L1-L4 data from the pace prediction after the completion of L=05, in addition to the other suggestions in future revisions.
"Badges? We ain't got no badges. We don't need no badges. I don't have to show you any stinkin' badges!"
Twitch TV  Streamer

Offline aarontruitt

  • Senior Member
  • *
  • Posts: 195
Re: Donkey Kong Trainer
« Reply #31 on: June 09, 2016, 10:04:51 PM »
I agree with everything Chris wrote. Spotting death points is such a crippling "feature" of Pauline, I consider it to be a bug in the application. While the average kill screen game does have ~12,000 points in deaths according to the magic secret database, there have been world record games with almost zero in death points.

Everything in deaths should just be considered a bonus in the calculation, and nothing should be assumed because unless you can get all three sacs you're never in control of when you die.

"What's wrong with carpet munching" - Robert Felstein

Lick it Wes
Arcade DK PB: 881,600 (KS)
Twitch TV  Streamer DK Killscreener

Offline ChrisP

  • Spring Jumper
  • *
  • Posts: 1667
  • I'm going to jump next to your leg.
    • Donkey Blog
Re: Donkey Kong Trainer
« Reply #32 on: June 09, 2016, 10:45:45 PM »
The DK trainer rom has been slightly revised to use the averages Jeremy provided as the basis for inter-conversions between L1 through L4 scores into L5 scores and vice versa.   I've made a few other adjustments the prediction math as well.   It should generate more sane pace values now, but this is still a work in progress.

Wow, it seems to be working much better now. I super-warped to L5 this time, getting a start of 95K, and the pace was something like 849K, which is kinda the quintessential "KS with nothing extra" score.  <Allen>

I'll look into dropping the L1-L4 data from the pace prediction after the completion of L=05, in addition to the other suggestions in future revisions.

Cool, if that's possible. If you dropped the L1-L4 data and reset the calculations after 5-6 it would probably totally solve the issue. And I have to admit, it IS kind of fun to see a pace during the early boards, even if it doesn't mean much. As long as the number becomes accurate after L5, that's what matters.

Also, not that it makes any real difference, but I was just messing around with dipswitches, and if you're on 6+1 settings, you don't get death points for the extra men, and the HOW HIGH screen starts kinda going to hell after your 4th death since there aren't enough "rows" to hold all the levels and death points. ;D I think if it's a "trainer", it probably shouldn't even have any options for lives other than 3+1.

Now that I think about it, I don't think there's a single dipswitch setting that is actually necessary for the trainer. You could re-map all of them to do whatever you want (like toggling the distances/decision point sprites on or off, start on L5, etc.)

Looking forward to more of this.
http://donkeykongblog.blogspot.com

4 Quarters :-* - 800K Avg. Per Qtr. :o - No Restarts 8) - No Proof :'(

7/26/2013   Coin 35,946   710,800   18-1
7/28/2013   Coin 35,947   903,700   22-1
8/16/2013   Coin 35,948   694,100   17-6
8/17/2013   Coin 35,949   893,100   22-1

3,201,700: the $1 World Record?
Twitch TV  Streamer DK Killscreener Crazy Kong Killscreener DKF Blogger DK Jr. Killscreener

Offline Sock Master

  • Senior Member
  • *
  • Posts: 230
Re: Donkey Kong Trainer
« Reply #33 on: June 11, 2016, 07:26:56 AM »
Wow, it seems to be working much better now. I super-warped to L5 this time, getting a start of 95K, and the pace was something like 849K, which is kinda the quintessential "KS with nothing extra" score.  <Allen>

It seems to be working pretty well now.  I'm still not satisfied with the 1-1 score conversion (the pace after 1-1 seems too low.  the source statistics I have are too skewed because most people press much harder on 1-1 than other barrels screens.)

Also, not that it makes any real difference, but I was just messing around with dipswitches, and if you're on 6+1 settings, you don't get death points for the extra men, and the HOW HIGH screen starts kinda going to hell after your 4th death since there aren't enough "rows" to hold all the levels and death points. ;D I think if it's a "trainer", it probably shouldn't even have any options for lives other than 3+1.

Now that I think about it, I don't think there's a single dipswitch setting that is actually necessary for the trainer. You could re-map all of them to do whatever you want (like toggling the distances/decision point sprites on or off, start on L5, etc.)

Yeah, I'm probably going to remove options for anything other than 3+1 lives.  Internally, it can support more lives in the calculations, but there just isn't enough real-estate on the screen to display more than 4 sacs/deaths.   The chart ends up wrapping around past the bottom and back to the top of the screen.   I have exactly run out of ROM space at this point too - hopefully removing the dip switch options will free enough ROM space to allow me to add options to toggle the extra in-game graphics on/off.   May have to remove the intro climbing sequence soon
"Badges? We ain't got no badges. We don't need no badges. I don't have to show you any stinkin' badges!"
Twitch TV  Streamer

Offline Sock Master

  • Senior Member
  • *
  • Posts: 230
Re: Donkey Kong Trainer
« Reply #34 on: June 13, 2016, 07:14:26 PM »
One more update to the pace calculations..  I'm still not 100% satisfied, but it's not too bad - I'll probably tweak it some more.

I'm trying an experimental algorithm that drops one early stage tally from the predicted average after each completed stage from L=05 onwards...   For example, after completing 5-1, it stops using the 1-1 score as part of the future stage average calculation.   After 5-2, the 1-2 score is dropped.  After 5-3, the 2-1 score is dropped,etc... until only scores from L=05+ are used for unplayed stage score prediction.

At that point it becomes the standard pace calculation, except it can calculate a new pace after each completed stage.. and that score predictions for each board are rounded to 100 point values for Z80 sanity, so it's a bit coarser.

It is nice to see pace update immediately after each stage.  You can see the pace go up if you played a good board or down if you didn't - you get instant feedback
"Badges? We ain't got no badges. We don't need no badges. I don't have to show you any stinkin' badges!"
Twitch TV  Streamer

Offline Sock Master

  • Senior Member
  • *
  • Posts: 230
Re: Donkey Kong Trainer
« Reply #35 on: June 14, 2016, 10:33:48 AM »
I figured out what it was, I found a bug in my code that caused it to load incorrect values for early rivets boards in the calculations.  I've fixed the bug and updated the file on my web page.

If I play a consistent game, the reported pace stays pretty consistent... if I play one board a bit better, the pace goes up, if I play a board a bit worse, the pace goes down.   I can reliably 'call' whether it'll go up or down after each board, so it seems to jive with how I think I played.

So, I'm happy with it.   Onwards to finishing up.   (In other news, I've run out of ROM space so that's going to limit adding anything else to really small stuff.)
"Badges? We ain't got no badges. We don't need no badges. I don't have to show you any stinkin' badges!"
Twitch TV  Streamer

Offline mrvaya

  • Senior Member
  • *
  • Posts: 145
Re: Donkey Kong Trainer
« Reply #36 on: June 14, 2016, 03:58:23 PM »
Sounds GREAT! Is it hard to make an edition with just the pace calculator? (tournament edition or whatever you'll call it).
DKF Blogger DK Killscreener

Offline tilt

  • Elite Member
  • *
  • Posts: 267
  • Repair man of DKF
Re: Donkey Kong Trainer
« Reply #37 on: June 14, 2016, 05:44:40 PM »
Very cool... so will this be able to be added to the remix pcb(s)?
My stream is currently (http://www.twitch.tv/expandedidea/)
PB(s):
Donkey Kong: 1,004,100 (KS)
Donkey kong Hard roms(prev. world record): 914,200
Crazy Kong: 513,700 (KS)
Twitch TV  Streamer DKF Blogger DK Killscreener Crazy Kong Killscreener DK 1 Million Point Scorer

Offline Sock Master

  • Senior Member
  • *
  • Posts: 230
Re: Donkey Kong Trainer
« Reply #38 on: June 14, 2016, 07:22:48 PM »
After I finish the trainer version, I'm going to look into adding just the pace to normal DK.
After that, I'm going to think long and hard about integrating it into the Remix kit.

*If* I manage to do that before the Kong Off, I am considering the possibility that I can update your kits with trainer/pace at Kong Off.   Bring your kit, I update it.   But keep in mind, I have not done this yet - it doesn't exist yet and it takes time to do.  No guarantee that I'll have this ready in time.
"Badges? We ain't got no badges. We don't need no badges. I don't have to show you any stinkin' badges!"
Twitch TV  Streamer

Offline mrvaya

  • Senior Member
  • *
  • Posts: 145
Re: Donkey Kong Trainer
« Reply #39 on: June 14, 2016, 09:32:47 PM »
BIG BIG BIG  Kreygasm
DKF Blogger DK Killscreener

Offline ChrisP

  • Spring Jumper
  • *
  • Posts: 1667
  • I'm going to jump next to your leg.
    • Donkey Blog
Re: Donkey Kong Trainer
« Reply #40 on: June 14, 2016, 09:36:45 PM »
Wow! In just two revisions, this went very, very quickly from "the calculations have some serious flaws" to "this is the best pace calculator I've ever used." ;D

I'm just impressed that you're able to get the Z80 to do the math you need it to do at all. I'm no expert on the subject, but I know that the Z80 is not straightforward. You have to trick the fkn thing just to get it to do something as simple as multiply or divide. It's like some kind of sadistic abacus.

I really like how the early boards get gradually eliminated from the calculation between 5-1 and 7-2, rather than abruptly on 6-1. Keeping some data in there, or something else you're doing, appears to be protective against the "unusually huge or small early conveyor or rivet" problem. The pace isn't flying completely out of whack.

I also like the 1K per death points. That's good. 3,400 death points would be unusually low, but it's safer to go lower, and it's probably true that at least a little something should be added to pace for deaths.

I made a savestate after a 111K start, and starting from that, went in two different directions: I did one sample of L5 through L8 56Kish levels, and another sample where I played L5 through L8 as 47Kish levels. By 8-1, the numbers all seem to be smoothed out, and the pace it gives is pretty much exactly what I would expect, and what I get if I do the "simple" method.

I didn't try any super-high 1.15+ type boards, so I can't say if it works as well for maxout play, but it seems to work fine for anything lower.

I also tried doing other weird things, by cheating and board-skipping and stuff, to try to get it to put out a crazily-wrong number, but I couldn't confuse it.

Awesome!

Now we just need someone to take this algorithm and stuff it into a program that does OCR and Pauline can be updated for the modern age. :)
« Last Edit: June 14, 2016, 10:10:14 PM by ChrisP »
http://donkeykongblog.blogspot.com

4 Quarters :-* - 800K Avg. Per Qtr. :o - No Restarts 8) - No Proof :'(

7/26/2013   Coin 35,946   710,800   18-1
7/28/2013   Coin 35,947   903,700   22-1
8/16/2013   Coin 35,948   694,100   17-6
8/17/2013   Coin 35,949   893,100   22-1

3,201,700: the $1 World Record?
Twitch TV  Streamer DK Killscreener Crazy Kong Killscreener DKF Blogger DK Jr. Killscreener

Offline Barra

  • Spring Jumper
  • *
  • Posts: 854
  • Watch out Riley
Re: Donkey Kong Trainer
« Reply #41 on: June 15, 2016, 02:42:39 AM »
words

Ffttt whens 1m


(epic stuff btw John)
The "Easy Accept" muppet
Twitch TV  Streamer DKF Blogger DK Killscreener Crazy Kong Killscreener DK 1 Million Point Scorer DK Jr. Killscreener

Offline mrvaya

  • Senior Member
  • *
  • Posts: 145
Re: Donkey Kong Trainer
« Reply #42 on: June 15, 2016, 04:36:46 AM »
Just tested and the pace calculator works amazingly here too... began with some terrible boards and pace started at 700-something... then rose quickly to around 850k midst lvl 3 which sounds about right for my games.

Started a new game and tried some dual hammer screens and were quickly paced at above 1M. Like it!

Just cant stand playing with those dots around jumpman  ???
« Last Edit: June 15, 2016, 04:42:27 AM by mrvaya »
DKF Blogger DK Killscreener

Offline Sock Master

  • Senior Member
  • *
  • Posts: 230
Re: Donkey Kong Trainer
« Reply #43 on: June 15, 2016, 11:47:27 AM »
Wow! In just two revisions, this went very, very quickly from "the calculations have some serious flaws" to "this is the best pace calculator I've ever used." ;D

I'm just impressed that you're able to get the Z80 to do the math you need it to do at all. I'm no expert on the subject, but I know that the Z80 is not straightforward. You have to trick the fkn thing just to get it to do something as simple as multiply or divide. It's like some kind of sadistic abacus.

I'm cutting corners to keep things simple, but yeah - there's no divide or multiply in the Z80.    I did write a divide routine to calculate average scores, that was unavoidable, but I didn't bother writing a multiply routine.   I take shortcut substitutions in the case of multiply:
If I needed RESULT = VALUE * 1.3
I used a series of bit shifts and additions instead.   RESULT = VALUE + (VALUE/4) + (VALUE/16)
The result is closer to VALUE * 1.3125, but that's good enough.   Those shortcuts are only used in generating imaginary scores for stage-types that haven't been played yet (like getting a pie average when a pie hasn't even been played yet) or handling pre-L5 scores.

Once it transitions to normal pace calculation, those shortcuts aren't applied anymore so I didn't worry too much being off by a few percent for the sake of keeping things simple.


Now we just need someone to take this algorithm and stuff it into a program that does OCR and Pauline can be updated for the modern age. :)
I can share the recipe when I'm done.   It'll probably surprise everyone how far I simplified/dumbed it down.   The theory is pretty sound, though.

If we had a data set of board score averages between L1-1 to L5-6 for 850K games, and another set for 1M games, I bet I could come up with an algorithm that could predict some pretty eerily accurate pace even early in a game.

From that data it ought to even be possible to work out a way to tell the player that he's playing barrel boards at 900K level, rivet boards at 860K level, etc.. which seems like it might be handy for showing which stage types could use some improvement.

Just tested and the pace calculator works amazingly here too... began with some terrible boards and pace started at 700-something... then rose quickly to around 850k midst lvl 3 which sounds about right for my games.

Started a new game and tried some dual hammer screens and were quickly paced at above 1M. Like it!

Just cant stand playing with those dots around jumpman  ???

Yup, I think that's next..  I have to think of an easy way to toggle the extra displays that won't eat much ROM space.. maybe simply inserting coins to toggle between dots/no-dots/numbers/no-numbers.
"Badges? We ain't got no badges. We don't need no badges. I don't have to show you any stinkin' badges!"
Twitch TV  Streamer

Offline Sock Master

  • Senior Member
  • *
  • Posts: 230
Re: Donkey Kong Trainer
« Reply #44 on: June 17, 2016, 09:42:07 PM »
One more update is up, maybe the last for a while as I've hit the point where it's getting really difficult to free up more ROM space to add anything else to it.

You can now jump start at L=5-1 by pressing the 1P start button for 2 seconds during the intro sequence,
and also toggle the sprite indicator "dots" on or off by inserting coins during gameplay.

There's an on-screen description of the button functions in the attract mode.  I had to keep the text short, though.
"Badges? We ain't got no badges. We don't need no badges. I don't have to show you any stinkin' badges!"
Twitch TV  Streamer