Programming, Topic: Games

All posts

Recent posts

Locking BGA tabs with UserScripts

I play a lot of games on Board Game Arena (BGA!). A lot of those are turn based games with random people, but I have two subsets of games that I consider ‘more important’:

  • Turn based games with people I know
  • Alpha games I’m testing

Unfortunately, the first tends to have longer ‘per turn’ times and the latter doesn’t have a timer at all, so both end up right at the very end of the sorted table list. But both, I’d rather play first and in-between other games.

Super niche problems, I know.

Generally, my solution has been to keep a tab open for each of those games in a Firefox Tab Group, but in those cases, I keep navigating off those pages accidentally (thank you next table button).

Super super niche problems, now.

In any case, I whipped up a quick userscript (I use ViolentMonkey) that will:

  • Detect if a tab I’m on is one of the games I want to ’lock’
  • Remove the next table button (buttons; there are two different ones)
  • Disable navigation (at least make it pop up a warning)
  • Periodically refresh the tab (BGA tends to go to sleep in the background)

read more...


Building a virtual CPU from NAND gates up

Over the past couple of weeks, I’ve spent entirely longer than I probably should have falling down the rabbit hole that is the game Turing Complete.

In a nutshell, you start with basically nothing, build up simple logic gates, create memory cells and 1-bit addition, build that into 8-bit math and logic, read instructions RAM, implement loops, and function calls (in hardware!), and eventually use your very own custom built CPU to solve a few programming challenges.

read more...


Ludum Dare(ish) 56: BugShine

Ludum Dare? That’s been a while!

I didn’t actually enter the game jam. Honestly, I wasn’t sure I was going to write anything. But I had a bit of an idea and spent a few hours only on Sunday hammering something out:

Yeah, I did another cellular automata thing 😄

It’s not at all complete, but the basic idea is:

  • Generate a random level
  • See it with multiple players (colonies of bugs)
  • Each bug will send out waves of ‘shine’, expanding their territory
  • Take over the map to win

It’s sort of got that?

I’m using Rust as I’ve been doing a lot recently.

The main libraries are:

  • pixels for the rendering; it gives me direct access to a pixel buffer, which is my favorite
  • winit for windowing; this did require the feature rwh_05 to be properly compatible with pixels, which took a minute to track down

Other than, that, it’s straight custom code which you can see in it’s entirety on my github.

  • main.rs - creates the window and handles input
  • world.rs - runs the simulation mostly in an update function; with generation in new

I think that perhaps the only really interesting bit about the code is how the ‘shine waves’ work. Basically, I have a grid of the state of each cell, but I also have a Vec that tracks ‘active’ pixels. Those are the only ones that can update–which both helps performance and makes the simulation appear the way it does.

Overall, a nice quick project. More than anything, it actually convinced me to try setting up something that can render pixel buffers on Rust. And with a (very minimal) GUI, too! Both things I’ve been meaning to learn.

I probably won’t do anything more with this code, but it’s got the seeds of something more interesting. Keep an eye out. 😄

Onward!

read more...


AoC 2022 Day 17: Tetrisinator

Source: Pyroclastic Flow

Part 1

Simulate Tetris on a 7 wide board with a given (infinitely repeated) series of left and right inputs to be applied on each frame before dropping the block and a given (infinitely repeated) set of blocks. Once 2022 blocks have been dropped, what is the total height of the placed blocks?

read more...


AoC 2021 Day 21: Dicinator

Source: Dirac Dice

Part 1: Play a simple game (describe below) with a loaded D100 (that always rolls 1, 2, 3, … 99, 100, 1, …). Return the score of the losing player times the number of times the die was rolled.

read more...


LD46: Tetris Life Scoring

And so it ends.

Results

CategoryPlaceScoreRatings
Overal282nd3.68826
Fun408th3.43826
Innovation17th4.2827
Theme290th3.91726
Graphics608th3.31326
Audio436th3.18224
Humor761st2.20524
Mood529th3.20826

read more...


LD46: Tetris Life v1.0

Controls:

  • Left and right to move the block and forth
  • Z and X to rotate it (or crash into things)
  • If a block gets stuck, you can hit ENTER to lock it in place
  • ESC to quit the current level

Goals:

  • To win: Get the plants to the top of the level
  • To lose: Kill off all of the plants #keepitalive

EDIT: I have included a v1.1 update that fixes a few minor bugs. Feel free to play either the official v1.0 build or the slightly updated (~10 minutes) v1.1 build with:

  • Add a ceiling
  • Correctly scale target
  • Scale control speed by difficulty

And there you have it. This page will serve as the main entry for Ludum Dare. If you’d rather download an executable for Windows/OSX/Linux, you can do so on the GitHub release page:

Speaking of which, per the Ludum Dare rules (and because I would have anyways), the full source code:

MIT Licensed. I would appreciate a comment if you do anything cool with it.

Ludum Dare page, if you’d like to see my entry:

Some updates since last time:

  • Music!
  • More elements!
  • Polish!

read more...