Devlog #15: Vehicle rework
I’ve completely restructured how vehicles work under the hood. The main goal was to break down the code into readable, reusable pieces.
Vehicle componentization
The vehicle script had become too large to work with, so I split it into five scripts: vehicleBody.gd, drivetrainComponent.gd, path_movement_component.gd, CargoComponent.gd and attachment_component.gd. This makes the code easier to maintain and reduces the chance of bugs when adding new vehicle types.
Vehicle data
I have converted the nested Dictionaries into custom resources which makes it easier to add vehicles and less error prone.
Pathfinding improvements
I tweaked how the pathfinding works by chamfering the corners so vehicles navigate them more smoothly. It doesn’t look quite as I want yet, but combined with animations, it should look acceptable for now. This is something I’ll have to find a more permanent solution for later.
Release
I’m targeting version 1.0.0 for Saturday, August 22nd. There’s still quite a bit to do, but I think I can make it. I set this deadline because I’ll have less time once school starts.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.