Hey there…
haven’t done this before, so don’t expect a proper blog post.
I stumbled upon the AmazonQ CLI challenge https://builder.aws.com/content/2y6egGcPAGQs8EwtQUM9KAONojz/build-games-challenge-build-classics-with-amazon-q-developer-cli a few days ago and thought it would be fun to try my luck with one of my fav arcade games – Puzznic. So, after installing AmazonQ CLI, I dived right into it.
-
One of the things I wanted to see is how it would perform for someone who does not know the ‚inner‘ workings of the CLI and how to tweak it and make it super versatile and powerful. So, no MCPs, no fancy tricks, no funny business here. Just download and fire away.
-
I did a really bad job documenting this. I have kept a few notes and that’s what I’ll post – bullet style. I didn’t even start with a repo from the beginning, so currently there is only one commit.
-
the game is playable, but incomplete and buggy. I intend to continue working on it, until some lawyer sends a seize letter and makes me stop. Moreover, this is 99% AmazonQ code. I rarely made any manual changes, since the point (for me) was to practice on prompt engineering and evaluating how the CLI will perform „on its own“.
-
There are a lot of things to be fixed and implemented. Moving platforms are missing, due to the fact that Q failed to create them properly on the first attempt, the level progression system is so-so, levels are missing, scoring system needs enhancements, blah blah. But as I mentioned, I intend to continue working on this.
Final note – AmazonQ CLI did quite well. In some respects it messed up badly, but overall and mostly it did well. I might not be relying on it for production stuff in the immediate future, but I’ll surely be keeping an eye on it, as it did better than I initially thought. There are things to be fixed (but when is that not the case?). Overall I enjoyed working on this and I’ll be coming back…
As for the „bullet-list“ dev notes:
Starting prompt (description of the game was „borrowed“ from https://www.mobygames.com/game/15247/puzznic/ ) :
I would like to create a clone of a classic arcade game called Puzznic. It is a tile-matching video game first released in 1989. The challenge in each level of Puzznic is to manoeuvre a selection of blocks into place so as to clear them all, by making them make contact with blocks of the same design. You control a cross-hair, which can move a block left or right, which can cause it to fall if there is no block under the space it would occupy.
There are many complications in terms of solving the levels. Moving platforms mean that you need to move a block at a particular time, or in particular order, to prevent them from being blockaded. In some situations there are an odd number of a certain type of block – solving these requires positioning two of the blocks one space apart, such that a move will result in a piece making contact with two others, and immediately removing all three. You will also encounter blocks positioned on platforms suspended in space and gaps in level arrangements meaning that a certain number of blocks must be in place to make a certain move possible (by forming a stack, for example).
The game structure is slightly unusual, as after you complete each batch of four levels you get a choice of two sets of levels – you are progressing through an expanding matrix of levels, which means there are two sets on level 2, three on level 3, four on level 4, and so on. This means that there are a total of 220 screens in the game. Each screen is played against a time limit, and losing a level (either by running out of time, or by making a poor move and leaving an impossible position) loses one of your three lives.
-
first version was up and running in less than 15 minutes. Not very presentable or even playable since there were several bugs, but still it was operational.
-
there were several iterations of bug fixes and updates. The updates had to do with anything from fixing visual issues to adding sound, or just making it follow closer the logic of the original game
-
In some cases, Q was updating the code and then in the next step, it was failing an action because it was trying to find the code it had just changed.
-
Also got errors such as :“Tool validation failed:
Failed to validate tool parameters: missing fieldcommand
. The model has either suggested tool parameters which are incompatible with the existing tools, or has suggested one or more tool that does not exist in the list of known tools.“ without any more details, so the reason for the failure is unknown. -
It also appears that when I made changes to the code manually, Q did not pick them up and it failed to identify the code to change, since it was looking for its original code.
-
In general, Q missed several game concepts at first, but once given specific instructions it was able to handle them approprietly.
-
In several occassions, after failing to find the code to update, it decided to create new files and rename the old ones in the process. In one occassion though it totally failed to complete the procedure since the commands it wanted to run made no sense:
mv js/crosshair.js js/crosshair_old.js && mv js/crosshair.js js/crosshair.js
cp js/crosshair.js js/crosshair_old.js
mv js/crosshair_old.js js/crosshair.js
-
Even though I provided screenshots for reference in order to get graphics closer to the original game, the result was not correct. The tiles were drawn using patterns that did not resemble the game. In the end I provided detailed descriptions on how the shapes should look like and that helped. However, the fact that it could process screenshots is a real plus!
-
At some point the terminal crashed and I lost all my context. Maybe saving should be automatic (even if that’s behind an option)
-
CLI input system is fast on one hand, but leaves a lot to be desired on the other… Especially when pasting error logs for processing, subsequent typing might bring up the whole logs you previously entered, resulting in a lot of noise
-
NOT a good idea to start multiple tasks/changes at once, as the focus gets easily lost
-
No immediate UNDO system. You need to ask it to revert changes „manually“, meaning going through the code again, removing new code, re-adding deleted code and so on through the same procedure, leading to delays. Combined with the previous note (asking for multiple different changes and then needing to undo one) can get messy
-
Timings reported are 99% wrong. All „thinking“ processes are measured as 0.0 seconds
-
It had a really hard time implementing a „moving platform“ mechanism. After hours of trying to get it right, I asked it to remove all related code so that I will restart and attempt to do it again, even if it is required to be done manually.
-
It was extremely efficient in creating a level designer. Two prompts and everything was up and running!
Here are some screenshots I took during development:
So, anyone who’s still interested, keep an eye on this space for future updates!
Thanks all!