New game: Hexxagon

Ahahahahahah… :slight_smile:

That reminds me I actually figured out that the arrangement I used for the video is a terrible one. With it, the first player can always win in as low as 2 moves. I am trying now with a second arrangement for 12 Blinks but I suspect 15 will be needed.

Thanks. Glad you liked. Did you try it yourself?

I only have seven tiles so not yet. Will try once I get my fresh batch from the Kickstarter :slight_smile:

Fair enough. You are excused. :wink:

FWIIW, this arrangement actually works for 12 Blinks and 2 players:

1 Like

Ok, I am really excited now. I did a lot of work to reduce the storage usage and got it as low as 86% (down from 98%). I wanted to implement some nice animations (specially one for when a piece takes over other player pieces) but, unfortunately, although I was able to get some of the required code in, including a mock animation just for testing, I was not able to hook things up so it would actually do the animation.

BUT the reason I could not do that is because I was bothered by the performance of the game and the fact that, under some circumstances, it would be possible to get the game look like it locked up and even using the escape hatch (long press) to reset the game would not fully fix it.

I wanted to do something about this. Rewriting parts of Blinklib was part of this but also fixing broadcast messages. The end result is that now I am proud to announce that The following changes went in into the game:

  • Performance is at least 3 times faster than it was before. It does not feel sluggish at all now! This was accomplished mostly by being able to use fire and forget messages for state transitions. Getting to a point where using fire and forget messages would work on all cases is what took modt of the space I freed but it was well worth it.
  • Game does not randomly locks up anymore. Even if it ever locks up, in most cases no one will notice because I am proud to say it is now also self-healing.
  • Assuming there is a case that I did not see yet where it would lock up and would not be able to self-heal, long-press will now do a full state reset in all Blinks, which should sort any lingering issues.
  • Implemented a notification system. Currently used on setup to indicate to the user that the current board setup is not valid (it must have a least 2 players and at least 1 empty space). All Blinks will flash white once to indicate this.
  • Added the groundwork for enabling takeover animations. Not hooked up as I will need to find more space now.

That is it for now. Give me another week and I will call the game final. :slight_smile:

2 Likes

And on the subject of space optimization, I just went from 98% to 95% storage usage by simply forcing some small functions not to be inlined (__attribute__((noinline))). If your game has some small functions (for example, getters/setters) that are called more than a couple of times, it is well worth trying this trick. There was a single function that gave me back 48 bytes (I would never guess I would think reclaiming 48 bytes would be something I would be amazed at :wink: )!

Now I implement all I wanted, went over 100% storage usage, did some more space hunting and I am now down to 97% storage use. Considering I already got near 100% usage at least 3 times and went over 100% usage once, that is no small feat. :slight_smile:

I will make a video now an upload it.

And here it is:

Things to notice:

  • Flashing animation to indicate invalid board state during setup.
  • The speed pieces now react to clicks (you can see a click being missed right in the start but this is because I am consuming clicks every loop. I will change that).
  • The takeover animation (the Blinks being conquered “explode” from their current color all the way to white and then drop immediately to the color of the player that conquered them).

That is it, I am calling it done. I might still do some small changes but that is it. Any artists here willing to give it a go at a sticker graphic for it. Not that I would expect it to be published or anything (hint, hint) but who knows? :slight_smile:

5 Likes

@BGA You did a really phenominal job on this game! Movement selections seem very responsive, and the new animations look great. I’m definitely excited to have such a strategic game on the blinks platform, as well as something that can really take advantage of larger numbers of blinks. I think that I’m probably going to end up playing this one quite a bit!

2 Likes

Thank you for your kind words. I will be happy enough if people actually play it. :slight_smile: Too bad I ended up having to complicate things and create a custom Blinklib to get it to work. :slight_smile:

1 Like

I just thought of something that might work in this game. An option to self-destruct. In your turn you can decide to self-destruct a Blink and the end result is that it and all surrounding Blinks would turn empty. This might add a strategic twist to the game

Thoughts?

