Added a train node and scene that moves along the preplaced track nodes
The train moves toward a target exit or middle node until it can no longer go straight or it falls off the edge
The train uses the chunk nodes as waypoints, going from exit node to middle node then whichever exit node is chosen
The train defaults to going straight until it cannot. Once it cannot go straight it filters all exits removing exits you came from or lead nowhere
If there are no available directions, it moves to the end of the last node before stopping and falling off the edge
Planned Updates
Adding player input so you can control which direction the train goes
Adding indicators that show the default path for the train without any inputs. If input is given the train and indicator should move properly
Adding more things that happen when trains arrive at stations
And a lot more stuff
What was the goal
My main goal was to add a train and design the default path so it automatically starts and begins progressing throughout the default track. I had a lot of the foundation set that made it so I could use the nodes and they could move through the nodes. I had to make sure that there were conditions that made sure they could check to see if the exits lead to another chunk or just the void. The hard part was if a four-way was connected to a horizontal without a direct path but the train still moves over the void to the chunk. I had to check the chunk nodes and exits for the following neighbor chunks also to make sure it was a valid chunk, which took a while to troubleshoot. I want to next try and create more junctions and the default path indicator using arrows. Right now the path is generated as the train moves but if I wanted to set the indicators, I would have to premake the default path, which would also require some more time and work.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.