Introducing the Hexagon Grid Generator

I created an app called Hexagon Grid Generator. It’s open source, runs on iOS, iPadOS, and macOS, and makes it easy to draw hexagonal grids.

Hexagon Grid Generator

In short, Hexagon Grid Generator is two things:

  1. An open source example project (on GitHub it’s called SKHexGrid) for how to use a Swift package called hex-grid to generate hexagonal grids in various configurations.
  2. An easy (and fun?!) way to draw hexagonal game boards.

Here’s some text from the newly re-worked About screen in the application:

There are a couple of other uses imagined for this application (outside of serving as a nice example for the HexGrid library):

  1. You can configure and then Save images of hexagonal grids for use elsewhere. (For example, you might configure a grid for a board game played on a hexagonal grid, save it, then find it in your photos library and print it from there.)
  2. You could also use a grid to play some basic games pass-and-play right here inside the app. There are many games on Board Game Geek playable on a hex grid without much necessary equipment. Here are links to a couple of lists:
        • games played on a hexagonal grid (of any size), with single color markers/pieces/tokens
        • hexagonal territorial games with placement/capture but no movement

why am I just writing about this now?

So yeah, I think this first released in the app store back in March of this year (2023), although it had been on GitHub for almost a year now. I’m only just getting around to writing about it.

I guess I took a break from working on it for a while after Blither came out, but I’m back to thinking about it again, and I have a long list of things I want to make it do. You can see that list in the project README, but it’s a big bullet list that’s not really in any sort of order. I’ve written more about this below.

How did this come about?

While working on the app for Blither, I obviously needed to draw some hexagons on the screen. I had done this at least a few times previously, so of course the first thing I did was go look at my old code. The most extensive project with hexagons was of course Catchup (RIP earlier this year :sad:), but when I opened that up, I found that the hexagonal drawing was quite specific to the app, and not really all that extendible to different sizes or shapes of hexagonal grid.

I was disappointed by this revelation, and really wanted to use a library that could draw a multitude of different sized grids without too much extra effort. First-thing-first was to look to see whether such a thing already existed.

When making Catchup (and possibly even before!), I had been aware of the quite extensive tutorial on drawing hexagonal grids written by Amit Patel (Red Blob Games). That website is, as far as I can tell, the definitive guide on the subject. There are even links to other libraries, and it was there, in the Swift section, that I first found reference to the Swift package called hex-grid, that I ended up using for Blither.

So, while evaluating hex-grid, I still hadn’t quite decided what iOS framework/library I would use for drawing. Catchup uses UIKit, and I’ve used that professionally for over a decade, so it’s definitely the one I’m most familiar with. The only demo (at the time) for hex-grid was written in SwiftUI, which is Apple’s hot new declarative UI library, so I spent a bit of time with that, and realized the demo was quite limited. It really didn’t show off most of the features of the hex-grid library. (I’m also not sold on SwiftUI, but I did use it for all the menus in Blither as well as the menus in SKHexGrid, so I guess I’m coming around.)

I was starting to become familiar with hex-grid, and I decided to experiment with using SpriteKit , which is a 2D game engine/framework/library created by Apple. I’ve always avoided it because a) it’s proprietary to Apple, and b) UIKit is plenty capable of drawing a bunch of stuff really performantly, but at the same time, it has some nice capabilities, and I’d never used it before, so… why not?

Before long, I realized my “test” project (which I’d made specifically to easily switch around which grid is drawn) was a much better example of what hex-grid could do, and as I’d been in contact with the developers of that library a bit (mostly creating issues and asking them to add features for me), I showed it to them, and they promptly added it to the README.

One thing I’m really proud of creating for the application is all the different ways you can configure the coloring of the hexagons inside the grid. This is functionality that is unique to SKHexGrid, and not something that comes from the hex-grid project. (This is a candidate for pulling out of this project and contributing to that one, but it just sounds like a lot of work to me.) There are the following options for shading grid cells in the application:

