Author Topic: DKCore Development Blog  (Read 8775 times)

0 Members and 1 Guest are viewing this topic.

Offline WCopeland

  • Spring Jumper
  • *
  • Posts: 551
DKCore Development Blog
« on: April 25, 2014, 07:47:21 PM »
Discovering Donkey-Me (see: http://donkeykongforum.com/index.php?topic=857.0) was very inspirational, as it proved a clone/remake of the DK engine could be written and then extended to produce an enjoyable experience.  After finding this project, I reached out to the author asking questions about whether or not it would ever be open-sourced or updated.  I never got a response.  As a result of that, over the past week I've taken on a new project which I've dubbed DKCore.

DKCore is my personal attempt to completely rewrite the Donkey Kong arcade engine in a modern multi-platform language: in this case JavaScript.  During my day job, I serve as a full-stack web applications developer, so it seems like a natural fit. Also, with recent software advances such as the advent of the Node.js framework and node-webkit, it's possible to now port JavaScript web applications as multi-platform desktop applications complete with OS-level APIs.  While my experience with js is vast, my experience with game programming itself is a bit limited.  Due to this contextual issue, I'm using Construct 2 to aid with rapid development.

Regardless of how far this project goes, whether it succeeds or dies, I know full well I won't be able to emulate the quirkiness of the arcade engine with a 100% level of accuracy -- however I'm hoping to at least reach 99%.  I am using pixel-by-pixel comparisons between MAME and my own algorithms to do this.

I already have Jumpman's movement mechanics emulated to near arcade-pure accuracy.  Normal jumps, straight jumps, and even back jumps (which Donkey-Me fails to include) all work.  Ladder mechanics work in a nearly arcade-pure fashion as well.  I also have barrel scoring working, regardless of jump type or barrel location/orientation. 

This project is completely open source with the latest code commit always on GitHub.  This means even if I discontinue at some point, another person can pick it right up. The DKCore repo can be found here: https://github.com/wescopeland/DKCore/

The end goal is to have a fully-functioning template to create DK-like games.  I have a bad habit of dropping projects shortly after picking them up, so this devlog is one way I can keep myself motivated.



« Last Edit: April 25, 2014, 08:05:01 PM by WCopeland »
Twitch TV  Streamer DK Killscreener DK 1 Million Point Scorer DK Online Open #4 Winner DK 1.1 Million Point Scorer Crazy Kong Killscreener DKF Blogger Pauline WR Holder DK 1st Man Million DK 1st man 1.1 Million DK Jr. Killscreener 1 Million Point Trifecta DK Arcade WR Holder DK 1.2 Million Point Scorer

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1501
Re: DKCore Development Blog
« Reply #1 on: April 25, 2014, 08:09:00 PM »

Here's a similar project you may find interesting:

Out Run Enhanced Edition

I've been following its progress for the past 2 years.

DK High Score 
952,100
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Twitch TV  Streamer Most Time Online DKF Blogger DK Killscreener

Offline WCopeland

  • Spring Jumper
  • *
  • Posts: 551
Re: DKCore Development Blog
« Reply #2 on: April 25, 2014, 08:10:13 PM »

Here's a similar project you may find interesting:

Out Run Enhanced Edition

I've been following its progress for the past 2 years.

That is awesome Kreygasm
Twitch TV  Streamer DK Killscreener DK 1 Million Point Scorer DK Online Open #4 Winner DK 1.1 Million Point Scorer Crazy Kong Killscreener DKF Blogger Pauline WR Holder DK 1st Man Million DK 1st man 1.1 Million DK Jr. Killscreener 1 Million Point Trifecta DK Arcade WR Holder DK 1.2 Million Point Scorer

Offline WCopeland

  • Spring Jumper
  • *
  • Posts: 551
Re: DKCore Development Blog
« Reply #3 on: April 26, 2014, 07:01:07 PM »
I've been working lately on barrel movement:



In the screenshot above, all mask visibility is enabled.  The green mask above the girders is the movement track for barrels.  The yellow mask above barrels in their "scorebox", or where Jumpman must pass through to gain points (eg -- passing through two scoreboxes before beginning a fall from a jump results in earning 300 points).

I've got a working score indicator on the top left ... this is solely for debugging and will be replaced with the arcade font in due time.

The screenshot shows a funny bug I encountered during development today where rather than telling barrels to roll down at ladders based on internal difficulty, I accidentally told them to fly up.
Twitch TV  Streamer DK Killscreener DK 1 Million Point Scorer DK Online Open #4 Winner DK 1.1 Million Point Scorer Crazy Kong Killscreener DKF Blogger Pauline WR Holder DK 1st Man Million DK 1st man 1.1 Million DK Jr. Killscreener 1 Million Point Trifecta DK Arcade WR Holder DK 1.2 Million Point Scorer

Offline JCHarrist

  • Administrator
  • Spring Jumper
  • *
  • Posts: 529
    • Donkey Kong Forum
Re: DKCore Development Blog
« Reply #4 on: April 26, 2014, 08:01:29 PM »
Very cool Wes. Look forward to watching your progress with this.

Having DK ported to more modern programming languages could open up the door to a lot more "modders". Not many people left who can code in Z80 assembly.
Twitch TV  Streamer DK Killscreener Crazy Kong Killscreener

Offline marinomitch13

  • Strategy Moderator
  • Spring Jumper
  • *
  • Posts: 1789
    • How to Play DK
Re: DKCore Development Blog
« Reply #5 on: April 26, 2014, 11:03:03 PM »
Exactly what Jeff said. You're a pioneer, Wes!

So, how much are you using the commentary of the code that people already posted to figure things out (a priori), and how much are you just figuring out via experimentation (a posteriori)?
“Thou hast made us for Thyself, and our heart is restless until it finds its rest in Thee.” -Augustine, Confessions.
Twitch TV  Streamer DKF Blogger DK Killscreener

Offline WCopeland

  • Spring Jumper
  • *
  • Posts: 551
Re: DKCore Development Blog
« Reply #6 on: April 27, 2014, 09:23:11 AM »
Exactly what Jeff said. You're a pioneer, Wes!

So, how much are you using the commentary of the code that people already posted to figure things out (a priori), and how much are you just figuring out via experimentation (a posteriori)?


I'm using pretty much everything we already know, such as:
http://donhodges.com/Controlling_the_barrels_in_Donkey_Kong.htm
http://www.jeffsromhack.com/products/donkeykong_tech.htm

This is all pretty easy in modern expressive languages.  It's not a hassle to generate random numbers, or calculate odds like "do this 1 in 4 times" like it can be with assembly.

If there are any other resources you know of that would be helpful please let me know.  Most of the basic stuff I linked to will be pretty easy to replicate.  I'm particularly worried about the wild edge cases that happen once on a blue moon.

I'm most interested in any commented code available about flame/firefox logic. I think that will be the most difficult by far to get working correctly, and I plan on doing it last.

edit: Well, that was fast.  The current state of barrel movement (excuse the speed of the GIF):

« Last Edit: April 27, 2014, 11:15:31 AM by WCopeland »
Twitch TV  Streamer DK Killscreener DK 1 Million Point Scorer DK Online Open #4 Winner DK 1.1 Million Point Scorer Crazy Kong Killscreener DKF Blogger Pauline WR Holder DK 1st Man Million DK 1st man 1.1 Million DK Jr. Killscreener 1 Million Point Trifecta DK Arcade WR Holder DK 1.2 Million Point Scorer

Offline WCopeland

  • Spring Jumper
  • *
  • Posts: 551
Re: DKCore Development Blog
« Reply #7 on: April 28, 2014, 07:43:19 PM »
Barrels will now leave the screen if they are rolling on a girder beneath you. Life indicator also added (with the same quirk as the arcade version in showing a bonus life after a death), and there's also an oil drum thing on the bottom left.

Notice that barrels are no longer automatically going down every ladder they encounter.  This is because internal difficulty has been added to the engine. Barrels now respond both to the 1/4 always go down ladder variable and barrel control based on internal difficulty.

« Last Edit: April 28, 2014, 07:46:11 PM by WCopeland »
Twitch TV  Streamer DK Killscreener DK 1 Million Point Scorer DK Online Open #4 Winner DK 1.1 Million Point Scorer Crazy Kong Killscreener DKF Blogger Pauline WR Holder DK 1st Man Million DK 1st man 1.1 Million DK Jr. Killscreener 1 Million Point Trifecta DK Arcade WR Holder DK 1.2 Million Point Scorer

Offline stella_blue

  • High Score Moderator
  • Spring Jumper
  • *
  • Posts: 1501
Re: DKCore Development Blog
« Reply #8 on: April 28, 2014, 08:11:32 PM »

Looking good, Wes!

DK High Score 
952,100
  (L22-1)
DK Level 1-1 
13,400
DK No Hammer 
535,300
  (L15-2)
Twitch TV  Streamer Most Time Online DKF Blogger DK Killscreener

Offline marinomitch13

  • Strategy Moderator
  • Spring Jumper
  • *
  • Posts: 1789
    • How to Play DK
Re: DKCore Development Blog
« Reply #9 on: April 28, 2014, 08:23:57 PM »
If there are any other resources you know of that would be helpful please let me know.  Most of the basic stuff I linked to will be pretty easy to replicate.  I'm particularly worried about the wild edge cases that happen once on a blue moon.


I had Dean explain, on stream, two of the more "edge cases" of the code that I knew of (but didn't know as much as Dean about), so that it'll help you in the future when you get to including them in your port. You can hear what he had to say starting at 2:47:50 into this broadcast: http://www.twitch.tv/up2ng/b/523825178
“Thou hast made us for Thyself, and our heart is restless until it finds its rest in Thee.” -Augustine, Confessions.
Twitch TV  Streamer DKF Blogger DK Killscreener

Offline WCopeland

  • Spring Jumper
  • *
  • Posts: 551
Re: DKCore Development Blog
« Reply #10 on: April 29, 2014, 04:18:59 PM »
I've opened tickets on the repo for some of the things Dean pointed out :)

Today I've mostly been working on wild barrel logic.  While I initially thought this was going to be a complete nightmare, if I shoot for 95% pure emulation rather than 100% this becomes way more realistic.



Timings for basically everything are going to be off until I add the in-game timer feature to compare them back to MAME with.
Twitch TV  Streamer DK Killscreener DK 1 Million Point Scorer DK Online Open #4 Winner DK 1.1 Million Point Scorer Crazy Kong Killscreener DKF Blogger Pauline WR Holder DK 1st Man Million DK 1st man 1.1 Million DK Jr. Killscreener 1 Million Point Trifecta DK Arcade WR Holder DK 1.2 Million Point Scorer

Offline WCopeland

  • Spring Jumper
  • *
  • Posts: 551
Re: DKCore Development Blog
« Reply #11 on: May 01, 2014, 08:11:06 PM »
Starting to look more and more like DK:



Notice level and score indicators are now in place.

Logic for the first wild blue barrel on every board in the game is now also implemented.

What's left for barrel boards:
  • Hammers
  • Normal wild barrel logic
  • Flames
  • Timer
  • Logic for finishing the level
  • Wall jump logic
  • Barrel emitter
« Last Edit: May 01, 2014, 08:14:01 PM by WCopeland »
Twitch TV  Streamer DK Killscreener DK 1 Million Point Scorer DK Online Open #4 Winner DK 1.1 Million Point Scorer Crazy Kong Killscreener DKF Blogger Pauline WR Holder DK 1st Man Million DK 1st man 1.1 Million DK Jr. Killscreener 1 Million Point Trifecta DK Arcade WR Holder DK 1.2 Million Point Scorer

Offline f_symbols

  • Spring Jumper
  • *
  • Posts: 783
  • wht u mean
Re: DKCore Development Blog
« Reply #12 on: May 02, 2014, 09:07:32 AM »
Love it  <Allen>
DK Remix Killscreener Twitch TV  Streamer DK Killscreener DKF Blogger DK 1 Million Point Scorer

Offline WCopeland

  • Spring Jumper
  • *
  • Posts: 551
Re: DKCore Development Blog
« Reply #13 on: May 07, 2014, 09:44:53 AM »
Ok, I've got a small status update.

First I'd like to point out that DKCore itself is not a playable game... it's just an engine modeled after Donkey Kong.  I've been working on a proof-of-concept project built with DKCore called Chibi Kong.



Chibi Kong uses the DKCore engine, but is also emulating Gameboy hardware (resolution, sound, and palette). I'll be talking more about this one later.
« Last Edit: May 07, 2014, 11:17:35 AM by WCopeland »
Twitch TV  Streamer DK Killscreener DK 1 Million Point Scorer DK Online Open #4 Winner DK 1.1 Million Point Scorer Crazy Kong Killscreener DKF Blogger Pauline WR Holder DK 1st Man Million DK 1st man 1.1 Million DK Jr. Killscreener 1 Million Point Trifecta DK Arcade WR Holder DK 1.2 Million Point Scorer

Offline johnbart

  • Full Member
  • *
  • Posts: 87
Re: DKCore Development Blog
« Reply #14 on: May 07, 2014, 10:30:09 AM »
I love what you're doing with this.  It's a neat approach to replicate the logic instead of trying to emulate the underlying hardware.  I'm excited to see how close you can get.

-j
DKF Blogger