MX Bikes Official Forum

General Category => Documentation => Topic started by: PiBoSo on October 04, 2014, 10:46:03 AM

Title: Live Timing
Post by: PiBoSo on October 04, 2014, 10:46:03 AM
It is possible to connect to a dedicated server to receive live race data.
The feature is off by default and must be enabled:
http://forum.mx-bikes.com/index.php?topic=197.0
Only 1 client can connect to the server.

Communication is made with UDP sockets and strings terminated with "\n".

Send "CONNECT" followed by the connection password ( empty string if no password ).
Reply:
OK -> connected
FULL -> another client is already connected
WRONGPASSWORD -> wrong password

Send "START", followed by two parameter strings to start receiving data.
First parameter: "0" or "1". If set to "1", the track centerline and the track position of the bikes are sent, too.
Second Parameter: "0", "1" or "2". If set to "1", contacts between bikes are sent. If set to "2", then contacts with walls are sent, too.

Data format is "MSG" followed by the message ID and then a stream of strings.
Send "ACK" followed by the message ID after each MSG.

Send "KEEPALIVE" every 15 seconds to keep the connection active.
The server sends "ALIVE" to report that the connection is active.

Send "DISCONNECT" to correctly close the connection.

Example source code can be downloaded at this link: http://www.kartracing-pro.com/downloads/livetiming.c


Messages data format

EVENT
Type
- OPENPRACTICE
- RACE
- STRAIGHTRHYTHM
Name
Track
Track Length ( meters )
Allowed Categories and Bikes
Empty string

ENTRY
Race Number
Name
Bike Name
Bike Short Name
Categories
GUID
Extra Data
Empty string

ENTRYREMOVE
Race Number
Empty string

Open Practice:
SESSION
Session
- WAITING
- OPENPRACTICE
State
Length
Empty string

Race:
SESSION
Session
- WAITING
- PRACTICE
- PRE-QUALIFY
- QUALIFYPRACTICE
- QUALIFY
- WARMUP
- RACE1
- RACE2
State
if session = practice ( PRACTICE, PRE-QUALIFY, QUALIFYPRACTICE, WARMUP )
- INPROGRESS
- COMPLETE
else if session = race ( QUALIFY, RACE1, RACE2 )
- SIGHTINGLAP
- PRESTART
- STARTSEQUENCE
- INPROGRESS
- RACEOVER
- COMPLETE
endif
Length ( minutes if practice, minutes + laps or L laps if race )
Empty string

WEATHER
Conditions
- CLEAR
- CLOUDY
- RAINY
Air Temperature
Empty string

DRIVERSTATUS
Race Number
State
- DNS
- RET
- DSQ
Reason ( empty if state is not DSQ )
- JUMPSTART
- TOOMANYOFFENCES
- DIRECTOR
Empty string

BESTLAP
Race Number
Session Time ( milliseconds )
Lap Time ( milliseconds )
Lap Number
Split 1 ( milliseconds )
Split 2 ( milliseconds )
Average Speed ( meters/s )
Empty string

LASTLAP
Race Number
Session Time ( milliseconds )
Lap Time ( milliseconds )
Lap Number
Split 1 ( milliseconds )
Split 2 ( milliseconds )
Average Speed ( meters/s )
Empty string

PENALTY
Race Number
Penalty Number
Type
- TIME
Penalty Time ( seconds )
Offence
- JUMPSTART
- CUTTING
Empty string

LAP
Race Number
Lap Invalid
Session Time ( milliseconds )
Lap Time ( milliseconds )
Split 1 ( milliseconds )
Split 2 ( milliseconds )
Average Speed ( meters/s )
Empty string

SPLIT
Race Number
Split Number
Split Time ( milliseconds )
Empty string

HOLESHOT
Race Number
Holeshot Time ( milliseconds )
Empty string

