4 min read

Farklia

A Farkle dice game for the browser, with computer opponents that can calculate exact odds, a tutorial, and the first pieces of a potential roguelike.

  • games
  • godot
  • pixel art
Farklia's title screen: an orange pixel logo over a starry night sky, a menu panel, a castle on a hill, and a campfire by a tent.

Farklia is a dice game you can play at farklia.harrisonsmith.me, on a phone or a computer. It’s built on Farkle, the old push-your-luck game: roll six dice, set aside the ones that score, and then either roll the rest again or bank your points. Roll nothing that scores and you’ve farkled, and the whole turn’s points are gone. First to 10,000 wins.

It runs in the browser, so there’s nothing to install, and your game is saved as you play. Close the tab, and Continue picks up where you left off.

The rules

Farkle comes in endless variations, so I picked one set of rules and wrote it into the game. Farklia plays by the rules of the iOS game iFarkle, with two changes:

  • Hot dice must be rolled. Score all six dice and you get all six back, but you can’t bank until you’ve rolled them again.
  • Scavenging. When a turn ends with dice left on the table, the next player can roll those dice instead of a fresh six. If they score, they take the last turn’s points too. If not, it’s a farkle.

You need 500 points in a single turn to get on the board. Once someone passes 10,000, everyone else gets one last turn to catch up.

The table on a computer: three 1s set aside and highlighted, worth 1,000, three dice left to roll, and buttons to roll 3 or bank 1,000.

Three opponents

You can pass one device around with up to three friends, or play against the computer at three levels:

  • The Squire banks once it has 350 points and sets aside every scoring die it rolls.
  • The Knight plays by rules of thumb, banking sooner when it has fewer dice left.
  • The Wizard plays the best possible game. It even weighs what its turn will leave you to scavenge.

The Wizard is built on an odds model, and it’s exact, not simulated. One to six dice can come up in 923 distinct ways. The model lists every one with its chance and its best score, and works out the best play from there. With best play, a turn averages 554 points, and one in five turns farkles.

I tested the levels by playing them against each other, 2,000 games per pairing. The Knight beats the Squire 71% of the time, and the Wizard beats the Knight 59% of the time. But Farkle is a game of luck as much as skill. Even the Wizard loses to the Squire about one game in five.

The look

The art is borrowed from this site’s night theme: the same Endesga 32 palette, the same notched pixel borders, and a version of the starry landscape at the top of the home page, castle and campfire included. Like the art here, none of it is an image file. The dice, the scenery, and every icon are drawn by code, and the backdrop is generated from a fixed seed. The sound effects are made the same way. Each one is a few chiptune notes synthesized when the game starts: dice clattering, a coin for a bank, and a womp-womp for a farkle.

It’s made with Godot, and it lays itself out for whatever screen it’s on. On a computer, the table sits beside the scoreboard. On a phone held upright, everything stacks into one column and the dice can go two across, so they’re big enough to tap. Turn the phone mid-game and it rearranges without losing your place. If you’re new to Farkle, the Tutorial plays one guided game against the Squire, with the dice set up to teach each rule in turn.

Three phone screens: the tutorial explaining that a 1 scores 100, a game against the Squire, and an Experimental game with special dice and items on the scoreboard.

Toward a roguelike

The plan is bigger than Farkle. I’d like Farklia to become a roguelike, in the spirit of Balatro, Slay the Spire, and the lesser-known Solitairica, where you build up a set of items over a run. The first pieces are in Experimental mode, against the Knight:

  • Dice with abilities, like the Phoenix Die, which rerolls when it would farkle, and the Jester’s Die, whose 6 is wild.
  • Talismans that act on their own, like the Copper Coin, which adds 50 to every bank.
  • Scrolls you read mid-turn, like the Scroll of Fortune, which doubles the points you’ve set aside.
  • Constellations, which are the scoring combinations themselves. The Eye makes 1-3-5 score 300, and brightening a constellation makes it score more.

There are about sixty items so far, in four rarities. To balance them, I wrote a tool that measures each one by having computer players play a thousand games with it against an opponent without it. How you earn items, and what a run looks like, comes next.

Play it

It’s free at farklia.harrisonsmith.me. On a phone, you can add it to your home screen, and it gets its own little pixel die for an icon.


Back to the journal