hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

8.9K
active users

🧵 Day 1

After prototyping a decent Othello AI, I'm trying to decide how to represent the Othello board in PICO-8.

- 2D array
pros: intuitive
cons: slow to use

- bitboard
pros: uses bitops on 64-bit nums (fast!)
cons: PICO-8 doesn't have 64-bit nums; will have to adapt

Day 2

I've had to animate flipping disks in before, and I did it by scaling a sprite and bobbing it up and down, so it looked like it was flipping.

Today, I did this for Apathello (and added some staggering) to get this neat-looking effect!

Day 3

Not much to show today in the way of game functionality, but I did add a subtle starfield with 500 random stars.

Not sure if I want to keep it. If I do, I'll likely tone down the number of stars.

But even at this point, it comfortably runs at under 25% CPU.

Day 4

I'm designing a font to use for various pieces of text in Apathello for .

It's based on the one on the original cover by @lumbud84 on Twitter. Apparently it's a custom font!

It'll be drawn at a slant, just like the cover. No full demo of that yet, sadly.

Day 5

The fancy font is done! It's being compressed with @zep 's PX9 at the moment.

Drawing it with two sets of outlines is slow, so it's stored internally with one set of outlines, and I add a second outline procedurally.

(Don't worry, the text will be animated!)

Day 6

I've added an to the text! This one is a growing/shrinking effect. I also plan to add at least one more type of letter animation.

Next thing on my to-do list is to add more animations to the "game over" state, which tally up disks and proclaim the winner.

Day 7

After the first week of making Apathello for , I finally have a game over/results screen!

I also put some non-placeholder text on the bottom of the screen, which is also exciting.

(I also have something planned to go on the top of the screen. Stay tuned...)

Day 8

No progress today, sadly.

But I did find out something fascinating about the "bitboard" approach I'm using: the first video game to use it (and in fact, the first video game, period) was a 1952 checkers program by Christopher Strachey. alpha60.de/research/programmin

Day 9

I have a simple animation system using in . Right now, I added animation pausing to this system, so I could avoid having logic in the animation . This refactor makes it feel a lot less hacky.

Pic 1: before
Pic 2: after

Day 10

It's time to start implementing an !

I've together a greedy AI that plays the move that maximizes its winning margin on the next turn. It's not too hard to win against, but it's a start.

Now to make the AI's move-playing look less awkward.

Day 11

I spent most of today at a barcade, but I did spend some time theorizing about Apathello.

I want to design an algorithm to count "stable" disks - disks that can't be flipped - but it's been difficult to come up with one. Even doodling an example board didn't help.

Day 12

I'm holding off on designing a "stability" , to see how good the can be without it.

I have a AI working with negamax and alpha-beta pruning. It likes mobility, loves corners, and dislikes "frontier" disks - disks next to empty cells.

Day 13

Not much to show in the way of new code, but I'm doing a lot of theorizing.

My Othello AI has to evaluate a ton of board positions, so it would be nice to include a transposition table to store these results if we see the position again. But I'm having trouble!

Day 14

One problem I'm running into with transposition tables is that they fill up really quickly.

allows up to 2 MiB of to be stored in memory. Here, I'm only 8 moves in, and I've already used up like half that.

But at least the table's working.

Day 15

We're at the halfway point of the ! I still have to polish up my .

Right now, the moves it tries first are based on a slightly nerfed eval function. But I think it'd be much faster with a simpler metric, based on if the move is on a corner, edge, etc.

Day 16

I just sat through a test game between two depth-5 AIs (the hardest I'm willing to include), and I got an "out of memory" error. Had to fix that quickly.

Starting on a title screen/intro screen today! I'll include a way to choose between AI/human for both players.

Day 17

Sadly, no progress today. I slept through most of the day, actually 😅

Day 18

I should really get started on a title screen, but I decided to do something else first.

To save some memory, I'm storing the AI's calculated moves in a different format (a single cell index, instead of a full 64-bit mask). But at first, I almost broke the AI...

Day 19

Working on my dialog system! It now closes when it's done (if I don't specify to keep it open).

I'm also brainstorming what I want the dark void to look like by itself. I don't want it to be entirely dark...but having only a set of twinkling stars seems cliche.

Day 20

Because I'm using everywhere, I decided to create a centralized system for them, instead of having like 4 systems that each work differently.

Now it'll be easier to run things like the and the box at the same time. (Check out that box!)

Day 21

I'm getting very near the token limit, so I'm including a function I wrote called "tablefy" that converts a specially formatted string to a table.

We'll see if this affects my plans for making the dark void interact with you during games.

Day 22

Holy crap, I just found the subtlest bug in my Othello .

I'm using alpha-beta pruning w/negamax, and my alpha starts at 0x8000 (-32768). With each call, beta becomes -alpha.

Trouble is, -0x8000==0x8000. Which sometimes leads to stupid moves...

Day 23

No more fooling around, time to actually get a title screen done.

I want to have the dark sentient void introduce itself if it's you first time playing, and then I'll transition to a cool-looking title screen.

I've written the introduction. Now to code a galaxy.

Day 24

For the opening cutscene, at first I wanted to represent the dark void with a spiral galaxy animation.

But I think this one fits the context slightly better. It reminds me of neurons & synapses.

Inspired by a from @twitonatrain! twitter.com/twitonatrain/statu

Day 25

I'm still working on a title screen, but I thought I'd also add a neat feature: every few seconds, if the is still thinking, it'll hover over the best move it's found so far.

I like how this makes the AI feel.

Day 26

The deadline was just extended by 2 weeks. What a relief; I don't even have a title screen!

But here are the beginnings of one. That board in the background is meant to evoke the cover art, but I probably won't keep it. Besides, I'm running out of !

Day 27

Guess who finally made a title screen?

The is getting messy behind the scenes for the sake of fitting within the limit, but that's to be expected at this point.

I think I like how this looks and feels.

Day 28

My brother asked me to test out different colors. So I showed him a bluescale . This is apparently not what he meant; he wanted to be able to change the disk colors! 😅

Also, I'm testing out , which on average goes slightly faster than .

Day 29

You uh...did y-you ever notice how...um, did you uh...ever seen an Othello board and it um...well, it had the um...y'know, the little uh...between the uh, thingies on the...um...y'know?

Well, now Apathello has some little "markers" between a few of the grid lines.

Day 30

Today was the original deadline, and I just got done making sure I had the necessary features (and sound effects!) to release this game as-is.

Now to write the dialogue lines I wanted to include in-game. Wish me luck!

Day 31

I gave my to some folks on the server to . One of them said that even the Novice kicked their butt.

And that's when I realized the true meaning of "a minute to learn, a lifetime to master".

I'm gonna try nerfing the easier AIs. 😅

Day 32

I've made some important changes to the AI levels.

First, the different AIs have different weights for certain heuristics (corners, mobility, score diff, etc).

Second, with some probability, an AI may "doubt" its current best move and replace it with a worse one.

Josiah Winslow

Day 33

I slept in for most of the day today, so sadly I didn't make much progress.

Day 34

I've been writing a lot of phrases for the dialog box to say during gameplay.

I imagine this phrase-writing is going to make up most of my progress in the next week or so, so I'll only give updates if I actually change the code from now on.

Day 38

This is the second time I've tried out coding on the . My function for getting my Huffman tree uses 67 tokens, and my function for decompressing Huffman-encoded data uses 121 tokens.

I'll be using this to store the dialogue in my game.

I've been testing out a few different versions of my Huffman decompression function, to see which runs fastest.

I was able to almost double the performance, at a cost of ~29 tokens and some space for a lookup table.

Prototype hype! (Protot-hype? 🤔)

I've written a few dummy categories for messages, and I'm testing out the Huffman encoding/decoding for them. It's coming togeeeetherrrrrrrr...

Day 39

Still fighting against the token limit...but so far I'm winning!

I'm having to token-optimize some functions that, for clarity's sake, I didn't want to. Here's a before and after of one example (317 down to 244).

Anything to get in the dialog feature... 😉

Just realized two things:

1. I can save another 23 tokens by removing a duplicate get_lines_v function I somehow added. (Whoops!)
2. I can save another 3 tokens by adding a helper function shared by the get_lines_b and get_lines_w functions. Not as much as I hoped, but better.

Thread continues here: hachyderm.io/@winslowjosiah/11

I forgot to post that as a reply to this post. Whoops!