Author
Topic: DKCore Development Blog (Read 8557 times)

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.

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.

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):

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.

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

Logged

“Thou hast made us for Thyself, and our heart is restless until it finds its rest in Thee.” -Augustine, Confessions.

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.

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.