MLFeed: Race Data

A plugin by XertroV(Trusted developer)

All versions

0.6.2

1 month ago

Download 0.6.2

Requires at least Openplanet 1.26.0

  • Fix const on PlayersLeftThisBatch and friends
  • Fix edge case sorting unspawned players with race ranking
  • Fix spawn counter and spawn index so spawn indexes are the same for players spawning on the same frame

0.6.1

2 months ago

Download 0.6.1

Requires at least Openplanet 1.26.0

  • Fix ML exception in ShouldUpdatePlayers

0.6.0

2 months ago

Download 0.6.0

Requires at least Openplanet 1.26.0

A game restart may be required after updating

  • optimized RaceStatsFeed: 40% reduction in frame time (approx 0.5ms reduction in full COTD server)
  • Added List Server Map UIDs. Access it via MapListUids_Receiver@ MLFeed::Get_MapListUids_Receiver()
    • Methods/Properties
    • bool MapList_Request() - initiate a request, does nothing & returns false if a request is already in progress. Max 25* UIDs are returned.
    • bool MapList_Request_Larger(int nbMaxUids) - as above but increases the number of UIDs returned for the next request only.
    • bool MapList_IsInProgress - is a request in progress
    • const array<string>@ MapList_Names - names of maps returned from the MapList request. Limited to 25* for performance reasons.
    • const array<string>@ MapList_MapUids - map UIDs returned from the MapList request. Limited to 25* for performance reasons, but it's the slice starting immediately after the current map.
    • uint UpdateCount - incremented whenever data is received from the Maniascript component
    • uint64 LastRequestStart - Time::Now when the last request started
    • uint64 LastRequestEnd - Time::Now when the last request finished
    • uint64 MsSinceLastReqStart - millis since LastRequestStart
    • uint64 MsSinceLastReqEnd - millis since LastRequestEnd
    • int Slice_StartIx - Start index of the slice of map uids shown.
    • int Slice_EndIx - End index of the slice of map uids shown; can be greater than Slice_NbMaps.
    • int Slice_NbMaps - The complete number of maps in the MapList response.
    • int MapOrigIxInList - The original index of the map in the UID list when the map loaded. (If you update the current map in the map list later, this is important information to know.)
    • string MapOrigIxInListUid - The UID of the map for which MapOrigIxInList applies.
    • string[]@ GetUidSlice_Async(int startIx, int endIx) - Read a slice from MapList_MapUids. Will yield for 1-3 frames in total.
  • Added PlayerCpInfo_V4@ HookRaceStatsEventsBase_V2::GetPlayer_V4_ByLogin(const string &in login)
  • Added int HookRaceStatsEventsBase::get_Rules_MillisSinceStart()
    • Mostly returns: GameTime - StartTime; the time (in ms) since the game mode started, or -1 if the game mode hasn't started yet or is an invalid (map loading?) state.
  • Added int HookRaceStatsEventsBase::get_Rules_TimeElapsed()
    • Milliseconds since the game mode started, or -1 if the game mode hasn't started yet or is an invalid (map loading?) state.
  • Added int HookRaceStatsEventsBase::get_Rules_TimeRemaining()
    • Milliseconds left in the game mode, or -1 if the game mode hasn't started yet or is infinite (or maybe if we're in an invalid state).
  • Added bool HookRaceStatsEventsBase::IsRemainingRulesTimeLessThan(int durationMs)
    • Convenience function to check there is a valid time remaining and that it is less than the given duration.
  • Added uint HookRaceStatsEventsBase::PlayersLeft_BatchNumber
  • Added string[]@ HookRaceStatsEventsBase::PlayersLeftThisBatch
  • Added uint[]@ HookRaceStatsEventsBase::PlayersLeftThisBatch_LoginIdValues
  • Added int PlayerCpInfo_V2::get_FinishTime()
    • Player's current Finish time as on their chronometer (2^31 - 1 if not finished)
  • Added MwId PlayerCpInfo_V4::LoginMwId
  • Added MwId PlayerCpInfo_V4::NameMwId
  • Add const PlayerCpInfo_V4@ HookRaceStatsEventsBase_V4::get_LocalPlayer()
    • It will always be the local player and is essentially free to get.
  • Add MLFeed::LocalPlayersLoginIdValue
    • Returns the MwId::Value for the local player's login.
  • Add local player to race data demo UI.
  • Fix PlayerCpInfo_V4::FindCSmPlayer() not being const
  • There might be a bug with KoStats::roundNb and friend not resetting. If such a bug exists, it might have been fixed.