CLASSIFICATION
Session
Status
Session Timer ( milliseconds )
Session Length ( minutes )
Session Lap
Number of Laps
Classification Type ( 0 -> none; 1 -> practice; 2 -> race )
if "Classification Type" is 1 or 2
Start Entry
Number of Entries
for each entry:
Race Number
if "Classification Type" is 1
Best Lap ( milliseconds )
Lap Number
Total Laps
Gap ( milliseconds, -- if zero )
Average Speed ( meters/s )
else
Race Time ( milliseconds ) or Status
- DNS
- DSQ
Lap Number
Gap ( milliseconds or L if lapped )
endelse
Bike Status
- TRK: on track
- PIT: in the pits
endfor
endif
Empty string after the last entry

TRACKDATA
Start / Finish Longitudinal Position
Split 1 Longitudinal Position
Split 2 Longitudinal Position
Holeshot Longitudinal Position ( -1 if missing )
Number of Segments
Empty string

Always sent after TRACKDATA:
TRACKSEGMENT
Segment Number
Type ( 0 = straight, 1 = curve )
Length ( meters )
Radius ( meters )
Angle ( degrees )
Start Position X ( meters )
Start Position z ( meters )
Height ( meters )
Empty string

TRACKPOSITION
for each entry on track:
Race Number
Position X ( meters )
Position Y ( meters )
Position Z ( meters )
endfor
Empty string after the last entry

CONTACT
Time ( milliseconds )
Race Number 1 ( -1 for a wall )
Race Number 2 ( -1 for a wall )
Relative Impact Velocity ( meters/s )
Empty string

