Reflections on Programming with AI
Since 2022, AI has been part of the everyday programmer’s workflow for four years. It has now completely changed how we work: productivity, coding conventions, and even architecture have all been turned upside down. Some approaches we once considered foolish suddenly make a great deal of sense.
Localization is a simple example. Previously, we would look for plugins, or call translation APIs to automate the process. Now I can ask AI to generate the translations and keep one text file per language. It is that straightforward, with no plugin required. Maintaining those files by hand once seemed almost impossible; with AI, it barely feels like a problem.
Game combat systems are another example. We used to dislike implementing every ability as a separate script: maintenance was difficult, development was slow, and bugs were easy to introduce. I implemented all combat logic—abilities, projectiles, and buffs—with behavior trees, in a setup somewhat like visual scripting. I even built a dedicated behavior-tree editor. It worked reasonably well in practice. Looking back, though, if I were writing that combat system again today, I would not choose behavior trees or visual scripting. I would have AI write the scripts directly.
I work on an SLG game. Recently, a designer brought us a particularly demanding requirement. We already had a large SLG world map with very complex business logic. The designer wanted a smaller SLG map mode that reused fundamental systems such as marching and combat, but differed substantially in gameplay. Architecturally, I had three choices:
- Reuse the existing code directly and accommodate the differences in the business layer.
- Abstract the shared logic out of the existing code and use it for the new mode.
- Copy the existing code and modify the copy.
In the past, judged on elegance, I would have ranked option 2 above option 1, with option 3 far behind. Option 3 was an architectural taboo: copying and pasting code was a recipe for a maintenance nightmare. If every new mode meant another copy, how could anyone maintain it?
Today, I would choose option 3 without hesitation. I would maintain the main gameplay implementation, then have AI adapt the derivative implementations to follow changes in that primary codebase.
My takeaway is that many clever techniques I once felt proud of now look far less impressive next to AI.
Comments
Questions, ideas and experiences are welcome. Please be kind and avoid sharing private information.
Loading comments…