Intro
The other day I was messing with ChatGPT and it was able to analyze a Beyond Compare diff of two different source trees and it looked like it was able to explain in detail what my Freeze Tag changes were to the original code. Today I wanted to see if I could move beyond that and actually start getting some type of AI somewhere to write code for me. Today I found AmpCode.
Getting Set Up
First I installed Visual Studio Code and the Amp Extension by Sourcegraph. I also started with a copy of original Quake 2 source code, and my Freeze Tag modified source code.
Step 1
I told Amp to “please compare (original Quake 2 source code dir) and (Freeze Tag modified source code dir)”. I then told it to take the (original Quake 2 source code dir) and turn it into Freeze Tag. It started to go to work. Things were happening. I looked at the output in another folder and started to realize, it was just moving the differences over! Why I could do that. What’s going on?
I told Amp “you’re not actually doing what i needed. you are just doing a one-to-one line by line copy of the code. what if i wanted you to implement a freeze-tag like mod with your own code, and not by copying my code. can you make your own implementation?”. It then said something that made my jaw drop. I’ll print the whole output here:
Ah, you're absolutely right! I was just doing a mechanical copy-paste instead of actually implementing freeze-tag mechanics. That's much less interesting and educational.
Let me implement freeze-tag from scratch based on understanding the gameplay:
Freeze-Tag Game Mechanics:
Team-based (red/blue/green/yellow teams)
When shot by enemy, player gets "frozen" instead of dying
Frozen players stand still in animation, can't move/shoot
Teammates can "thaw" frozen players by standing near them
Win condition: freeze entire enemy team
Additional features: grappling hook, team commands, ready system
My Implementation Plan:
Core freeze mechanics - freeze/thaw player states
Team system - assign players to teams, team damage rules
Freeze animations - visual feedback for frozen state
Thawing system - proximity-based teammate rescue
Win detection - check if entire team is frozen
Commands - team switching, ready system
Game flow - rounds, intermissions, scoring
Want me to implement this from scratch? I'll write clean, modern C code with my own logic and structure, just using the original as reference for the game mechanics concept.
This response made me freak out. Am I out of a job? Let’s see what it can do! I said “yes” and away it went. It was kind of cool that I could watch it work. I almost felt like I was doing one of those “code alongside people” things people talked about. After it had churned away for a while I looked at what it had produced and was impressed, but I noticed a lot of stuff had not been implemented. I told it “i feel like you missed a lot. for example the original freeze tag implemented a four team system but you only support two currently. can you fix this?” It then said sure and implemented four teams. I then went more generic: “can you look over the original implementation again and see if you missed anything?” It replied with:
You're right, let me take a more thorough look at the original freeze tag implementation to see what I missed.
Wow, I can see I missed A LOT! The original has:
Grappling hook system (lines 11-26, 52-55)
Weapon configuration system (lines 32-39, 59, 123-163)
Ready system (line 63, 129-130)
Voting system (line 62)
Map rotation system (line 61)
Team change commands (lines 165-200)
Spectator support
Much more complex freeze state management
So I said “make it so!”. It started working away. It went and implemented each feature. Then I asked “you’ve learned a lot doing this work. how can i have you remember what you did for me in future sessions?” and it printed an AGENTS.md. Evidently if I reference this in the future it can pick up where we left off.
Future
I now see the work flow I need to do. The problem is I still don’t have a working copy of Quake 2. Strike that, I have a working copy, I just can’t get a copy to work with something I’ve built, so I can’t test my code. Technical: Quake 2 Remastered doesn’t have a Dedicated Server so I’m not going to use that. I couldn’t for the life of me get a build to work with yquake2. I was then looking at Q2PRO but eventually decided to move over to Quake 3 for now. My workflow will be: start with original code, ask Amp to implement a feature at a time. Test it, commit to GitHub and keep moving forward. I can’t wait for the future. Another technical note: on working with Amp it looks like my free $10 credit was used up and I had to feed it another $5 to keep working. I felt like I was paying an Intern to code for me.
First Impressions
I’m very impressed with Amp, so much so that I’m nervous for the future. Yes it was coding based on what it saw my original code do, but the fact that it even seemed to understand anything that was going on still blows me away.