grid shading types built into Hexagon Grid Generator

There is also a random color shading, but I didn’t picture that here. Each of these (aside from single and random color shadings) required their own algorithm, and were pretty fun to write. I only just thought of another shading type that might be fun, so I added it to the README.

What’s next for this project?

I did just yesterday submit the latest version (v.0.4.2) for app store review, so that should come out shortly. In it, I added the ability to draw and configure dots in the center of each hexagon, as well as lines between each of those center points. Just to illustrate, here are some example hexagons showing off those new features:

grids showing the new “center dots”, and “lines between center dots” features

As I said earlier, I have a long list of things I want to make the project do. I’ll just list a few of them, roughly in the order I want to work on them.

I really want to allow you to save the grid that you’ve customized, so the next time you load up the application you can see it again. This will let you toggle between different grids you’ve created, or save a “game in progress” that you’re playing with the app. But the serialization of colors makes it all a bit annoying. (SwiftUI uses a different object for colors than UIKit or SpriteKit, and it’s not serializable for some dumb reason.) I also think Apple’s new SwiftData framework is going to make syncing your serialized hexagon “save files” via iCloud a no-brainer to implement, and I’m kind of eager to play with that, so I might hold off on this feature until that is released along with the new iOS in the fall.

I think the next thing I’ll actually work on is showing coordinates not on the hexagons themselves, but as a sort of “key” along the side of the grid. This is common if you are doing any sort of annotation of your games, and should be highly configurable. Currently the cell (individual hexagon) coordinates are configurable, both in how they are displayed, as well as which coordinate “style” to use. But I’d like to be able to show the “axial” coordinate style both as two numbers (as it’s used in the library), as well as with a single number and an alphabetical character. Additionally, it would be nice to be able to “rotate” which side shows the coordinates, but I’m not yet sure how I would do that, so we’ll see.

After showing coordinates along the edges of the board, I’d also like to be able to show arbitrary colored borders for the entire grid. This is because one of the kinds of game most commonly played on hexagonal grids are connection games (like Hex). In connection games, the goal is to be the first player to have an unbroken group of your own pieces from one side of the board to the other. Or, as in The Game of Y, between 3 sides of a hexagonal board. Incidentally, showing the lines between hexes, makes the kind of board that is typical for The Game of Y possible, because (as in Go) you typically play your pieces on the intersections of lines, as opposed to inside the grid cells.

Anyway, if you’ve read this far, you are probably in the target market for this kind of application, and you should go download it now!

Download on the App Store

Thrive is out for iOS, Android is still forthcoming

Update: Thrive is live now in both the iOS AND Android app stores.

First the good news – Thrive, the digital version, has been released for iOS. It’s available now, and you can find it in the iOS App Store.

https://apps.apple.com/us/app/thrive-board-game/id1528236222

You can also find it by searching for my name “Martin Grider”, or “Thrive Board Game”. (If you search for “Thrive”, you won’t find it, maybe it’ll start showing up in search results after some folks have bought it, who knows.)

I would very much appreciate your purchases and reviews!

Now the bad news: I thought I was prepared and ready to release the Android version simultaneously on the Google Play Store. This was going to be my first simultaneous app store release EVER, and I was very excited to make it happen.

Sadly, I ran into unforeseen issues, and all I was able to make live is the store page itself. You can wishlist it there, and hopefully it’ll be live in the next week or so:

https://play.google.com/store/apps/details?id=com.AbstractPuzzle.Thrive

Back to the good stuff: This release features a full interactive tutorial for learning the game, 3D graphics that I hope are close to the actual physical product, and the ability to play two-players on the same device. Probably most importantly, it also includes an AI player to play against. But my favorite feature that made it into this release is that it also has the “variable setup cards” from Pond Life, so you can very quickly and easily jump into a game with different setups and peg layouts.

I hope you enjoy it!

Catchup v.1.0.1 & v.1.0.2

