AnToHu0 wrote:Is that possible to know where one of my trains locates now? For example my train goes to a passenger, but another AI boards him first and i need to recalculate the path to new goal. For this i need to know current coordinates of my train. Ofcource its possible to wait when the train arrives to next junсtion, but this way it needs more calculations to check stored passengers list.
Hey,
No, that's not possible. Of course, you could estimate, but since you can't actually do anything when not at a junction, the calculations I'd have to do internally would probably be almost as costly as the calculations people need to do now. However, I'll think about just exposing the internal train values to the users, maybe that's possible somehow.
One thing I noticed: Everyone seems to be using Djikstra, A* or similar algorithms. All of these work in real-time, there's no pre-calculation involved. However, since there's more time in ai.init() than in any other function, it might be smart to set up some sort of net of connections in there. Dijkstra could even work with that...
Has anyone tried something like this? I realise it's more involved, but it might be worth it...
asfreng wrote:np dude, thats its free xD, how can i test my AI using the numbers of lines u are using in the server?
I decided to leave it at the old settings for the time being. But you can see how the server has a real hard time keeping up when you connect to it and your AI is playing...
You can however get the source code from
github or extract the .love file I posted, open Scripts/ai.lua and change the line
local MAX_LINES_EXECUTING = 20000
near the top to something like
local MAX_LINES_EXECUTING = 5000
I might have to go for 5000 or so in the future. That's too bad
But I don't see a way around this. One of my friends suggested being able to "buy" more code-lines using the money the train makes, that might be interesting in this case.
Maybe I'll set a maximum 5000, unless you spend money on code lines, in which case you can get up to 10 000 lines.