It is currently Mon Aug 21, 2017 10:33 am


Trying to create autoserver for Rally

Discussion related to Turbo Sliders and beta version feedback.

Moderator: Forum Moderators

  • Author
  • Message
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 441
  • Joined: Sun Dec 16, 2012 6:10 pm
  • Location: Finland

Trying to create autoserver for Rally

PostThu Feb 21, 2013 8:38 am

Goal: Players can race rally stages on autoserver(my computer). Simple database keeps records for players best time for individual stages(updated after every stage) and for whole race (saved after cup is finished)

I have worked this for few days and first version of the script is working quite well but few issues where I need help.

1. When script is running it takes focus from game. Which means everytime game throws me to desktop. Makes it really hard to do testing. Same happens whether I am running normal network game or autoserver(playing with same computer). Can this be prevented in any way? Script is .exe file but it doesn't open any windows/gui.

2. Script creates source files which includes output for stage results. I put /source command to macros.ini RaceEnd but it shows stats too early(race screen), maybe even before the script runs im not sure. How can I get it to show results at the right time?

3. I haven't worked with startpos yet. I was in impression that there is some bugs with that? How do I deal with them? With staggered starts its important to get correct startpos after stage (otherwise time is wrong).

4. How do I get information about players joining to server? I can get players from racestats.log after the race but I guess I need information also before it to set startpos etc. How about disconnected players?

I hope that I could finish with something that works even if not perfect. I have really enjoyed those rallies that Wokinger+szymek66 have organized.

Thank you.





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

F1SL Rally Mod
Last edited by power79 on Wed Feb 11, 2015 12:26 pm, edited 10 times in total.
Offline
User avatar

Tijny

Community User Level: 5

Community User Level: 5

  • Posts: 1471
  • Joined: Sat Nov 06, 2004 2:59 pm
  • Location: Netherlands

PostThu Feb 21, 2013 10:37 am

1) No, on Windows it's not possible to prevent this.

2) Try adding the /source command to the Cup (and CupEnd) macros.

3) Not sure what you mean, but I don't think this is possible. With n players on the server, only the first n start positions will be used regardless of whatever data was given to the /startpos command.

4) The only way I know of is to parse the game's main log file. Which is really far from ideal, unfortunately. I've struggled with this before, and my conclusion was that there is no foolproof way to get all online players at the time a race starts.
Offline
User avatar

Whiplash

Community User Level: 5

Community User Level: 5

  • Posts: 2252
  • Joined: Sun Apr 19, 2009 11:57 am
  • Location: Bosnia

PostThu Feb 21, 2013 11:33 am

Tijny wrote:1) No, on Windows it's not possible to prevent this.

2) Try adding the /source command to the Cup (and CupEnd) macros.

3) Not sure what you mean, but I don't think this is possible. With n players on the server, only the first n start positions will be used regardless of whatever data was given to the /startpos command.

4) The only way I know of is to parse the game's main log file. Which is really far from ideal, unfortunately. I've struggled with this before, and my conclusion was that there is no foolproof way to get all online players at the time a race starts.

Maybe you should mention all these problems in the new version (v2.1) topic so that Ande could be informed about them easily. Maybe he 'll be able to fix them.
Offline
User avatar

Wokinger

Community User Level: 3

Community User Level: 3

  • Posts: 309
  • Joined: Sat Aug 15, 2009 12:00 pm
  • Location: Chrzanów (Poland)

Re: Trying to create autoserver for Rally

PostThu Feb 21, 2013 12:29 pm

power79 wrote:3. I haven't worked with startpos yet. I was in impression that there is some bugs with that? How do I deal with them? With staggered starts its important to get correct startpos after stage (otherwise time is wrong).

4. How do I get information about players joining to server? I can get players from racestats.log after the race but I guess I need information also before it to set startpos etc. How about disconnected players?


Actually for autoserver is not a problem as soon as u don't set starting position by startpos command. RaceStats remembers stating positions, which game set (not sure if every type of order works ok).