Screen Shot 2014-08-07 at 2.46.50 PMHere are the release notes for Catchup version 1.0.1, which was approved and went live in the App Store sometime late last Saturday night (September 6th).

v.1.0.1
* added a setting to let you change who goes first in a vs AI game
* minor changes to text strings, mostly consistent capitalization of AI and Catchup (thanks go out to Martijn Althuizen for help with this work!)
* minor changes to Dutch localization
* relatively significant changes to the german translation
* fix for the “next game” button flashing after you take an async turn
* close the GameCenter UI if the app goes into the background
* misc additional minor bug fixes

Thanks again for playing Catchup!

After getting two emails almost simultaneously on Sunday morning, both letting me know their game over screens were reporting the wrong winner, I pre-pended the following message to the 1.0.1 release notes, and sat down to find the problem:

WARNING: this update actually causes inaccurate end-game win reporting on the game over screen. (The stats and leaderboard submission should still be correct.) This will be fixed in the next update.

And here are the release notes for version 1.0.2 that I submitted to apple on Sunday afternoon, (September 7th):

v.1.0.2
* fixed bug with incorrect winner name on game over screen (Sorry!)
* corrected title bar string on game screen

All of this illustrates one of the frustratingly difficult aspects of solo application development — regression testing. Or, for anyone unfamiliar with the term, testing existing functionality after a code change “to make sure everything still works”. Basically, it was my work on the new feature (letting the user pick whether or not they go first in an AI game) that broke the game over screen reporting. As bugs go, it’s fairly minor. (I don’t mean to belittle the frustration if you encounter it!) Nothing is crashing, and the win statistics are reported correctly, both to Game Center and the internal stats page. I definitely tested quite thoroughly playing against the AI before submitting 1.0.1, but I just plain didn’t think to check local multiplayer, and might have played through an async game, but I’m not 100% sure. Anyway, I clearly didn’t encounter the bug. (Or didn’t notice if I did.) The specifics are kinda funny: the wrong player name is reported as winning the game in async, but only to one of the players. (Which player depends on who actually won the game.) In the local multiplayer scenario, it basically always reported player 1 as winning.

I have plenty more features to work on for the next build I submit, but figured I should get this fix out there ASAP.

Catchup v.0.9.1 & v.0.9.3 – release notes

Screen Shot 2014-08-07 at 2.46.50 PMCatchup version 0.9.1 hit the app store earlier this week. Here are the notes that shipped with that version:

v.0.9.1
* russian localization
* german localization
* settings screen: delete local saved game when changing manual AI level
* fixed a bug with tutorial step 3 not getting displayed
* made popover text scrollable if necessary
* translated a few more strings for all localizations

new in 0.8.x
* traditional chinese localization
* added HSB sliders to color screen, cleaned up UI
* fixed crash in iOS 6

I have been learning a lot with this release, namely about how much extra work localization entails, but Game Center async code stuff also. In fixing a bug at the last minute related to determining whether a Game Center game was still valid (specifically, it goes through and checks all the players to make sure their “match outcome” isn’t set), I introduced another bug, this one making Game Center invitations completely fail, as the match outcome is in an “unknown” state for those, since the invited player hasn’t accepted it yet at that point. Apologies to all the folks who ran into this!

A few minutes ago I submitted build v.0.9.3 to fix this issue. The complete release notes are as follows:

This build fixes a really horrible bug with Game Center “invite” games ending as soon as they began. My apologies!!!

Thank you very much for playing Catchup!

v.0.9.3 details
* fixed “invite” games ending as soon as they are created
* number of “your turn” games is sometimes incorrect, (I need to reset all helper arrays when the UI opens)
* crashing bug when you delete an async game in which it is your turn, start a new one, then click next game after taking your turn (need to re-create all the arrays in the async helper)
* swapped positions of share and close on the game over screen.
* added a new “use english instead of XXX” button for non-english localizations
* lots of fixes for Dutch translation text, some english ones
* credit for Dutch translator in English localization

