Track as a graph
So far the track has been modeled a series of points with a spline constructed between them. That approach has no way to support junctions/forks.
So this evening I quickly swapped over to modelling the track as a graph - surprisingly painless. In the screenshot the red squares show track points and the green lines are showing where we've correctly detected a meaningful junction/decision point in the track (i.e. where it's vital we model it as a graph and not a line).
Next up will be to overlay a spline on the graph - probably by doing e.g. A* pathfinding to a destination and then adding the points to a 'spline' which we do our u-value movement over.
I don't think I will have to do any correction for speed vs. spline length because all the points are guaranteed uniformly distributed, but we'll see..
Train game
A work-in-progress game probably featuring trains. Not a puzzle game.
Status | In development |
Author | d w roberts |
Tags | Life Simulation, Trains |
More posts
- Train delayed (or cancelled)Nov 04, 2023
- Back on track(s)Jun 01, 2023
- Train yardsApr 23, 2023
- Frame timing hellApr 21, 2023
- Basic object placementApr 15, 2023
- Spline cleanupApr 10, 2023
- NPCs, shops, inventoriesApr 09, 2023
- Basic gameplay milestoneApr 03, 2023
- Invisible technical workApr 02, 2023
- Putting some more thought into artworkMar 26, 2023
Leave a comment
Log in with itch.io to leave a comment.