Donkey Kong Forum

Blogs => Player Blogs => Topic started by: WCopeland on April 25, 2014, 08:47:21 pm

Title: DKCore Development Blog
Post by: WCopeland on April 25, 2014, 08:47:21 pm
Discovering Donkey-Me (see: https://donkeykongforum.net/index.php?topic=857.0 (https://donkeykongforum.net/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/ (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.

(http://i.imgur.com/de52sju.png)

(http://i.imgur.com/rFieomA.png)
Title: Re: DKCore Development Blog
Post by: stella_blue on April 25, 2014, 09:09:00 pm

Here's a similar project you may find interesting:

Out Run Enhanced Edition (https://github.com/djyt/cannonball/wiki/Cannonball-Manual)

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

Title: Re: DKCore Development Blog
Post by: WCopeland on April 25, 2014, 09:10:13 pm

Here's a similar project you may find interesting:

Out Run Enhanced Edition (https://github.com/djyt/cannonball/wiki/Cannonball-Manual)

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

That is awesome Kreygasm
Title: Re: DKCore Development Blog
Post by: WCopeland on April 26, 2014, 08:01:07 pm
I've been working lately on barrel movement:

(http://i.imgur.com/9IqNAYJ.gif)

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.
Title: Re: DKCore Development Blog
Post by: JCHarrist on April 26, 2014, 09: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.
Title: Re: DKCore Development Blog
Post by: marinomitch13 on April 27, 2014, 12:03:03 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)?
Title: Re: DKCore Development Blog
Post by: WCopeland on April 27, 2014, 10: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://donhodges.com/Controlling_the_barrels_in_Donkey_Kong.htm)
http://www.jeffsromhack.com/products/donkeykong_tech.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):

(http://i.imgur.com/x1pTnOK.gif)
Title: Re: DKCore Development Blog
Post by: WCopeland on April 28, 2014, 08: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.

(http://i.imgur.com/s8FwPDd.gif)
Title: Re: DKCore Development Blog
Post by: stella_blue on April 28, 2014, 09:11:32 pm

Looking good, Wes!

Title: Re: DKCore Development Blog
Post by: marinomitch13 on April 28, 2014, 09: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 (http://www.twitch.tv/up2ng/b/523825178)
Title: Re: DKCore Development Blog
Post by: WCopeland on April 29, 2014, 05: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.

(http://i.imgur.com/ObTiSdf.gif)

Timings for basically everything are going to be off until I add the in-game timer feature to compare them back to MAME with.
Title: Re: DKCore Development Blog
Post by: WCopeland on May 01, 2014, 09:11:06 pm
Starting to look more and more like DK:

(http://i.imgur.com/NtvheSt.png)

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:
Title: Re: DKCore Development Blog
Post by: f_symbols on May 02, 2014, 10:07:32 am
Love it  <Allen>
Title: Re: DKCore Development Blog
Post by: WCopeland on May 07, 2014, 10: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.

(http://i.imgur.com/c1QEPQy.png)

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.
Title: Re: DKCore Development Blog
Post by: johnbart on May 07, 2014, 11: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
Title: Re: DKCore Development Blog
Post by: marinomitch13 on May 07, 2014, 01:44:35 pm
Hey, one thing to note (in case you either didn't know this already or forgot to add it) is that Jumpman being on the same x-axis as a ladder steers barrels as well. So, even if he is several levels below a ladder, if he is directly under it, it steers barrels as though he is sitting on it. It's hard to tell from the gifs if you've incorporated this element already, so I thought I'd mention it.

Also, I don't remember the details, but there is something special with the first barrel (or maybe it was a timer based thing that can affect all barrels until a certain amount of time) where the first barrel will always take the first ladders on each levels that it reaches. You'll have to ask around or look in some DK code threads to find out the precise way this works (maybe it is easy to find in the code).
Title: Re: DKCore Development Blog
Post by: WCopeland on May 07, 2014, 01:52:33 pm
Both points already implemented :)
Title: Re: DKCore Development Blog
Post by: marinomitch13 on May 07, 2014, 02:33:15 pm
Both points already implemented :)

Oh, you!...
Title: Re: DKCore Development Blog
Post by: stella_blue on May 07, 2014, 04:52:52 pm
Also, I don't remember the details, but there is something special with the first barrel (or maybe it was a timer based thing that can affect all barrels until a certain amount of time) where the first barrel will always take the first ladders on each levels that it reaches. You'll have to ask around or look in some DK code threads to find out the precise way this works (maybe it is easy to find in the code).

Yeah, at the beginning of the stage each rolling barrel will always descend the first ladder it encounters, if the oil barrel has not yet been ignited.

Title: Re: DKCore Development Blog
Post by: WCopeland on May 17, 2014, 12:23:33 pm
It has been a while since an update, but I've been very busy at work squashing bugs and adding new features to the engine.

(http://i.imgur.com/tmBERVw.png)

The following things are all now working:

I am getting very close to being done with all barrel board logic. All that's left are the things I've mentioned and flame logic (which will be a monster to implement). After that I'll start moving on to the other boards. I've also been jotting down notes of options I'd like to implement into the proof-of-concept, such as:


Since this is a web application (the screenshot above is actually running in Firefox), I can store a lot of these things into a SQL database...
Title: Re: DKCore Development Blog
Post by: f_symbols on May 17, 2014, 02:11:26 pm
love it <Allen> well done sir!
Title: Re: DKCore Development Blog
Post by: Drunkguy89 on May 17, 2014, 02:30:49 pm
Not even Helen of Troy tried to understand flame logic  Kreygasm

good stuff Wes!
Title: Re: DKCore Development Blog
Post by: Roger on May 13, 2015, 06:50:06 am
i am looking for a DKCORE download link that have been working. Please someone can help me?
Title: Re: DKCore Development Blog
Post by: WCopeland on May 13, 2015, 10:20:25 am
i am looking for a DKCORE download link that have been working. Please someone can help me?
Sorry, this project is on hold indefinitely :(
Title: Re: DKCore Development Blog
Post by: f_symbols on May 13, 2015, 10:56:02 am
Sorry, this project is on hold indefinitely :(

what you mean
Title: Re: DKCore Development Blog
Post by: Roger on May 14, 2015, 04:51:50 am
but someone has a DK script level one for use in the Construct 2 ? I'm trying to create a game using only the engine of the first level of DK platform game with barrels, but it would be for use with own characters. Someone in the group would or could indicate a link or something to help me. thanks !!
Title: Re: DKCore Development Blog
Post by: Bounty Bob on April 03, 2017, 04:17:36 am
Hi Wes. Looks like great work and I was interested in looking into the code, but the github link gives a 404 error. Any ideas?

*edit : Never mind, I read page two now and see you've put the project on hold, which is fair enough. Any plans to make the code available again?