v.0.9.2
* dutch (nl) translation
* minor change to make one of the tutorial steps a bit more consistently worded

I did use the official form to request an “expedited review”. I have had good results with that in the past, but also know someone who had it “not work” recently, so we shall see.

An Introduction to Generic Game Model

Here are my slides from the presentation I gave tonight at the MN Cocoaheads group about my open source 2D game framework, Generic Game Model.

Description
Martin Grider will share and discuss a few classes he re-uses from project to project allowing him to rapidly flush-out 2D games. The classes themselves are not all that notable, as most developers could probably re-create them in an afternoon, but the techniques are particularly suited to rapidly prototyping turn-based games. He’ll discuss some of his favorite rapid prototyping techniques, as well as talk about “juicing” animations in UIKit, (with a bit of quartz core, as well as a bunch of external libraries thrown in for good measure).

Commentary
As you can see, if you looked through the slides, I have already used this code in a rather large number of projects in the last two years. I was surprised myself, to be honest. At least 8 projects use this thing, 3 of which are in the app store.

My first Cocoapod
While prepping for the talk, I also turned the project into a Cocoapod. I had played around with cocoapods once before, only long enough to install it and run pod install on a test project, (a process which is, if anything, too easy!), but actually creating a pod myself was a new experience, and bit more work than I’d expected going into it. Anyway, you can now add pod 'GenericGameModel' to your projects to try it out for yourself.

Thanks to Bob McCune for running the show and letting me speak!

A 4X Dice Game

dice-pnpThis project came about while I was joking yesterday afternoon with my friend Patrick about how we needed to rush a space-themed dice game to Kickstarter before TMG publishes Eminent Domain Dice.

I’m still working on my deckbuilding 4X game, so 4X mechanics have been on my mind a lot lately, and the more I thought about it, the more I actually thought a 4X dice game could be pretty cool. Right away I had the idea that you would take your actions at the beginning of your turn, then roll the dice to plan out your next turn’s actions. From there, the game practically wrote itself.

I went to BGG to post my rough draft of the rules (without any graphics or pnp files), and before I got that far, I discovered that the theme for this month’s 24 hour game design contest is dice. Well, that seemed awfully convenient, but reading through the rules, I’d have to do everything myself, prototype art and all… so I did.

The other thing I did for this project that I’ve never done before, because I think it’s part of the “complete board game package”, is that I wrote some “flavor text”. I’m actually pretty happy with it too. Here’s probably my favorite bit: “What gravity at the edge of a black hole, this calculating weight of choice?”

So without further ado, here are the rules (and PNP pages, including custom dice in two sizes), for my new game, which I am tentatively calling 4X Dice.

DrawCade v.1.1 submitted to Apple

dc_ss2I originally put together DrawCade in an evening because I wanted to use the iCade for something, and I saw a need. As far as I know, it is still the only drawing application for the iCade. It’s no longer the only iCade app I let my daughter play. (But that’s more because she’s getting into “her” iPad, and has lots of go-to apps now. — Incidentally, YouTube is still the killer iPad app for her.)

Here are the release notes for DrawCade v 1.1:

* Added sound effects courtesy of my 2-year old daughter.
* Triple-tap to open a preference pane with settings for draw speed and turning sounds on and off.
* Enabled drag gestures, so it is more useful now without an iCade (although I don’t know why you would use it without one).
* The preferences pane also has a button to “erase it to black”, as well as a way to see more apps by Abstract Puzzle.

This update was “inspired” by the fact that DrawCade probably gets more downloads per day (on average) than all my other apps. (It’s free, but that was true even when ActionChess was free too.) I wanted some soft cross-app-promotion in there, so I added a preference pane. While I was at it, I figured I should enable drag-to-draw, since my one negative review is about how the iCade is pretty much required to use the app. That’s no longer true, but I don’t know why you would use your fingers to draw with this when there are SO MANY other absolutely great drawing apps out there for the iPad.

