The word about AI have been on the streets for quite a while now. As a professional skeptical person, and, not only that, as a professional “I hate and don’t trust technology” type of person, I had no interest on it. Until one day I get a message at work saying we have enterprise licenses to use AI Coding tools and asking who was interested in having access to it. In a few minutes over half of my team manifested interest.
So I did what any secure person would do: Give in to societal pressure and also say I’m interested. And once I have access to it, might as well try it and see what the fuzz is about, right?
I haven’t been really coding much on my free time, so didn’t really care for the productivity gains there. And I couldn’t use non-enterprise coding tools at work, so I never really got into “the perfect storm” for me to try coding with the help of AI. But now, it happened.
I’ve seen the wonderful tales of vibe coding, and also the tales of woes, even the more experienced people in the industry seemed to all have the same thought and opinion: “It’s just a tool, and can improve your productivity if you know what you are doing.”
I have been using AI for a good amount of days now to help me with, and what’s my take? You might ask. My take is that it’s just a tool, and can improve your productivity if you know what you are doing. I could sit here and sing the praises to it, but the truth is that I have been coding *almost* daily for over 10 years now, and, whether I like it or not, I have to say that I am pretty much an expert on this, and I know what I’m doing so this tool helps me greatly because I have experience on thinking exactly what I need, and planning how to do it.
I can easily detect when the AI is making things up or just using things that don’t exist, and I can easily fill in the gaps where AI doesn’t go to. Would it be the same with a Junior Developer? I’m not sure. Probably not. I’m not a Junior Developer so I can’t really be talking much about that experience, and honestly, I don’t really care much. I’m just trying to make a video game on my free time, I’m not trying to push the entire industry of programming tools forward.
All that is to say that, yes, coding with AI helped to reduce the boring parts of it, and allowed me to overcome pain points faster and easier. I feel like it’s important to say that I have one important rule: I don’t let AI edit my files, hell, I don’t even let it read it. I copy it and paste whole files and code snippets like an animal and ask questions about it.
TL:DR; I hate AI. But eventually caved in to the idea of coding with AI assistance. Yes, the productivity gains were substantial.
Anyway, what did I do?
My original goal was to work on monthly iterations and milestones. But I didn’t work on this for almost 2 months. Life happens, people get busy, demotivated, travel do France, runs a marathon, things like that.
But when I got back into this, I had a laundry list of things I wanted to do:
- Rework the cutscene system (vague)
- Improve the enemy behavior (vague)
- Rewrite script for the first scene and add the changes into the game.
I decided to start with the cutscenes.
Cutscenes
It’s worth mentioning that I was, at first, just trying to see what these AI coding tools would say and do. And it was very efficient at suggesting helper functions to create, and ways to simplify the code. Until it eventually called me out on my bullshit.
Wow! It even reads my comments and points out at things I’m unhappy with!
I had already considered doing this move, but seeing this just made me think that I *had* to do this refactor, and so I got into it. It was really just a matter of creating a function that would read a .json and calling the proper functions to queue actions based on it.
So, in 2 days or so I was able to fully do this refactor that I have been holding off for so long, and now everything is better. wow.
The best thing is that now that cutscenes are data files, I can create a separate tool to create cutscenes. Everything in game dev always boils down to having cool tools, so I would like to make a cool tool to create cutscenes for this videogame.
So, you know what next update is going to be about 🙂
On a side note, I reworked the entire first cutscene.
Enemy Behavior
There were a number of small adjustments on how the enemy behaves in this videogame. Let me just list it out.
- When moving, it will look for a tile around the enemy, not the enemy itself. A small adjustment, but one that makes a lot of sense.
- The enemy will look one turn into the future to decide what it should this turn! A significant adjustment. So, if the enemy doesn’t see a good move for this turn it can think about it a little, instead of just being like “Welp, guess that’s it!”
- Did a small tweak so now characters won’t walk on top of each other when moving. I had support for this already, just had to flip a boolean variable. Oops.
- Added a coward behavior to the enemies. If an enemy is flagged as “Coward” it will run away from you when their health is low. Here’s some code snippets!
func IsActorInDanger(_actor) -> bool: if _actor.actor_stats.will_retreat: var health_ratio = float(_actor.CurrentHealth) / _actor.actor_stats.health return health_ratio < _actor.actor_stats.health_ratio_to_retreat return false actor that wont retreat is NEVER in danger.
- I introduced the idea of speed and charge time on the game (just like in Final Fantasy Tactics) so now turns are more dynamic based on character’s speed and it’s something that I can play around with.
What’s Next?
I think it’s time.
The ultimate goal for this part of this project is to have the first Act of this story. I want the first Act to be very good, cool, polished, beautiful, and all the nice words that I can think of. So adding the other two Acts is just a matter of writing a script, and designing cool and interesting battles.
And I want that so the next game is just a matter of writing a cool story and designing cool and interesting battles. Or at least that I have a very tight tactics system so that I can work on adding complexity and making a good videogame.
So it’s time to add the content for the entire first act of the videogame. As of today, that means adding 2 more battles, and 4 more cutscenes. Adding some music, sound effects, and possibly working on some pixel art as well.
We’ll see how it goes next time!