So:
/order [n] - ok
/startpos [nick] [pos] - wrong

Ad 4.
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 441
  • Joined: Sun Dec 16, 2012 6:10 pm
  • Location: Finland

PostThu Feb 21, 2013 1:13 pm

Tijny wrote:1) No, on Windows it's not possible to prevent this.

This is really annoying. Specially first time when script runs its very difficult to get back to the game(Mouse starts to "jump"). And alt+tab doesn't seem to work well with this game.

2) Try adding the /source command to the Cup (and CupEnd) macros.

No good either. Have to work something out. I hope Dede will tell how its done with F1 Practice server. Thats pretty much how I would like it to be.

Wokinger wrote:Actually for autoserver is not a problem as soon as u don't set starting position by startpos command. RaceStats remembers stating positions, which game set (not sure if every type of order works ok).

Well this is good. I let the game set startpos. Is there explanation anywhere what the different start order settings are?

Now I would need to test with more drivers but can't make AI lines (first lap not recorded). Is there anyway to create AI line for rally tracks?

And Woki, if I get this thing to work well enough and make server public, do I have permission to use your tracks/cars (mini dakar)? I don't have skills to make tracks myself.

Thanks.
Offline
User avatar

Whiplash

Community User Level: 5

Community User Level: 5

  • Posts: 2252
  • Joined: Sun Apr 19, 2009 11:57 am
  • Location: Bosnia

PostThu Feb 21, 2013 1:33 pm

power79 wrote:Is there explanation anywhere what the different start order settings are?

You can just type the commands in your chat box and it will say:
/order 0 (random order)
/order 1 (best lap of last race)
/order 2 (cup order)
/order 3 (reverse cup order)

power79 wrote:Now I would need to test with more drivers but can't make AI lines (first lap not recorded). Is there anyway to create AI line for rally tracks?

Oh, I never tested that. Can it be possible that Ande forgot about this type of tracks? :)
Offline
User avatar

dede

Community User Level: 5

Community User Level: 5

  • Posts: 3314
  • Joined: Mon Apr 10, 2006 5:29 am
  • Location: Milan (Italy)

Re: Trying to create autoserver for Rally

PostThu Feb 21, 2013 1:48 pm

power79 wrote:1. When script is running it takes focus from game. Which means everytime game throws me to desktop. Makes it really hard to do testing. Same happens whether I am running normal network game or autoserver(playing with same computer). Can this be prevented in any way? Script is .exe file but it doesn't open any windows/gui.

Maybe I have a solution for this.. download

Put the exe in your TS folder. I've been using it in my custom.bat script:
Code: Select all
C:/wamp/php/php.exe serverscript.php
ActivateProcess sliders.exe
Offline
User avatar

dede

Community User Level: 5

Community User Level: 5

  • Posts: 3314
  • Joined: Mon Apr 10, 2006 5:29 am
  • Location: Milan (Italy)

Re: Trying to create autoserver for Rally

PostThu Feb 21, 2013 1:49 pm

dede wrote:
power79 wrote:1. When script is running it takes focus from game. Which means everytime game throws me to desktop. Makes it really hard to do testing. Same happens whether I am running normal network game or autoserver(playing with same computer). Can this be prevented in any way? Script is .exe file but it doesn't open any windows/gui.

Maybe I have a solution for this.. download

Put the exe in your TS folder. I've been using it in my custom.bat script:
Code: Select all
C:/wamp/php/php.exe serverscript.php
ActivateProcess sliders.exe


P.S. Works well if you have just one sliders.exe running....
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 441
  • Joined: Sun Dec 16, 2012 6:10 pm
  • Location: Finland

PostThu Feb 21, 2013 3:13 pm

Thx dede, but it didn't change anything. Btw I am using 64-bit Windows 7.
Offline
User avatar

dede

Community User Level: 5

Community User Level: 5

  • Posts: 3314
  • Joined: Mon Apr 10, 2006 5:29 am
  • Location: Milan (Italy)

PostThu Feb 21, 2013 3:33 pm

