Page 17 of 22

Re: trAInsported: Alpha testers needed

Posted: Sat Mar 30, 2013 10:27 am
by substitute541
That's what ai.blocked is for.

Edit: Well Gusmanak was fast...

Re: trAInsported: Alpha testers needed

Posted: Sat Mar 30, 2013 7:42 pm
by whitewater
Germanunkol wrote:Well, you can use ai.blocked() to notice and resolve this solution.
The easiest way would be to return a random direction in ai.blocked() and then try to find a new way at the next junction. That's sort of what my test AI does.
Having done so, I can now reliably(?) cause a pileup of sorts by following these steps

Create a very large map so my script hits the timeout
Have a lot of trAIns.
Increase the speed to 90x

The trains will (hopefully(?)) group up into one part, lag will happen, and the deltatime as seen by the program will be higher than expected. They will literally jump off the tracks and just kind of stick there for upwards of an hour of ingame time.



Edit: Is it possible you need to fix your timestep?

Re: trAInsported: Alpha testers needed

Posted: Sun Mar 31, 2013 2:01 pm
by Germanunkol
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...

Re: trAInsported: Alpha testers needed

Posted: Fri Apr 05, 2013 7:34 am
by Germanunkol
Just a short update:
There's been lots of activity on the website these past few weeks. It's amazing what all of you have come up with - the AIs are much better than what I had hoped for. Many players even uploaded AIs, let them play for a few days, checked out how they did, and then uploaded improved versions. I love how everyone has their slightly different approach and I love how the AIs each do differently well under different conditions and against different enemies. The outcome of a match is very often a surprise...

So thank you to all of you who have played! It's very rewarding for me to see the feedback and activity! :D

It'd be great if some of you could share the game with friends or write about it on blogs/in forums... since I still have not had any luck with trying to get indie news sites to mention the game.

Re: trAInsported: Alpha testers needed

Posted: Sat Apr 06, 2013 11:10 pm
by frpnit
Congratulations sir, i've seen that your game was spoted on Indiegames blog!

http://indiegames.com/2013/04/freeware_ ... ns_on.html

Re: trAInsported: Alpha testers needed

Posted: Sun Apr 07, 2013 10:59 pm
by Germanunkol
Yeah, thanks! :D
Totally overwhelmed my webserver though :P

Re: trAInsported: Alpha testers needed

Posted: Mon Apr 08, 2013 2:07 pm
by Robin
It also reached the top of /r/programming a few days ago.

Re: trAInsported: Alpha testers needed

Posted: Mon Apr 08, 2013 7:17 pm
by Germanunkol
That's probably why my server was overwhelmed, yes :D
Over all, I got a very nice, positive response from the public.

Re: trAInsported: Alpha testers needed

Posted: Mon Apr 08, 2013 7:18 pm
by Nixola
Are you going to upgrade you server PC or lighten your server software?

Re: trAInsported: Alpha testers needed

Posted: Mon Apr 08, 2013 11:31 pm
by Germanunkol
I might need to buy a server instead of using a raspberry pi :(
But it was soooo cool!
Also, I don't make any money with this right now... so renting a server for a project that doesn't make any money seems... wrong. Especially because I don't just need storage place, I actually need to have full ssh access to it.

One of the users seems to have "stolen" someone elses AI and just uploaded it as his own... that's a little sad.
I could do a diff comparison on the files, but that might end up being a lot of diff calls when there's lots of AIs... any ideas?