Trying to create autoserver for Rally

Discussion related to Turbo Sliders and beta version feedback.

Moderator: Forum Moderators

Post Reply
User avatar
Wokinger
Community User Level: 3
Community User Level: 3
Posts: 310
Joined: Sat Aug 15, 2009 5:00 pm
Contact:

Post by Wokinger » Sat Feb 23, 2013 9:27 pm

dede wrote:
Wokinger wrote:StartPos aren't respected in racelog. I tested few orders and saw that some work wrong, but didn't write down which.
So basically you are saying that /starpos <nick> <pos> command works to set positions but in racestats it makes no effect? Or it makes wrong effect?
If you do not use that command, otherwise, everything is ok?
/startpos <nick> <pos> sets positions in game, but in racestats are different (don't know if it makes wrong or no effect)

In game u can use 4 type of order (0,1,2,3).
Some of them (best lap is checked) sets position in game, but in racestats are different

my hypothesis is that there is always startpos sets by "/order 0" in racestats.

User avatar
dede
Community User Level: 5
Community User Level: 5
Posts: 3314
Joined: Mon Apr 10, 2006 10:29 am
Contact:

Post by dede » Sat Feb 23, 2013 10:00 pm

Wokinger wrote: /startpos <nick> <pos> sets positions in game, but in racestats are different (don't know if it makes wrong or no effect)

In game u can use 4 type of order (0,1,2,3).
Some of them (best lap is checked) sets position in game, but in racestats are different

my hypothesis is that there is always startpos sets by "/order 0" in racestats.
Thanks, this will be helpful for correcting bug in new version.

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Sun Feb 24, 2013 12:55 pm

Order 1 is buggy too. Next try 0 (Random).

Dede, what you think is estimated schedule for ts2.1? Is Ande working this thing right now, or is it sometime next year when we hear about him next time? :wink:

I think the download size of these rally files is problematic because couple players visited server but left after a while.

I mean track files are ~4000kb and cars on top of that. Difficult to get new players to join.

User avatar
dede
Community User Level: 5
Community User Level: 5
Posts: 3314
Joined: Mon Apr 10, 2006 10:29 am
Contact:

Post by dede » Sun Feb 24, 2013 1:26 pm

power79 wrote:Dede, what you think is estimated schedule for ts2.1? Is Ande working this thing right now, or is it sometime next year when we hear about him next time? :wink:
My plan is to get something ready before the summer. Yeah, my plan. We are talking, I'll give you updates when things will be defined better.

User avatar
Wokinger
Community User Level: 3
Community User Level: 3
Posts: 310
Joined: Sat Aug 15, 2009 5:00 pm
Contact:

Post by Wokinger » Sun Feb 24, 2013 2:30 pm

power79 wrote:I mean track files are ~4000kb and cars on top of that. Difficult to get new players to join.
I can prepare few stages <500kB. ;)

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Sun Feb 24, 2013 2:51 pm

Thx Woki, but I think we stick with these ones until its 100% sure that script and server works without errors. At this point seems that StartPos is the only big problem and that has only occured when 3 players have raced. If it can't be fixed with this TS version at least I can set MaxPlayerNumber to 2 . :lol:

But maybe you can offer a download link for package that I can advertise on server? Of course to really new players that might not be enough if they don't know how to get it work with the game.

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Tue Feb 26, 2013 10:04 pm

I managed to finish next version today. Now there is 3 different rallies (each has 8 stages). Server randomly selects new one after one is finished. It won't select same rally twice in a row. I add more rallies later.

I do some more testing tomorrow morning and if everything seems ok I put the server up. It should be running around 10:00 CET - 22:00 CET from wednesday to friday. If its not there it just means that I am fixing something.

If there is problems I probably have to roll back the database, so some of the records might get lost. I try to backup db time to time so that damage is minimal.

It seems to be working with one driver. When there is more players it hopefully works. If problem is stage times then its probably the StartOrder bug. All I can do to that is to try different order. Other problems are most likely script problems and I try to fix those asap.

All welcome to test. Remember to download tracks (at least mini_dakar, RMPTS_RLBC, SLBS) from http://f1sl.thegoo.us
My upload bandwith is quite low and files sizes are big.

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Wed Feb 27, 2013 9:47 am

Unfortunately I couldn't get any start order to work with racestats.log when I tested with 3 players. I put the server up but with max 2 players. Maybe it at least works now.

Only solution what comes to mind is to set startpos for every driver and keep those in memory and not use StartPos from racestats.log at all. But then I have to find the best way to know which players are connected before race.

How is startpos set to those drivers which I don't set with startpos command (late connectors)? What happens if player whose startpos is set disconnects and gets kicked out before race? I really don't know if this is possible to get to work until the bug is fixed...

User avatar
dede
Community User Level: 5
Community User Level: 5
Posts: 3314
Joined: Mon Apr 10, 2006 10:29 am
Contact:

Post by dede » Wed Feb 27, 2013 12:26 pm

power79 wrote:Only solution what comes to mind is to set startpos for every driver and keep those in memory and not use StartPos from racestats.log at all. But then I have to find the best way to know which players are connected before race.
Or maybe analyze the recording after the race? Tijny could help in this matter.

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Wed Feb 27, 2013 9:09 pm

dede wrote: Or maybe analyze the recording after the race? Tijny could help in this matter.
You mean the .tsr file? I don't know how to even open it. Its not a text format file.

I noticed that using /startpos in cup macro actually seem to result correct startpos in racestats.log, but to make autoserver to use /startpos I would have to get info on connected players before race. I tried to get them from log.txt but for some reason my script couldn't read that file. Maybe the game locks it while it writes to it or something.

I am pretty close to giving up with this. Maybe some day Ande fixes the bug and I can get this running...

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Thu Feb 28, 2013 9:11 am

Ok. I managed to read the log.txt file and now script sets startpos for every connected player it finds there. It is not pretty solution, but I take it.

So now its testing time. There is one a bit longer rally(~10min) and two shorter ones(~5min) in rotation. I add more once there is enough testing done.

So all you have to do now is drive! I can see from log files if(when) there is errors so no obligations to report every small one. I'll be also driving many times during the day.

And if server is down, it means I am fixing the script and it will come back up later. I try to keep it running for at least to 22:00 CET.

ps. Anyone have ideas how to autoreset server if last player disconnects before rally is over? (I want rally to start from beginning when someone joins to empty server)

User avatar
Wokinger
Community User Level: 3
Community User Level: 3
Posts: 310
Joined: Sat Aug 15, 2009 5:00 pm
Contact:

Post by Wokinger » Thu Feb 28, 2013 10:30 am

power79 wrote:ps. Anyone have ideas how to autoreset server if last player disconnects before rally is over? (I want rally to start from beginning when someone joins to empty server)
maybe log.txt and counting players. If empty "/restart"

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Thu Feb 28, 2013 11:30 am

Wokinger wrote:
power79 wrote:ps. Anyone have ideas how to autoreset server if last player disconnects before rally is over? (I want rally to start from beginning when someone joins to empty server)
maybe log.txt and counting players. If empty "/restart"
Seemed to work but I think I have to work on it to make it more fail safe. So I leave that function out for now.

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Fri Mar 01, 2013 6:51 pm

Now there should be 11 rallies in rotation. Haven't had time to test if it works but it was only a database update so it should.

Also now start position is set based on last stage results (fastest 1st) so disconnected players should not be in a way at start.

Longest rallies should take ~20 mins (+ waiting times) to drive. Of course you don't need to finish rallies if you just want to set stage records.

I left out longest Dakar stages. They are quite nice for Extreme Rallies but maybe not for autoserver.

Pingus visit today also revealed one small bug that is now fixed. So thx Pingu, even you didn't drive any stages. 8)

All tracks are provided by Wokinger. You should download them if you don't have them already.

http://student.agh.edu.pl/~wokinger/rajdy/ - #1 Baja Poland + #1 Dakar (2012)

http://student.agh.edu.pl/~wokinger/sldakar2013/ #2 Dakar + Mini-Dakar (2013)

http://student.agh.edu.pl/~wokinger/RMPTS/ RMPTS tracks

Server is down for the weekend but i keep it open today for few more hours if someone wants to do a quick test.

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Fri Mar 01, 2013 7:57 pm

Notice to Lanz and Szy: Server restarted because script didn't add any tracks for new rally. So updating database ended up breaking it after all. Lets try again on monday.

edit: found and fixed the error.

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Mon Mar 04, 2013 9:45 pm

Question:

Autoserver had problems setting startpos to player that had space in his name. Do I need to use "" signs for names that include space when setting startpos? Or could there be some other problem?

User avatar
szymek66
Community User Level: 2
Community User Level: 2
Posts: 195
Joined: Sun Aug 28, 2011 4:19 pm
Contact:

Post by szymek66 » Mon Mar 04, 2013 9:51 pm

power79 wrote:Question:

Autoserver had problems setting startpos to player that had space in his name. Do I need to use "" signs for names that include space when setting startpos? Or could there be some other problem?
Yep, "" needed

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Mon Mar 04, 2013 10:01 pm

ok, thx. Still need some more testing with 3+ players but looking pretty good.

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Tue Mar 05, 2013 8:48 pm

Same racestats.log problem with >2 players confirmed again. Not at every stage but some of the time. Every startpos order combination has now been tested and also /startpos command.

So for now on I keep the server open for max 2 players until Ande fixes the bug. Makes me sad but I can't really do anything about it.

I keep suspecting that theres some logic behind how the game reports those StartPos orders but I just can't figure it out.

log.txt:

Code: Select all

Message: Start position for Lanz: 1
Message: Start position for Szymek66: 3
Message: Start position for power79: 2
racestats.log:

Code: Select all

Player
Name power79
Id 1885498360
Type Human
Car SL Mitsubishi Lancer
StartPos 3
Pos 2
TotalTime 181614
Laps 1
BestLap 1 181614
Lap 181614
End

Player
Name Szymek66
Id 1406040516
Type Human
Car SL Subaru Impreza
StartPos 1
Pos 3
TotalTime 200497
Laps 1
BestLap 1 200497
Lap 200497
End

Player
Name Lanz
Id 1706185660
Type Human
Car SL Mitsubishi Lancer
StartPos 2
Pos 1
TotalTime 175403
Laps 1
BestLap 1 175403
Lap 175403
End

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Wed Mar 06, 2013 5:24 pm

Have to do all by myself I guess. So this time I use my own log file to get the correct StartPos for players. Im sure its not perfect solution and it makes this whole system again more complicated but maybe it somehow works until we get TS2.1. Which is - Im sure of it - just around the corner, right Dede? :wink:

Also finally learned to give admin rights to myself so I don't have to wait disconnected players after race anymore. :D

User avatar
dede
Community User Level: 5
Community User Level: 5
Posts: 3314
Joined: Mon Apr 10, 2006 10:29 am
Contact:

Post by dede » Wed Mar 06, 2013 7:10 pm

power79 wrote:until we get TS2.1. Which is - Im sure of it - just around the corner, right Dede?
Ehrrrrrrrr! :D

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Wed Mar 13, 2013 4:48 pm

power79 wrote: All tracks are provided by Wokinger. You should download them if you don't have them already.

http://student.agh.edu.pl/~wokinger/rajdy/ - #1 Baja Poland + #1 Dakar (2012)

http://student.agh.edu.pl/~wokinger/sldakar2013/ #2 Dakar (2013)

http://student.agh.edu.pl/~wokinger/RMPTS/ RMPTS tracks
I post these links again, cause it seems people still try to download tracks from server which is really slow with these big files. I think Mini-Dakar is missing but everything else should be in these packs.

User avatar
szymek66
Community User Level: 2
Community User Level: 2
Posts: 195
Joined: Sun Aug 28, 2011 4:19 pm
Contact:

Post by szymek66 » Wed Mar 13, 2013 5:14 pm

power79 wrote:
power79 wrote: All tracks are provided by Wokinger. You should download them if you don't have them already.

http://student.agh.edu.pl/~wokinger/rajdy/ - #1 Baja Poland + #1 Dakar (2012)

http://student.agh.edu.pl/~wokinger/sldakar2013/ #2 Dakar (2013)

http://student.agh.edu.pl/~wokinger/RMPTS/ RMPTS tracks
I post these links again, cause it seems people still try to download tracks from server which is really slow with these big files. I think Mini-Dakar is missing but everything else should be in these packs.
MiniDakar is included in "SL_Rally_Tilles.rar" (you can download it from 3rd link)

power79
Community User Level: 3
Community User Level: 3
Posts: 465
Joined: Sun Dec 16, 2012 11:10 pm

Post by power79 » Tue Mar 26, 2013 10:19 pm

Szymek showing some serious rally skills!

Image

http://www.kolumbus.fi/arilai79/lolszy.tsr

User avatar
Lanz
Community User Level: 4
Community User Level: 4
Posts: 821
Joined: Sun Sep 27, 2009 12:27 pm

Post by Lanz » Tue Mar 26, 2013 10:48 pm

hehe! that was pretty awesome!

Post Reply