Trying to create autoserver for Rally
Moderator: Forum Moderators
Trying to create autoserver for Rally
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
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 5:26 pm, edited 10 times in total.
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.
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.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.
Re: Trying to create autoserver for Rally
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).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?
So:
/order [n] - ok
/startpos [nick] [pos] - wrong
Ad 4.
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.Tijny wrote:1) No, on Windows it's not possible to prevent this.
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.2) Try adding the /source command to the Cup (and CupEnd) macros.
Well this is good. I let the game set startpos. Is there explanation anywhere what the different start order settings are?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).
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.
You can just type the commands in your chat box and it will say:power79 wrote:Is there explanation anywhere what the different start order settings are?
/order 0 (random order)
/order 1 (best lap of last race)
/order 2 (cup order)
/order 3 (reverse cup order)
Oh, I never tested that. Can it be possible that Ande forgot about this type of tracks?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?
Re: Trying to create autoserver for Rally
Maybe I have a solution for this.. downloadpower79 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.
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
Re: Trying to create autoserver for Rally
P.S. Works well if you have just one sliders.exe running....dede wrote:Maybe I have a solution for this.. downloadpower79 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.
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
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 thatpower79 wrote:Thx dede, but it didn't change anything. Btw I am using 64-bit Windows 7.
Great tip. Didn't think a simple solution like that (Im not a professional programmerdede 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
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.Tijny wrote:2) Try adding the /source command to the Cup (and CupEnd) macros.
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.
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...
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...
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?
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?
Well, this forum already has many threads dealing with these things:Whiplash wrote:Maybe you could explain that here in details? It could be useful for many players.power79 wrote:I changed my NAT-settings. Maybe now works (Rally - Mini Dakar Testing)?
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.
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...
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...
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..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).
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>?
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...
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.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...
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?Wokinger wrote:StartPos aren't respected in racelog. I tested few orders and saw that some work wrong, but didn't write down which.
If you do not use that command, otherwise, everything is ok?
Just to understand what causes the bug..


