Some of my tools and software have been arond for some time. Plenty of people use them them, judging from queries and stats I see, but few write back to tell me where it’s actually been used. Here I document some of the published projects. I’m always pleased to see more.
Continue readingUnity’s Problem
(Unity the company, not Unity the engine)
Unity have recently announced their third recent round of layoffs, and pretty much everyone is blaming CEO John Riccitiello for persistent mismanagement.
There may be some truth to that, but the fact is that Unity has a bigger problem than its CEO, or its technical flaws. A problem rarely mentioned that explains most of the rest.
Continue readingnice-hooks
I’ve created a new open source library.
I’ve been learning quite a bit about AI and AI Alignment recently. A few weeks ago I joined the Interpretability Hackathon. Sadly my contributions were minimal as I had to leave halfway through, but doing it made me appreciate how bad the tooling is in this area.
So I’ve created nice-hooks, a library for working with pytorch hooks and activations more effectively.
The Man Who Won: Chapter 1
Hi all, Adam here. I recently attended a creative writing class. It taught me that you don’t need to wait for permission to start writing. I thought I’d have a go at making flash fiction. Enjoy!
Tim was on one of his rants again.
Continue readingAnnouncing Sylves
I’ve released a new library, Sylves that handles the geometry of grids for C# or Unity. I’ve basically distilled all my knowledge from several different grid projects, and made a solid base for anything you might want.
Constrained Text Generation with AI
I was discussing how AI text generation, such as ChatGPT, might end up getting used in computer games. So far, designers are fairly reluctant to adopt the technology. One of the key problems is that you just can’t control the output enough. Language models will break character or respond in inappropriate and toxic ways. Finding a good solution to this is a huge research field, and not likely to get cracked soon.
For the foreseeable future, AI in games is much more likely to be used offline – assets and dialog generation generated up front, so it can be vetted before being integrated into the game.
But it got me thinking, can we vet the AI’s output in advance, but still get the benefits of intelligent decision making at runtime? It turns out, we can! I doubt it’ll be useful in every circumstance, but I can certainly see uses for it, like chatbots, games.
The code and demonstration for this article is available here.
Continue readingInfinite Quadtrees – Fractal Coordinates
A cool technique I’ve wanted to write up for a while is “Fractal Coordinates” described in a paper by Peter Mawhorter. Don’t be scared by the name, it’s essentially a variant on quadtrees that covers the entire 2d plane. Fractal coordinates have some interesting properties that are useful for procedural generation.
But first, let’s catch up on quadtrees.
Continue readingHow does Planet Work
It’s been over a year since I last deconstructed how a game does its procedural generation. Today we’ll be looking at Planet, a 2016 cosy design toy by one of my favourite developers, Oskar StÃ¥lberg.
Continue readingEverything you need to know about Quaternions for Game Development
Defining Chess Piece Moves using Regular Expressions
Suppose you wanted to code a simple chess game. One key bit of game logic is to describe what are legal moves for each piece. There’s only 6 types of piece (pawn, knight, bishop, rook, queen, king) so this isn’t exactly a hard task. You can write rules such as:
def canRookMove(from, to):
# Ignores questions about colliding with other pieces
return (from.x == to.x or from.y == to.y) and from is not to
But these days, I’ve been thinking a lot about grids, and the above approach just doesn’t generalize. What if you wanted to play chess on a stranger grid?
![](https://www.boristhebrave.com/wp-content/uploads/2022/06/3_players_chessboard.jpg)
What would it mean to play chess on the grid above, or a hexagonal grid, and so on? You’d have to write a whole new set of rules, and they could get very complicated depending on the grid in question. What I want is a language that describes how pieces move, which generalizes to any board. And I think I’ve found it, using regular expressions.
Continue reading