power79 wrote:Thx dede, but it didn't change anything. Btw I am using 64-bit Windows 7.

I don't have machines to test it. Basically all you need to do is to activate process sliders.exe in some way after executing your script. Not easy, but if you are a programmer you can think about something for that :P
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 441
  • Joined: Sun Dec 16, 2012 6:10 pm
  • Location: Finland

PostFri Feb 22, 2013 1:52 am

dede wrote:I don't have machines to test it. Basically all you need to do is to activate process sliders.exe in some way after executing your script. Not easy, but if you are a programmer you can think about something for that :P

Great tip. Didn't think a simple solution like that (Im not a professional programmer :lol:). I got it to work inside the script so its great. With normal network its perfect. With autoserver it does jump to desktop for a second but thats really nothing.

Tijny wrote:2) Try adding the /source command to the Cup (and CupEnd) macros.

This actually did work in the end, so thx. I only have to think a nice way to prevent printing old results before first race.

At the moment there doesn't seem to be any big issues, so I actually might get this thing to work! If someone has tips or suggestions for the server - let me know.
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 441
  • Joined: Sun Dec 16, 2012 6:10 pm
  • Location: Finland

PostFri Feb 22, 2013 8:24 am

Ok. First version is running now. I did unblock slider.exe from my firewall but not sure if people can join. At least it shows at master server.

If you are able to join please test and report about bugs. There must be many so be patient.

If you are not able to connect to server then I obviously need some help with that...
Offline
User avatar

szymek66

Community User Level: 2

Community User Level: 2

  • Posts: 195
  • Joined: Sun Aug 28, 2011 11:19 am
  • Location: Biala Podlaska, Poland

PostFri Feb 22, 2013 9:24 am

Can't join (server behind firewall or proxy)
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 441
  • Joined: Sun Dec 16, 2012 6:10 pm
  • Location: Finland

PostFri Feb 22, 2013 9:46 am

Ok. I took it down. Have to figure out why connection doesn't work...
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 441
  • Joined: Sun Dec 16, 2012 6:10 pm
  • Location: Finland

PostFri Feb 22, 2013 10:47 am

I changed my NAT-settings. Maybe now works (Rally - Mini Dakar Testing)?
Offline
User avatar

szymek66

Community User Level: 2

Community User Level: 2

  • Posts: 195
  • Joined: Sun Aug 28, 2011 11:19 am
  • Location: Biala Podlaska, Poland

PostFri Feb 22, 2013 10:52 am

Yep, server works now :)
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 441
  • Joined: Sun Dec 16, 2012 6:10 pm
  • Location: Finland

PostFri Feb 22, 2013 11:14 am

One thing that troubles me is raceidle time. I guess it measures how much time one lap can take before race ends. So with rally tracks it should be quite big number specially if there are lot of players (10 sec starting intervals).

But if its too big and there are like 2 drivers and one doesn't finish the rally, other player have to wait long time before race ends?

So what would be good raceidle setting?
Offline
User avatar

Wokinger

Community User Level: 3

Community User Level: 3

  • Posts: 309
  • Joined: Sat Aug 15, 2009 12:00 pm
  • Location: Chrzanów (Poland)

PostFri Feb 22, 2013 11:18 am

Great job!
Offline
User avatar

Whiplash

Community User Level: 5

Community User Level: 5

  • Posts: 2252
  • Joined: Sun Apr 19, 2009 11:57 am
  • Location: Bosnia

PostFri Feb 22, 2013 12:00 pm

power79 wrote:I changed my NAT-settings. Maybe now works (Rally - Mini Dakar Testing)?

Maybe you could explain that here in details? It could be useful for many players.
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 441
  • Joined: Sun Dec 16, 2012 6:10 pm
  • Location: Finland

PostFri Feb 22, 2013 12:16 pm

Whiplash wrote:
power79 wrote:I changed my NAT-settings. Maybe now works (Rally - Mini Dakar Testing)?

Maybe you could explain that here in details? It could be useful for many players.

