After writing the last blog entry, I came up with a different approach than I originally had in mind for obstacle avoidance; got it knocked out yesterday with little difficulty, though overall the day still felt unproductive compared to Monday and Tuesday. Started working out the plan for driving, and that has turned out to be more complex than I had anticipated. The transition into the vehicle is working now, though I can’t help feeling like I’ve mucked up the code a bit by not having thought it out more completely up-front.
Where it stands now, you can path a character to a vehicle, and route the vehicle on after that; the set route transfers from the character to the vehicle, and all works quite smoothly. Got some code that’s implemented but not tested yet so it will be ready to handle passengers, when I get to implementing them, but first, I need to deal with the edge case of new path data that is still being entered when the actual transition into the vehicle occurs. Currently, an uncommitted path is simply cancelled, but it’s already clear that’s going to be frustrating to players, so despite the work involved, gonna have to rework and extend the code to allow it to carry over as well. Other than that, the main vehicle-related feature left to implement is exiting vehicles, but the same functions that handle entering vehicles should handle the reverse case with the same ease.
A bit disappointed with the progress since the last blog update; I think I’d let myself get cocky after the first two days, and I know I’d initially underestimated the complexity of the features I’ve implemented in the last two. Still, I think I’ll be able to have the playable prototype done by the end of the weekend, just in time for my free trail period with unity to expire early next week. After vehicles are finished up, the next big task is getting animations in to replace the primitive placeholders there now; then the baked-in pathing data for AI characters.
I’m starting to think the highly modular approach I took to the script designs may have been a mistake; it’s getting a bit complex as more features layer in over more features, and they’ve started becoming more interconnected than I’d ideally like, but there are still benefits that I think will pay off later; the Movable behavior, for example, will work the same way for the Autorouter behavior script I’ll implement for the AI as they do for the plain Router behavior now, and Selectable and Notable are already getting some use independent of the others.
Did some more testing on my iPhone, and the SelectionManager is going to need some tweaking; the way drag detection is handled now is too sensitive, and is interfering with identification of taps when touching instead of using the mouse.
With luck, by this time tomorrow the vehicle code will be 100% complete and I’ll be working on getting some animated sprites going. Would really like to have the animations working and the AI control scripts finished by Saturday night, so I’ve got all day Sunday to finish the misc. other bits, find and fix bugs, and generally polish the prototype up a bit.
Hmm. Put like that, I’m wondering if having the prototype finished by the end of Sunday isn’t still a bit optimistic, but if I don’t make it the goal, it’s guaranteed not to happen, so I’m just going to give it my best.