*: there's an off by 1 error with the number of uids returned, so the max is 1 more than specified.

0.5.17

3 months ago

Download 0.5.17

Requires at least Openplanet 1.26.0

A game restart may be required after updating.

Add to PlayerCpInfo:

  • int2 RaceProgression: used as <Points, Time> for Royal Time Attack
  • int[] RaceProgressionHistory: tracks RaceProgression values where Points is the index into this array (max 20 records)
  • bool get_RoyalTA_HasFinished() const: returns true if RaceProgression.x >= 5
  • uint SpawnCount: a counter of the number of times the player has gone from Spawning to Spawned

0.5.16

9 months ago

Download 0.5.16

Requires at least Openplanet 1.26.0

  • Add .RequestsSpectate on player
  • Add .WarmupActive and .WarmupEndTime on RaceData

0.5.15

1 year ago

Download 0.5.15

Requires at least Openplanet 1.26.0

add to Player class:

  • uint[]@ NbRespawnsByCp a count of respawns by CP
  • uint[]@ RespawnTimes array of the players respawn times
  • bool PlayerIsRacing if the player is spawned and has not finished
  • bool Eliminated if the player is not spawned and has not finished (indicates a DNF on teams, KO, etc)

0.5.14

1 year ago

Download 0.5.14

Requires at least Openplanet 1.26.0

  • Fix lap detection when a map has LapCount = 0 set (hides Lap 1/1 when using a multilap in a map; affects TOTD 2023-12-10)

0.5.13

1 year ago

Download 0.5.13

Requires at least Openplanet 1.26.0

  • Support next game version (change of script location)
  • Fix rare race condition that can occur when joining a server and a player leaves shortly after.

0.5.12

1 year ago

Download 0.5.12

Requires at least Openplanet 1.26.0

  • Fix bug with LapsNb & CPsToFinish on a server after playing a map with > 1 lap.

0.5.11

2 years ago

Download 0.5.11

Requires at least Openplanet 1.26.0

  • Add accurate number of laps (informed by game mode): .LapCount_Accurate
  • Refactor .CPsToFinish to account for proper number of laps
  • Add .IsFinished getter to player object -- it is just .CpCount == RaceData.CPsToFinish
  • Add .Rules_GameTime, .Rules_StartTime, and .Rules_EndTime to race data for convenience

0.5.10

2 years ago

Download 0.5.10

Requires at least Openplanet 1.25.32

  • Fix COTD quali data in race data v4
  • Add COTD quali data to demo UI

0.5.8

2 years ago

Download 0.5.8

Requires at least Openplanet 1.25.32

Add COTD Qualification data. New properties in RaceData_V4:

// Qualification time known locally
int COTDQ_LocalRaceTime;
// Qualification time according to the API
int COTDQ_APIRaceTime;
// Qualification Rank, updated regularly (3-7s)
int COTDQ_Rank;
// Time you joined the server
int COTDQ_QualificationsJoinTime;
// Stage that qualification is in;
QualificationStage COTDQ_QualificationsProgress;
// true when you load into a server before it has gotten your record from the API
bool COTDQ_IsSynchronizingRecord;
// Incremented each time any COTDQ thing is updated
int COTDQ_UpdateNonce;

0.5.7

2 years ago

Download 0.5.7

Requires at least Openplanet 1.25.32

  • Ensure BestRaceTimes is never null and update comment

0.5.6

2 years ago

Download 0.5.6

Requires at least Openplanet 1.25.32

  • Fix possible rare script exception when Player.Score is null

