Kong [1.0.3]

I was referring to Player coordinates :slight_smile: Scenery is just easier to imagine optimizing. (but yeah I probably shouldn’t even have been wasting time since it’s so small)

(number of Component elements) * 3

No, only 2 bytes. You don’t need a delimiter. :slight_smile:

I would also have to add extra logic in the rendering

That’s always something you have to keep in mind but for my original suggestion it’d just another layer of for loop, which isn’t very expensive. But as you said, should start with bigger fish.

Unfortunately, the Player coordinates cannot be rearranged like the Scenery one could.

Right, I hadn’t though of that … hence my thinking of a delimiter of some sort :slight_smile:

In that case maybe wait until pressing send in case you think of other things to add?
This doesn’t have to be fast paced, there’s no rush to get these changes made.

If you edit less than 5 minutes after posting there usually isn’t even a pencil/edit icon displayed on the post.

This is a very valid point. Sometimes ‘obvious’ savings have hidden costs.

Something I notice about that data is that it has a clear pattern to it.

The girders all have +10 to the x and -1 to the y.
The overhead girders have +12 to the x and +0 to the y.
If all the data has patterns like that then you could do:

// Structure
struct SceneryBlock
  Components components;
  uint8_t count;
  uint8_t startX;
  uint8_t startY;
  int8_t deltaX;
  int8_t deltaY;

// Data
{ Components::Girder, 8, 9, 67, +10, -1 },
{ Components::Ladder, 1, 9, 47, 0, 0 },
{ Components::Girder_OverHead, 5, 21, 47, +12, +0 },

Depending on how the numbers balance of course.
This is great for sequences but costs 3 more bytes for single objects (unless you make a special case for a length of 1, but then you wouldn’t be able to use a struct, you’d have to encode it as raw data).

One quick optimization for barrels is that perhaps you should only encode the difference between position and then when the barrel rotates…

So instead of:

// 3 bytes
69, 18, static_cast<uint8_t>(Rotation::None),	

// 1 byte
SHRINK(2, 1, NO_CHANGE); // 3 bits x, 4 bitx y, 1 bit for "rotate"

The encoding for “Starting positions” should probably be elsewhere. Or maybe I’m not understanding the rotations, sometimes it seems it just randomly switches - not sure what’s up with that.

Anyways if you really needed more space seems the PLayer coordinates and Crane are where to look.

As the barrels roll down the first ramp they are rotating one way, then it falls to the next ramp which is inclined the other way so the barrel rotation changes direction.

Your approach could work and save memory however, I have logic that allows the three starting postitions of the barrels to merge at the bottom of the top ramp. I would need to think how I might sort that out.

Agreed. I think I will hack the Crane as this is the easiest to manage without breaking a lot of the game play.

Thanks for your suggestions. Have you actually played the game? What are your thoughts??

No, I’d have to find an Arduboy, lol. I just compiled it, analyzed it and disassembled it, and skimmed the source.

1 Like

You do realise you can play the game right here in this thread right? :stuck_out_tongue_winking_eye:

If you count emulation! Ugh. :slight_smile:

To me it still count as playing the game, emulation or not.

I clearly don’t understand how to play. Half the time I can’t jump and it’s pretty infuriating. Also feel like my foot catches the boulders all the time despite it being clear from the screen they were 2+ pixels away from me, not colliding.

Didn’t you ever play the original. You can only jump in the areas where this no overhead girders.

Yes that is something @vampirics has mentioned. I will reduce the collision rectangle.

Like a million years ago, lol. Yeah I figured that out now. Pretty impressive little game you got her.e :slight_smile:

Per pixel collisions might be nice too.

I just loaded this on my flashcart and gave it a whirl, so far I’m liking it. Looking forward to it having sound.

Going to have a crack at adding music / sound this weekend, will see how I go! :smile:

1 Like

I will love to see what you come up with! I have some sounds in there already.

I will put in some changes that will free up some memory in a half hour or so.

I have also posted a new HEX with a few changes and fixes. You can play it online using the link at the top of this post.


…is good? :wink:

EDIT: just made another commit - realised there ought to be a sound for grabbing the hook! :smile:

1 Like

Thank you for your help on the sound!


I have just committed @uXe’s sounds into the game and renamed in V1.0.


Just curious… Why use Kong in this? Why not make this same game with different kinds of characters, like a dragon, or an armadillo, or something to set it more apart from the original?

This is a remake of a classic game from my childhood … why would I want to change something so recognisable?