I spent yesterday morning re-writing the drawing to use my GGM (Generic Game Model) classes, and then the afternoon adding the preference pane with the buttons to view AbstractPuzzle.com and all my other apps in the app store. I had one really great preference item, repeat rate for the drawing (this was absolutely needed), but was struggling to think of anything else to put on there. I decided sort of late-afternoon to add some sound-effects. This was an idea I had when originally making the app, that the color buttons could also speak the name of the color as you pressed them. I figured it’s mildly educational. Then I had to pick up Colleen (my 2-year old daughter) from daycare. I ended up recording her playing with the app, and prompted her to say all the colors. Now I think the sound effects steal the show.

Just listen to her saying Abstract Puzzle.

Fun statistic: DrawCade had 45 downloads on Xmas day. iCade for christmas anyone?

Oppo-Citrus 1.1 release notes

Here are the things that changed in Oppo-Citrus 1.1. (Waiting for review with Apple.)

* new TAP control scheme – Tap instead of drag to place the bottom row. Hopefully this clears up the confusion about how to use the menu. Can be used in-game also.

* There is a now a music track!!! Access volume controls from the pause menu. (But it sounds great, thanks Tori!)

* New sound effects – sounds for level complete

* Fixed visual mismatch between level select screen graphics and actual levels for levels 3 and 4

* custom games – disabled mini pieces (too many bugs with it)
* custom games – disabled horizontal powerups when piece size is anything other than normal

* about screen – added “all apps” button

* Fixed a crashing bug with completing 200% on level 11. This also fixes the “all levels 200%” achievement. (Special thanks to @brackeen for reporting.)

Oppo-Citrus v.0.8

Oppo-Citrus is live today in the app store.

I sort of forgot it was going to be released today, and the app description, which I’d fully intended to replace with something more descriptive, was simply the following:

Oppo-Citrus is a puzzle game with a catchy name!

Drag the row of fruit from the bottom into the middle of the gameboard, and try to make shapes of 4 or more of the same fruit. It’s that easy!

Enjoy!

So what I’ve settled on (hopefully it’s beter) is the following:

Oppo-citrus is a puzzle game where you drag a row of fruit squares from the bottom of the screen onto a grid to make shapes of 4 or more of the same fruit. As the shapes are removed and points are scored, additional levels are unlocked. Each level introduces some new mechanic or combination of mechanics. See how high you can score on each level!

Play Oppo-Citrus and enjoy the following features:
– 11 unique levels of increasing difficulty and complexity
– hand-drawn pixel graphics for iPhone and iPhone 5
– stereo sound effects made entirely using the sounds of fruit
– GameCenter leaderboards and achievements
– Beat the 11th level to unlock the custom game mode, for unlimited replayablity!

Enjoy!

Anyway, please consider giving Oppo-Citrus a try. I spent about six months making it (part-time), so I hope it’s worth at least a buck. And let me know if you have any problems or find any bugs. Thanks!

ActionChess 1.5 Release Notes

I’m in the middle of the process of submitting ActionChess 1.5 to apple. There is a ridiculously long list of things this build adds from the last one, which was… oh back in October of 2010. That’s over two years ago, and that means I’m a slacker! Anyway, that list includes:

* GameCenter achievements and leaderboards for all game modes.
* Retina graphics for normal iPhones (iPhone 5 support in the next version… probably).
* New “tap-based” input method. (The old drag-based method still works also.)
* New AbstractPuzzle/ActionChess news feed.
* New help button on the home screen.
* New “wiggle” animations when pieces get near the top of the screen.

There are probably about 500 other minor changes. Unfortunately, that list doesn’t include fixing the one or two UI bugs I know about (that annoying flashing that happens *sometimes when the level changes is still there, I’ve seen it). Here’s a list of things I want to tackle for the next version:

* release the more or less completed static-Puzzle mode
* modernize the interface to support iPhone 5, and possibly (hopefully) the iPad
* fix those bugs I mention, and quite possibly give the graphics an overhaul

Thanks for playing!