07-14-2020, 05:00 PM
(07-14-2020, 01:18 PM)_Aka_ Wrote: Hi,
I see your problem as being two separate problems:
1- find the way between points A and B
2- make the train follow that way
Point 2 is related to Curvy. Using a mechanism similar to the Junction mechanism in the example scene 12 should do the trick.
Point 1 is a wider problem, not specific to Curvy. It's basically path finding. Since you are planning to have multiple rail roads connected, I think you better try to find an already existing path finding solution that would work good, instead of trying to invent your own path finding algorithm. I have no real experience with the path finding problematics, but I did some projects using that when student. A* algorithm was a good algorithm at that time (is there anything better since?). It's a simple algorithm, and I am sure you can easily find implementations for it using C#
I would advise you to read this: https://en.wikipedia.org/wiki/Pathfinding
Hi I agree I shouldn't re-invent the wheel, it just feels like this level of AI/pathfinding should be SO simple, it's literally just got to choose path A or B and is constrained to simply moving or stopping on splines... no obstacle courses to try and work its way around or anything tricky!
I did start to look at A* as like you say I think it's considered the best, so I'll take another look, it just felt like it might be overkill for what is essentially very very limited movement and calculations literally restricted to tracks. Thanks as always for your input!