Now where an I going to find the space to do it? :slight_smile:

So, I was able to find the space and implement self-destruct but in hindsight I am not sure this adds anything to the game. It might with more blinks but with only 12 right now I was hard-pressed to find a use for it.

Just cloned your repo to try to run this. I manually copied files into the hexxagon folder to fix the symlink errors. Then I installed your custom blinklib to fix that #error.

I ended up having to comment out this line in pending_send due to isDatagramPendingOnFace not being found.

if (isDatagramPendingOnFace(face)) return true;

Finally I think it compiled, but is too large.

hexxagon.ino.elf section ‘.text’ will not fit in region ‘text’
region `text’ overflowed by 411 bytes

Not sure what to try next.

Sorry for the trouble. :frowning: I really wished it would be easier to get this running but that is the price I paid for creating a custom blinklib. :frowning:

I can only assume somehow you ended up with an older version of my custom blinklib. The first versions had a different url from the non-beta ones. Are you using https://github.com/brunoga/blinklib/releases/latest/download/package_bga_blinklib_index.json ?

Ah right you are! I had grabbed the first link in that thread, which of course wasn’t the latest. Got it programmed now, but having trouble making moves once a game is started. I get the spinning animation when I select a tile, but nothing I try lets me make a move. Did I get an old version of the game too?

[Edit] Oh wait, probably that line I commented out.

[Edit2] Yes! That was it. I’m playing now :slight_smile:

Just finished a game (against myself). Very nice!

How do I start a new game? Once I filled all the tiles they all went back to pulsating orange. Now clicks don’t respond.

Long press. To save bytes I had to remove click to restart. :slight_smile:

In hindsight, that is terrible ui and I managed to save space in other ways. I will add click to restart back.

Forgot to mention that the reason they went back to pulsing orange is because the game ended in a draw. The end state shows who won (in the case of a draw, the empty blinks won :slight_smile: ).

Here are the general information on how to play:

At any point in game:

  • A Blink that is alone will pulse white. This is just to indicate that (I mostly added it because my small kid always removed the pieces and sometimes they were not correctly connected back. I might remove it if I need more space).
  • Long pressing any blink will reset every blink to the Idle state.

Idle State:

The game starts at this state. You will see empty (orange) Blinks pulsing. Clicking any Blink moves the game to the Setup State.

Setup State:

  • Press any Blink to set it to the next player (Orange -> Red -> Blue -> Green -> Magenta).
  • Double click any Blink to move to the Play State.
  • If when you double click the game is in an invalid state (you need at least 2 players and an empty Blink in the board), Blinks will flash white and the game will not move to the Play State. Fix the problem and double click any Blink again.

Play State:

  • The pieces of the current player will be pulsing with their color.
  • Click any of those pieces to mark it as the origin. A spinning white dot will indicate the selected origin.
  • Empty Blinks that are in range for a move will light up.
  • If there are no empty Blinks in range, all Blinks will flash in white and you have to pick another origin.
  • If there are no empty Blinks in range of any of a player Blink, the player can pass their turn by double-clicking any blink.
  • Select target. It must be one of the indicated bright orange Blinks. When selected It will also be indicated with a spinning white dot.
  • You can switch to another target or origin by selecting other valid pieces. Selecting a new origin will recompute the valid targets (and deselect any existing selected target).
  • Click the selected target again to confirm the move.
  • If you moved to an adjacent Blink, you will “duplicate” your piece and take over the target one. If it is not and adjacent Blink, you will “move” to the new place (the origin Blink will now be an empty one).
  • After you move, any Blinks that belong to other players that are adjacent to the target position will now be yours. They will show and explosion animation (will ramp up from their color to white and then drop immediately to your player color).
  • The game state will then be validated and it will either move to the next player or will move to the end state (in case the game is finished).

End State:

  • All Blinks will switch to the pulsing color of the winning player. If it is a draw, then they will all switch to the empty player (orange).
  • Click any Blink to go back to the idle state to start a new game. This was recently added.

I guess this covers everything. :slight_smile:

2 Likes