Hm... is it possible that you use the version where the maximum number of lines an AI can execute has not been reduced yet?
Please try the newest version from
github (if you don't have git, just download it as a zip file and rename it to .love)
This one only allows 25% of the previous number of lines that you could use to execute your code.
This problem will probably never be resolved entirely. The thing is this: I need to stop people's code after a while, if it takes too long, otherwise the game will lag as you are experiencing. To do this, I have three options:
- Stop the AI after a set amount of time. This works by checking the time after, say, 500 lines of code have been executed. Drawbacks: The game will allow more lines to run on faster PCs, it will no longer be "fair". Also, when the AI is uploaded, it will behave differently on the server, with no way for the players to tell why the AI is suddenly doing much worse than it had been doing offline.
- Stop the AI after a certain amount of lines. This is what I currently do, but the main problem is that not all lines take the same amount of time, and not all lines really correspond to "one line" of code. print("") for example uses up quite a few lines of code and using some string reg-ex functions you can almost stall the program as they have lots of C-code lines internally but only count as one Lua line.
- A mixture of both. This will have the drawback of both though...
So this might be a "won't fix" problem...
My server's currently down, it seems. I'll try to fix this...
Edit: It's back up. Seemed to be a problem with no-ip.com.
Edit2: I reduced the maximum number of trains on the server. That should at least speed the game up on the server, hopefully it's now fast enough to cope even with AIs that do a lot of computing.
On the client, you can still have twice as many trains on maps. So basically, if the map runs too slow, the best way is to reduce the map size, because the number of trains you can have is proportional to the mapsize and because pathfinding usually takes much longer on large maps.
Sorry, at this point, I think that's the most I can do...