Chris Bugg

Developer, Tech-Engineer, Woodworker

(and other stuff)

11 - Harvest

(2023-04-13)

Today I finally looked, at our score that is. We placed 332nd out of 424 compo games. Overall I guess that's not terrible, and probably due to only getting about 20 ratings (for reference, the top scoring game had 74 ratings). That said, it could also be because it wasn't that good.

Oh sorry, I'm of course talking about Harvest, my Ludum Dare 52 game jam game that I co-made with Copilot (previous thoughts on Copilot here). Last time with Feed Max I was getting a feel for how Copilot would work as just a really good auto-complete within my existing workflow. This time I wanted to see just how much it could do on it's own. I felt like with the right guidance, it could, on it's own, make something from scratch. And I think I was right.

I've read a lot of commentary from folks who see the auto-complete as a fundamental limitation of Large Language Models. On the surface, sure. Copilot probably isn't going to give you something workable if you just spam tab over and over. Instead it seemed to me you could guide it to do the whole dang thing, if only you guided it in a way that worked with it's strengths. So that's what I did. I guided it, did things the way they teach you in school (design then build), and it did the rest.

Building the game was an experience. I started with the idea that if I worked from the most abstract ideas to the most specific details, maybe that would be the key to letting Copilot truly do all the work. So we began with the readme.md file. I wrote a bit of starter so it understood where to go:
This is a game made for The Ludum Dare 52 game jam. The theme was "Harvest".
and it came up with the rest:
Based on this theme, I decided to make a game where you harvest artifacts from the beach. You use your metal detector to find the artifacts, and then you dig them up. Each artifact found increases your score, and the game ends when you run out of time. You're given 60 seconds to find as many artifacts as you can. Initially there are 10 hidden artifacts, but as you find them, more will spawn.
Then I gave it more headings to fill out: Controls, Language, Program Structure, and it filled them all out. Of course some light editing here and there was needed (mostly for style), but the overall ideas and details came from Copilot.

We then moved onto the index.html file, but that, along with the style.css file, are pretty short and boring (and Copilot generated most of them, I would never have bothered to add a copywrite notice). So, onto the more exciting bits, the main.js file! At the top, I copied in the overall description of the game, then had it describe the purpose of the file, then list out the more detailed pieces of the design. I then setup comments for the different sections of the codebase (Classes, Global Variables, etc.), and started going through them. My basic approach was to write a comment describing the functionality of the thing:
// The startGame function is called when the game is started. It initializes the game and starts the game loop.
and then let Copilot fill in the details:

function startGame() {

	// Initialize the game
	initGame();

	// Start the game loop
	gameLoop();
}
This worked great! Whenever there was a bit that Copilot was stumbling on, I would just add more comments (or make them more descriptive) and that would help it out. It was of course not perfect, but it wrote...80%(?) of the code itself. This bit was (for me) the true test, and I think Copilot passed! It can make something on it's own, given the right guidance.

For everything else, it's probably a wash. I made the pictures in GIMP, I decided to copy the GPL (seemed appropriate), and I made small tweaks to things to improve the overall fun-ness, but all-along was my ever-present helper, ready to give me a hand when I wanted it.

What a rush! While I went into this trying to prove something to myself, I wasn't entirely sure it would actually work, and maybe I would just look like a fool in my first-ever game jam. But, well, it did work, and I'd say this test is passed. Next up is trying to figure out the legal side of things to see if I can confidently use Copilot for things that aren't GPL. Some of this will get sorted out over the next few years, but I'm excited to see where this goes.

Happy Hacking!
- Chris