END
Empty string
Title: Re: Live Timing
Post by: Niko Mouk on March 16, 2016, 01:57:16 PM
This is a bit blur,
Do you have an exemple somewhere to allow me doing something like I did here : MXS LiveTiming (http://msx-concept.com/livetiming/)
Title: Re: Live Timing
Post by: PizzaChet on March 16, 2016, 05:49:41 PM
Speaking of timing, I ran a bunch of laps online on Holjes on the SM bike and I don't see my time up there. I've done several sessions, some alone. I do see my times for Forest and Practice Track Short however.
Title: Re: Live Timing
Post by: Steven on March 17, 2016, 10:48:05 AM
Quote from: Niko Mouk on March 16, 2016, 01:57:16 PM
This is a bit blur,
Do you have an exemple somewhere to allow me doing something like I did here : MXS LiveTiming (http://msx-concept.com/livetiming/)

Could you be a bit more specific? I just started trying around with this, maybe I can help.
What have you tried so far? And what did you have to do to get your site to work with MXS? (By the way your link doesn't work as it is.)
Title: Re: Live Timing
Post by: Niko Mouk on March 17, 2016, 11:34:10 AM
Yep I inverted 2 letters, it's http://mxs-concept.com/livetiming/ (http://mxs-concept.com/livetiming/)

I don't understand the way you can receive, for my livetiming on mxsimulator I think the strategy is totally different, the game server is writting a text file with all info as they come (rider 2 pass the second checkpoint for exemple) and I'm reading into that file.
Next at the end of the race a command send this file where I want to decode it and display championship results ie.
Title: Re: Live Timing
Post by: Steven on March 18, 2016, 01:23:20 PM
Ah ok, here you have to connect to the server that sends the information (track, players, split times and so on) to you. UDP is used for that.
I don't know about your "qualifications". Are you just looking for some example code or how to do it at all?
Title: Re: Live Timing
Post by: Niko Mouk on March 18, 2016, 03:23:15 PM
Maybe I have to understand if it will needed or not for the races and championships we will do. At the moment I think I'll focus myself on track making as the game is a bit poor at this level.  ;)
Title: Re: Live Timing
Post by: Umpossible on June 25, 2018, 12:26:14 PM
Can anybody help me with this? I'm looking to get live timing off of the Weekend Warriors FLCS2 server. Preferably, if it's possible I would love to be able to connect and download all the information from the server over the past week that it's been running but I doubt that's possible, or i could say that it's probably umpossible haha. 
Title: Re: Live Timing
Post by: iNsane on June 25, 2018, 01:26:42 PM
Quote from: Umpossible on June 25, 2018, 12:26:14 PM
Can anybody help me with this? I'm looking to get live timing off of the Weekend Warriors FLCS2 server. Preferably, if it's possible I would love to be able to connect and download all the information from the server over the past week that it's been running but I doubt that's possible, or i could say that it's probably umpossible haha.

well I didn't even enabled live in my server config file tbh., never saw a reasonable point behind that

Edit // enabled it now but I can't even connect to the port i defined there, dunno
Title: Re: Live Timing
Post by: PiBoSo on December 03, 2019, 02:27:20 PM
First post updated to add a parameter to the "START" command, that allows to receive the track centerline and bikes' track position, too.
Title: Re: Live Timing
Post by: PiBoSo on September 09, 2020, 11:36:25 PM
First post updated to add the messages data format.
Title: Re: Live Timing
Post by: MxWayGamer on September 14, 2020, 10:17:56 AM
Thanks for the new informations about blocs.
Could you add Empty string after every blocs ? It will be easier to process them.
Title: Re: Live Timing
Post by: PiBoSo on September 14, 2020, 10:57:53 AM
Quote from: MxWayGamer on September 14, 2020, 10:17:56 AMThanks for the new informations about blocs.
Could you add Empty string after every blocs ? It will be easier to process them.

Thank you for the suggestion.
Empty strings will be added in the next MX Bikes update.
Title: Re: Live Timing
Post by: MxWayGamer on September 14, 2020, 12:11:57 PM
Quote from: PiBoSo on September 14, 2020, 10:57:53 AMThank you for the suggestion.
Empty strings will be added in the next MX Bikes update.

Thanks ! It will be clearer than testing every line if it's bloc names to know if it's new bloc or not.
Title: Re: Live Timing
Post by: MxWayGamer on September 15, 2020, 10:19:00 AM
Is it possible to add session informations (Number of lap and Duration) in the live timing bloc ?

Example :
SESSIONSETUP
Number of lap
Duration
Title: Re: Live Timing
Post by: Ruubs on September 15, 2020, 07:00:45 PM
Quote from: MxWayGamer on September 15, 2020, 10:19:00 AMIs it possible to add session informations (Number of lap and Duration) in the live timing bloc ?

Example :
SESSIONSETUP
Number of lap
Duration

If what you're saying is a suggestion for B15, don't mind me.
If it is not a suggestion for B15; MXB currently doesn't support races based on minutes and laps (however I do believe that's been implemented for B15 already). You can get the session time though. For races, it'll display the minutes left, and for practice it'll show the total time that has passed since the start of te session.

You can get this information from the classification section, then look for session timer.
Title: Re: Live Timing
Post by: MxWayGamer on September 15, 2020, 07:55:28 PM
Quote from: Ruubs on September 15, 2020, 07:00:45 PMIf what you're saying is a suggestion for B15, don't mind me.
If it is not a suggestion for B15; MXB currently doesn't support races based on minutes and laps (however I do believe that's been implemented for B15 already). You can get the session time though. For races, it'll display the minutes left, and for practice it'll show the total time that has passed since the start of te session.

You can get this information from the classification section, then look for session timer.

The problem with the session timer in classification, it gives the time since the begining of the session, for race too. So it's hard to create countdown on live timing dashboard because it's not possible to get the configuration of the session.

For the race, it's the same. It's possible to get the current lap of the first player, but not the number of lap for the full race. So, it's not possible to display : "Lap 5/15" now.

In my example, I have add two lines 'Number of lap' and 'Duration' but as you said, it's not possible to create session defined by this two parameters in the same time, so the bloc could be more than :

SESSIONSETUP
TYPE
- Duration
- Lap
Number of lap OR Duration

Concrete example :
SESSIONSETUP
LAP
15

Title: Re: Live Timing
Post by: iNsane on September 15, 2020, 08:03:46 PM
You could get the max laps per server from my or the official server page

Simple XML or JSON parse should do the trick
Title: Re: Live Timing
Post by: MxWayGamer on September 15, 2020, 09:11:12 PM
Quote from: iNsane | WW on September 15, 2020, 08:03:46 PMYou could get the max laps per server from my or the official server page

Simple XML or JSON parse should do the trick

It's very ugly to use other website to get information when you directly can exchange informations with the server. For example : If official server page is down, my live timing will be down ...
Title: Re: Live Timing
Post by: PiBoSo on November 02, 2020, 12:19:31 AM
First post updated with the latest messages data format:
- added an empty string at the end of each message
- added "type" to EVENT
- added "Extra Data" to ENTRY
- added "Average Speed" to LAP
- added the session length and laps to CLASSIFICATION
- PREQUALIFY has been changed to PRE-QUALIFY

A link to example source code has been added, too.
Title: Re: Live Timing
Post by: Resolute Kraken on February 17, 2021, 06:14:03 AM
Can the HOLESHOT be added as a new MSG?

Would also help if the ENTRY record contained a status if the player was disconnected.  For example, if you connect to live timing during a practice session, and a player had already disconnected, you will never receive the ENTRYREMOVE MSG, but they are sent in the ENTRY MSG until the session changes.
Title: Re: Live Timing
Post by: PiBoSo on February 17, 2021, 03:54:40 PM
Quote from: Resolute Kraken on February 17, 2021, 06:14:03 AMCan the HOLESHOT be added as a new MSG?

Would also help if the ENTRY record contained a status if the player was disconnected.  For example, if you connect to live timing during a practice session, and a player had already disconnected, you will never receive the ENTRYREMOVE MSG, but they are sent in the ENTRY MSG until the session changes.

The HOLESHOT message will be added to the next MX Bikes update.

Please note that entries and clients are not the same.
The ENTRYREMOVE message is only sent when the client that disconnects has not recorded any lap.
Title: Re: Live Timing
Post by: Resolute Kraken on February 17, 2021, 06:12:27 PM
Quote from: PiBoSo on February 17, 2021, 03:54:40 PMPlease note that entries and clients are not the same.
The ENTRYREMOVE message is only sent when the client that disconnects has not recorded any lap.

Thanks, but the connected clients are not sent in any of the messages.  So, we can't tell who is connected or not if they did record a lap.  This would be helpful to know so we can tell which clients are connected and valid to send remote admin commands to.
Title: Re: Live Timing
Post by: Resolute Kraken on February 17, 2021, 06:22:57 PM
Would you be able to update the CLASSIFICATION when a split is crossed by a player instead of only at the start/finish? 

Currently, you do not have accurate results in live timing and in the game (replay screen or MaxHud plugin) until the player has crossed the start/finish for the second time.  This is especially bad on tracks such as Mantua or Washington where the start/finish is far away from the start gate.  So, you end up not getting updated classifications until almost the end of the 2nd lap because they have only crossed the start/finish 2 times. 

If you included the split times in the timing and update of the classifications, the live timing would be much more useful to streamers and players as the results would update 3 times per lap - at each split and the start/finish.

Also, splits are not posted until the rider starts the first "official" lap as well.  Again, for a track like Manuta, the start gate is right after the start/finish.  It would be nice to know who is in the lead on the first lap from the start gate to start/finish.  If you report the splits, even though this isn't an officially recorded lap, then we could at least get the current results on that first lap.
Title: Re: Live Timing
Post by: Niko Mouk on March 30, 2021, 02:30:57 PM
Quote from: Resolute Kraken on February 17, 2021, 06:22:57 PMWould you be able to update the CLASSIFICATION when a split is crossed by a player instead of only at the start/finish?

+1

Depending on how large the data is, it could be updated after each checkpoint too. Just like in MX Sim. It is not normal you have to wait 2 laps to know your position, even if I can understand the simulation side where IRL you can see the pitboard in one and only location. But for the live spectating  it's needed.
Title: Re: Live Timing
Post by: Resolute Kraken on May 11, 2021, 02:11:40 AM
Were any new features added to live timing or remote admin for B16?  I saw that it now reports the MSG for HOLESHOT.  Is there anything else?
Title: Re: Live Timing
Post by: PiBoSo on May 26, 2021, 12:14:02 AM
First post updated:
- added info on how to receive the contact messages
- added the HOLESHOT and CONTACT messages data format
Title: Re: Live Timing
Post by: PiBoSo on February 03, 2022, 12:55:12 AM
First post updated:
- changed the START command parameters
- added "Length" to SESSION
- added "Holeshot" to TRACKDATA
Title: Re: Live Timing
Post by: PiBoSo on August 23, 2023, 11:53:56 AM
First post updated:
- changed the DRIVERSTATUS and CLASSIFICATION messages data format
Title: sample essay toefl exam
Post by: Ronaldthex on March 16, 2024, 01:36:50 AM
Colten Curtis from Lawton was looking for sample essay toefl exam
 
Codey Smith found the answer to a search query sample essay toefl exam
 
 
ESSAYERUDITE.COM
 
 
(https://essayerudite.com)
 
 
sample essay toefl exam (https://essayerudite.com)
 
 
 
 
 
 
 
 
 
 
kids in print essay contest
custom home work editor website
social psychological theories of aggression essay
free real estate sales business plan
scholarship essay on biology
custom creative essay writer website uk
thesis on communication barriers
how to write a well essay
bishop bell vle homework tech
willy wonka and the chocolate factory book reports
homework solid state physics blackmore
resume computer based training
help write a poem for kids
custom custom essay writer for hire ca
esl research proposal editor sites for college
how to write an eight line poem
obesity example essay
sample written dissertation
esl persuasive essay ghostwriting websites for masters
free essays blood diamonds
an observation essay on a classroom
cheap persuasive essay ghostwriting website for masters
parole resume
best thesis proposal writers website for mba
a beka book report books
cloning information for research papers
uses and misuses of cell phones essay
dissertation ideas in psychology
99 thesis of martin luther
intermediate hindi model paper
online service provider business plan
write me best school essay on usa
censorship on books essay
chinese immigration research paper
professional persuasive essay editor websites for college
best movie review writing sites for school
write my name on picture
english essays on memories
write a crawler in java
thesis of tuberculosis
homework trial by jury
thesis on restaurant interiors
action essay louder speak than words
resume a tale of desire intrigue and formatting
evelyn glennie hearing essay
cheap dissertation chapter editing websites online
popular creative essay proofreading service us
professional school assignment sample
resume builder keywords
best custom essay writing sites uk
sample wording for resume skills
write a parody online
volunteer at church on resume
homelessness essays introduction
 
essays on illegal immigration (http://www.aeromodelling.lt/forum/viewtopic.php?f=23&t=9265)
two phases of the researchessay writing process are (https://forum.baginya.org/index.php?threads/%D0%A1%D0%B1%D0%BE%D1%80%D0%BD%D0%B8%D0%BA-%D1%81%D0%BC%D0%B0%D0%B9%D0%BB%D0%BE%D0%B2-%D0%9F%D0%BE%D1%82%D0%BD%D0%BE%D0%B3%D0%BE-%D0%AD%D0%BB%D1%8C%D1%84%D0%B0.6421/#post-18749918)
ap government essays college board (http://vanausa.org/forum/memberlist.php?mode=viewprofile&u=80005)
best literature review writer for hire ca (https://www.shishuotang.com/forum.php?mod=viewthread&tid=11159&extra=)
connecticut court day essay in modern other science yankee (http://sailing-bluewater.com/forum/index.php?topic=187334.new#new)
en essayant continuellement on finit par (http://demo.qkseo.in/viewtopic.php?pid=718949#p718949)
dissertation editing sites uk (http://j-john.de/forum/memberlist.php?mode=viewprofile&u=656198)
wait staff resume description (http://www.vagclub.com/forum/showthread.php?48647-Tr%E1fico-actualiza-la-estad%EDstica-con-mil-muertos-%ABolvidados%BB-en-2007&p=977464&posted=1#post977464)