0.5.5

2 years ago

Download 0.5.5

Requires at least Openplanet 1.25.32

  • Comment out code that optimistically updated BestTime and BestRaceTimes based on CurrentRaceTimes data (may fix an RMT bug).
  • Check if the map changed each frame, rather than once every 60 frames.

0.5.4

2 years ago

Download 0.5.4

Requires at least Openplanet 1.25.32

Fix misuse of #elif preprocessor statement.

0.5.3

2 years ago

Download 0.5.3

Requires at least Openplanet 1.25.32

This update improves ghost data with info about currently loaded ghosts.

  • Additions to GhostData:
    • .SortedGhosts -- an array of all ghosts loaded this session, sorted fastest to slowest
    • .LoadedGhosts -- an array of currently loaded ghosts only, sorted fastest to slowest
    • .NbLoadedGhosts -- the number of ghosts in .LoadedGhosts
  • Addition to GhostInfo_V2:
    • .IsLoaded -- true initially and changed to false when the ghost is unloaded

Additionally, a setting has been added to allow viewing the demo windows when running outside of developer mode. (Defaults to true in dev mode, and false otherwise.)

0.5.2

2 years ago

Download 0.5.2

Requires at least Openplanet 1.25.15

Matchmaking Support

Expose MM info:

  • Clan (Team) Scores, current MVP, Players Finished, Points Limit, Points Repartition, Ranking mode, Round Number, Round Winning Clan, Start of round indicators, Team Populations, Teams Unbalanced flag, Warm Up flag
  • ComputePoints function to calculate player scores and team scores at the end of a round, using current data, given an order that players finish.

Add PlayerCpInfo V4:

  • Added properties: int RoundPoints, int Points, int TeamNum, bool IsMVP, uint CurrentLap, string WebServicesUserId, string Login

0.4.4

2 years ago

Download 0.4.4

Requires at least Openplanet 1.25.15

Race Data v3

  • add .BestLapTimes to PlayerCpInfo_v3
  • populate current CP times and best lap times after joining a new server. This means a players CP times will always be accurate, unlike previously where CPs taken prior to joining the server would have a time of 0.

0.4.3

2 years ago

Download 0.4.3

Requires at least Openplanet 1.25.15

  • Fix for rare crash on map load where player score data is accessed too early.

0.4.2

2 years ago

Download 0.4.2

Requires at least Openplanet 1.25.15

Fix path not returning value.

0.4.1

2 years ago

Download 0.4.1

Requires at least Openplanet 1.25.15

0.4

  • Update access interface to race data and ghost data
  • Add respawn data for all players (number of respawns, last respawn time & cp, time lost to respawn (overall and by cp), theoretical time (i.e., no-respawn time)
  • Other updates to PlayerCpInfo via PlayerCpInfo_V2
  • Add new sort method to race data: Race_Respawns -- it's like the Race method but immediately updates to account for time lost to respawns
  • Improve Race Feed Demo UI
  • Add some properties to GhostInfo

Upgrade guide: https://github.com/XertroV/tm-mlfeed-race-data/blob/master/UPGRADE_v0.4.md

Full Docs: https://github.com/XertroV/tm-mlfeed-race-data/blob/master/MLFeed.autodoc.md

0.3.8

2 years ago

Download 0.3.8

Requires at least Openplanet 1.25.15

Added MLFeed::GetPlayersBestTimes(const string &in playerName) to get the best times set by a player since map load. (It's what the server shows CP splits against)

0.3.7

2 years ago

Download 0.3.7

Requires at least Openplanet 1.25.15

  • 0.3.6: Added Ghost Data (thx for the request, @Orange)
  • 0.3.7: Fix bug with player rankings (.taRank and .raceRank) where they would be off by 1 for a short while when a player left.

0.3.5

2 years ago

Download 0.3.5

Requires at least Openplanet 1.25.15

  • Add field LastRecordTime to race data. When the player sets a new personal best, this is set to that time. Reset to -1 at the start of each map.
  • Update readme / docs