Well, this forum already has many threads dealing with these things:
http://www.turbosliders.com/forum/viewtopic.php?t=383

Francesco has nice post about halfway down.

And I hope that those who test my server report here how it works. Is there lag? Bugs? Feature requests?

Btw command prompt window flashes every time when script starts even if Im not playing myself, so maybe I don't keep that server up all day long. :lol: But i wish it has some success among players. Rallying is really fun mode in this game.
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 441
  • Joined: Sun Dec 16, 2012 6:10 pm
  • Location: Finland

PostSat Feb 23, 2013 11:28 am

Anyone have idea why racestats.log logged wrong StartPos when Wokinger joined the race? It was wrong the whole time he raced (3 stages).

RaceStats
Date 2013 2 23
Time 17 40 21
Track Mini_Dakar_01
TrackMaker Wokinger (F1 SPEED LEAGUE - www.f1sl.thegoo.us)
RaceNo 1
RaceNumber 8
LapNumber 1
CarMode 0
StartOrder 4
Ghost 0
Pro 0
StartMode 0
Car SL Mitsubishi Lancer
Car SL Citroen DS3
Car SL Ford Fiesta
Car SL Mini Cooper
Car SL Peugeot 207
Car SL Skoda Fabia
Car SL Subaru Impreza
Car SL VW Polo
Points 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
GivePointsForAborted 0

Aborted 0

Player
Name Wokinger
Id 373313031
Type Human
Car SL Peugeot 207
StartPos 2
Pos 3
TotalTime 66973
Laps 1
BestLap 1 66973
Lap 66973
End

Player
Name Fama
Id 1545475178
Type Human
Car SL VW Polo
StartPos 3
Pos 1
TotalTime 47916
Laps 1
BestLap 1 47916
Lap 47916
End

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

BestLapPlayer 2

Correct startorder was Fama-Lanz-Woki

This server is quite useless if there is no way to get this work right...
Offline
User avatar

dede

Community User Level: 5

Community User Level: 5

  • Posts: 3314
  • Joined: Mon Apr 10, 2006 5:29 am
  • Location: Milan (Italy)

PostSat Feb 23, 2013 11:44 am

power79 wrote:Anyone have idea why racestats.log logged wrong StartPos when Wokinger joined the race? It was wrong the whole time he raced (3 stages).

Thanks for your report. I've already included this bug in next version thread, but these details will be helpful. Few questions as I didn't join the server yet..

1) what's the /order setting used in the server? Just write /order and tell me what's the output
2) how do you set positions? /startpos <nick> <pos>?
Offline

power79

Community User Level: 3

Community User Level: 3

  • Posts: 441
  • Joined: Sun Dec 16, 2012 6:10 pm
  • Location: Finland

PostSat Feb 23, 2013 11:56 am

1)As you can see from listing, StartOrder was 4. Which is "Best Lap" I changed it now to 1 "Cup Pos", but idk if that helps anything. It really doesn't matter that much as long as it would just get logged correctly.

2)I don't set start positions because Woki told that it leads to these errors. It was supposed to work if I just let server decide the order. Maybe Order 4 was buggy one and 1 will work...
Offline
User avatar

Wokinger

Community User Level: 3

Community User Level: 3

  • Posts: 309
  • Joined: Sat Aug 15, 2009 12:00 pm
  • Location: Chrzanów (Poland)

PostSat Feb 23, 2013 12:17 pm

power79 wrote:2)I don't set start positions because Woki told that it leads to these errors. It was supposed to work if I just let server decide the order. Maybe Order 4 was buggy one and 1 will work...


StartPos aren't respected in racelog. I tested few orders and saw that some work wrong, but didn't write down which.
Offline
User avatar

dede

Community User Level: 5

Community User Level: 5

  • Posts: 3314
  • Joined: Mon Apr 10, 2006 5:29 am
  • Location: Milan (Italy)

PostSat Feb 23, 2013 2:00 pm

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?

Just to understand what causes the bug..
Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron