Advice on making a railroad system?

Hello, fellow CryEngineers!

I am fairly new to CryEngine (but not to game development in general) and plan on making a railroad-based action game using CryEngine 5.

Now, on to the real question: does anybody have any good advice on how to implement a railroad pathfinding system into a game such as mine. I'd greatly appreciate any places to start with, in addition to any other useful advice you can give me. I presume that it has something to do with AI, which is why I chose this section to post this thread in. Anyways, I look forward to hearing some of your responses. Please and thanks in advance!

Re: Advice on making a railroad system?

I would avoid using ai pathfinding system. Railroads are usually straight with some curves and junctions. There is no need for complicated ai pathfinding. Id rather create railroads and separate them with some names or indexes for example road0 splits to road 1 and road 2, where each of those lead to other city for example. Now I would made each city or some other target place check railroad for example road0 goes to that city, so road0 is checked by that city to see where is injected, if it detects that it is injected into road1 it checks where road1 is injected, until it finds target city on the other side. Then it stores that road and all roads that it leads to. And every train would get that data from nearest town to get all possible paths that lead to his destination and choose the shortest. Sum of lengths of these roads would also be stored in the city along with the path. It would then also consider if the choosen path is busy at some point and used by other train, if so, it would select other path.

As for the movement itself it would simply rotate itself like a real train led by the railroads and anything it pulls along.
Cryengine tutorial videos on my Youtube channel! Check it out !

Who is online

Users browsing this forum: No registered users and 1 guest