In the last few days —maybe a couple of weeks— I’ve been trying out a car with different characteristics. Although it might not seem like it, since up until now I had only posted videos with the same sports car, the game’s physics engine actually allows for cars to behave "realistically" based on their specs (power, weight, transmission, etc.). In fact, I had already modeled a second car some time ago, but it had been "forgotten" while I was polishing other things. Now I’ve brought it back and adapted it to work again with the latest version of the code.
The result seems pretty good, and on top of that, I’ve added a feature that lets each model have its own engine and gear shift sounds.
On the other hand, I think it’s about time I start sharing more details on how I’m using AI. In fact, I’m not just using it through programming. I also asked Gemini to create some sketches for the car selection screen (or garage), and after a couple of tweaks, I settled on this version.
With that idea in mind, it was time to add the garage screen state. In this case, the routine work would be handled by Claude. I was about to tell it not to include any graphical elements, but I let it do whatever it wanted, and since it already knew the full context, it generated a menu screen proposal with the necessary SDL and SDL_Gfx code. Honestly, I didn’t like it much —it had a few layout issues (too bad I didn’t take a screenshot)— but it was fully functional. That allowed me to reuse code for buttons, image loading, and a few other things, but in the end, I laid everything out myself to match the look proposed by Gemini (with a few color changes). This is a good example of how one or more AIs can get you ahead with some of the work, but also a reminder that we shouldn’t lose control over what they do so we can tweak, expand, or discard whatever is needed.
Well, here’s the final result. Pretty close to Gemini’s proposal, as you can see.
I should also mention that everything scales based on the resolution you choose, and I’ve had to compile a more recent version of SDL_Gfx for Amiga, since the one available doesn’t include the function needed to draw rounded rectangles. Fortunately, after figuring out the right settings (basically forcing hardware-based floating point calculations), the issues were resolved.
But it’s not all about AI… As I mentioned earlier, the sound is specific to each car, and I’m extracting it from videos of those particular models, pulling the audio from them. There’s a lot of work involved. SDL (well, SDL_mixer, to be precise) in version 1.2 doesn’t let me change a sample’s frequency dynamically to make it sound higher-pitched as the revs go up. The solution is to use twelve different samples that switch based on the engine RPM. That means I have to select a segment of audio where the real car is accelerating and then split it into twelve parts. Oh, and I also have to make sure each sound loop is clean. Lots of work in Audacity.
The same goes for 3D objects and Blender. In earlier videos, you can see a blue supercar. Now it’s the same one, but white. That’s because I’m selecting cars and assets for the track that have permissive licenses (like CC), and when I generated the sprites with the blue one —way back at the start— I didn’t keep track of the author’s name and don’t remember what the license was. Luckily, for popular cars there are lots of versions made by different creators, and I found one that looked good and had the proper license. Whew… that reminds me I need to add a credits screen. Anyway, the point is: when I’ve got a car ready, I render it in every needed position and then compile all of that into the sprite sheet.
And one more thing I almost forgot… I also had an early test of the Monza circuit sitting in the drawer. I haven’t had time to finish it properly, but in terms of layout I think it’s already pretty close to the real thing —at least as close as it can get for a game like this.