The near future: Trains are no longer controlled by humans. Instead, artificial intelligence is used to handle traffic. Program the best AI, beat challenges on various maps and watch it fight other AIs in live, online matches!
Posts | ||
---|---|---|
Getting started with pathfinding | Post Reply | |
Thread Options | ||
Apr 10 2013 Anchor | ||
You've gone through the tutorials and completed the challenges, but have no idea how to continue? Other players on the server seem to be doing much better than you and you'd like to join the ranks? Pathfinding is not an easy task. There are many approaches, each with their advantages and disadvantages. For beginners in pathfinding:
For advanced users:
If you get stuck, have any problems, or tipps and tricks, feel free to post in this forum! Edited by: Germanunkol |
||
Apr 11 2013 Anchor | ||
Here is a pretty decent video on Dijkstra's Algorithm: Youtube.com |
||
Apr 16 2013 Anchor | ||
Could you explain a little what you mean by splitting into paths? I now use BFS which is like Dijkstra with unweighted edges and only junctions as vertices but it's still slow for large maps. Anyway thanks for the game. I really enjoy it. |
||
Apr 16 2013 Anchor | ||
Hey, thanks for the feedback Hm, I think what you did was exactly what I meant by splitting into paths - only use the junctions as vertecies. When you're looking for a path, find the junctions between which the destination tile lies and then "dijkstra" your way to those junctions. |
||
Apr 16 2013 Anchor | ||
I'm not going into much testing now because my code is a little bit messy and I have to rework it entirely. It's my first project in lua However for map 18x18 executing my implementation of BFS took at most 2500 executions in whole round (not sure if that was the worst case possible). But since the surface of the map (and number of junctions) grows quadratically then I guess for 30x30 it can take much more than 5000. The main reason I have to rewrite my code is I wasn't careful enough while reading docs and I didn't notice the ai.init provide whole description of the map. So my script is full of code doing something like map learning or deterministic exploring But I must say this version of the game would be interesting too EDIT: Edited by: loblpavel |
||
Apr 16 2013 Anchor | ||
That's a great idea! Someone else also mentioned something similar, a game mode with a "fog of war" kind of gameplay. I might implement this at some point, if I find the time... I will give this some more thought... |
||
May 31 2013 Anchor | ||
Hey man, I implemented a pathfinding algorithm using the junctions only, but still i'm getting "taking too long" errors quite to fast. It even happens on 12x4 if i'm unlucky. And at this point i would have a few feature requests: - a game mode with all calls having 50000 lines - and last but rly not least: Will also post these feature requests in the specific thread. |
Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.