Overview
|
Track builder is a fun kids game where you can build your own train track and drive a train on it. You can also put other objects in the game map. The train fires golden balls that can interact with objects and detonate fireworks.
|
Creation
The original idea for having a train tracks game came from watching my kids build trains with wooden train tracks. The idea fascinated me; that a kid could use these wooden pieces to construct something a train would ride on. I also noticed how my kids really LOVED playing with trains. I though "wouldn't it be cool if they could build trains in a game anyway they want!" After spending 3 months working on Track Builder I released it on Google Play 2/8/2020.
Development Challenges
I knew a game like this would have challenges. The first challenge was placing the tracks. I used the same concept used in the Roller Coaster Tycoon games, each track piece would be compatible with certain pieces ahead of it. I built each track piece using simple 3D objects in the Unity Game Engine. Getting each track piece to line up perfectly was difficult. Also since each track piece had a number of other pieces it could attach to, the process of creating tracks was tedious.
Getting the train to stay on the track was a really big problem for while. It wasn't realistic to use physics to keep the train on the track, mostly because the track wasn't perfectly smooth and simulating the way train wheels stay on a track was just not possible with Unity. So I used waypoints, the train would move from one waypoint to the next and the waypoints would be lined up with the track.
Using waypoints presented a whole new set of problems. If a waypoint was missed; the train would leave the track. Some user's found this hilarious others found it infuriating.
The solution to the problem was based on an idea I learned from some of my professional work; smooth curves. When you turn from one heading to another while moving from one point to another you are slowly rotating. That rotation can be calculated as it is directly proportional to the distance you have traveled between the two points. I won't get too far into the math, but this method of turning allowed the train to turn more smoothly and precisely. The other advantage it had was the train would never leave the tracks.
Getting the train to stay on the track was a really big problem for while. It wasn't realistic to use physics to keep the train on the track, mostly because the track wasn't perfectly smooth and simulating the way train wheels stay on a track was just not possible with Unity. So I used waypoints, the train would move from one waypoint to the next and the waypoints would be lined up with the track.
Using waypoints presented a whole new set of problems. If a waypoint was missed; the train would leave the track. Some user's found this hilarious others found it infuriating.
The solution to the problem was based on an idea I learned from some of my professional work; smooth curves. When you turn from one heading to another while moving from one point to another you are slowly rotating. That rotation can be calculated as it is directly proportional to the distance you have traveled between the two points. I won't get too far into the math, but this method of turning allowed the train to turn more smoothly and precisely. The other advantage it had was the train would never leave the tracks.
Other Improvements
During the train curve update process I also added two new levels; a snow level and a lava level. Various UI updates were added as well to make the game work better with newer devices. Track builder is a really fun game and has been a great exercise in mathematical and programming concepts.
This is the lava level of the game. Trains and lava? Sounds like a fun combination to me!