kaiusl / klplugins.dynleaderboards Goto Github PK
View Code? Open in Web Editor NEWACC leaderboard plugin for SimHub
Home Page: https://kaiusl.github.io/KLPlugins.DynLeaderboards/
License: MIT License
ACC leaderboard plugin for SimHub
Home Page: https://kaiusl.github.io/KLPlugins.DynLeaderboards/
License: MIT License
Hi,
I was thinking about additional properties that might be accessible from the plugin, not sure if the below data would be accessible from ACC and can be implemented?
Distance in meters to the yellow flag incident ahead, or white flag (slow car) ahead? (Have seen this used in other programs so it appears that ACC outputs this data)
Drive-through or stop-and-go penalties (with associated time penalty in seconds) per driver
Mandatory pit requirement & completion per driver (i.e. DataCorePlugin.GameRawData.Graphics.missingMandatoryPits & DataCorePlugin.GameRawData.Graphics.MandatoryPitDone)
dynamic leaderboards -> leaderboard rotation resets to default on simhub restart (all enabled and in default order)
When we start SimBub at the middle of session, some cars seem to get extra laps. This messes up overall ordering.
This would allow to pack configs with dashboards/overlays and wouldn't require separate setup by the end user's who just downloaded the dashboard/overlay.
Split from #14.
Add mandatory pit requirement & completion per driver (i.e. DataCorePlugin.GameRawData.Graphics.missingMandatoryPits & DataCorePlugin.GameRawData.Graphics.MandatoryPitDone).
Split from #14.
Add drive-through or stop-and-go penalties (with associated time penalty in seconds) per driver
I won't be getting the new ACC DLC right now and thus I cannot generate the lap data for Red Bull Ring and need some help updating the plugin to include proper gaps calculation.
Download and install utility plugin for SimHub from https://github.com/kaiusl/KLPlugins.DataExport/releases/tag/v0.0.2
Run three 10min AI qualy sessions (see below for the images with session settings):
This will track the AI cars and save their best lap data.
Either:
a) upload the generated files from ..\SimHub\PluginsData\KLPlugins\DataExport\laps_data\raw
(as zip or make a PR with them added to PluginsData\KLPlugins\DataExport\laps_data\raw
), so I can post process them or
b) fork this repo, copy the generated files to the forks PluginsData\KLPlugins\DataExport\laps_data\raw
and run the python post processing script PostProcessLapData.py
and submit a PR with newly generated lap data files. (Both raw and post processed files should be included).
Note that occasionally the raw generated files can end with weird position values (jumps from 1 to 0.x). If it is the case for all classes then the track has some offset between the point where position and time reset. However if happens only for some of the class then so far rerunning the qualy session and regenerating the raw files has fixed that issue.
As I won't be getting the new ACC DLC on the 19th and thus cannot generate the lap data for Valencia, I need some help updating the plugin.
@Mtrade You still up for helping?
\SimHub\PluginsData\KLPlugins\DataExport\laps_data\raw
.Trying to use full name on leaderboard, i replaced the line
return DynLeaderboardsPluginProp(leaderBoardName, position, "Driver.1.InitialPlusLastName").replace(teamName, "");
with
return DynLeaderboardsPluginProp(leaderBoardName, position, "Driver.1.Fullname").replace(teamName, "");
Now the name is blank in leaderboard
If i change the settings in simhub additional plugins/DynLeaderboardsPlugin the same thing happens. I have restarted Simhub.
Hi again,
Using the Gap.ToFocused.OnTrack property to calculate the gap ahead/behind myself, I notice the result will include cars in the pitlane. Would it be possible to exclude cars in the pitlane with this property or am I overlooking another property that will achieve this?
Simhub has a built in quick component (Opponent gap) that will allow to select a gap "Leaderboard Position Relative to Player on Track" that can solve this but the internal gap calculation is not stable like you have corrected nicely in your plugin.
I have tried setting Simhub's gap computation mode to "game" or "Simhub" but the results are the same.
(BTW thanks for the additional valid.lap properties, they work great!)
Hi,
The best lap sectors are equal to the last lap sectors, even when the lap is not your best lap, i.e. .Laps.Best.S1 = .Laps.Last.S1 (and the same for S2 and S3).
Also if you restart a race, then the Position.Overall.Start = -1 for all cars.
Otherwise a great plugin.
I am running the latest version of ACC (v 1.9.5) and the latest version of Simhub (v 9.15), do your fastest lap and then do a slow lap. At which point .Laps.Best.S1 = .Laps.Last.S1 instead of .Laps.Best.S1 still relating to your best lap.
After doing them lap, restart the race and then Position.Overall.Start = -1 for all cars instead of their correct starting position.
1.3.2
9.15
No response
No response
Should fix improper gap calculations if a new track is released but we haven't managed to push an update yet. At the moment the gaps are null
if the lap data is not available.
We can use a distance based calculation as a backup, so then the gaps do fluctuate a bit more but at least we get realtime gaps.
If the number of relative positions for partial relative class leaderboard is set to N, then it only shows N-1 positions ahead but N+1 positions behind. Simplest to see it is to compare to the partial overall leaderboard in single class race.
The positions need to be shifted by one. Should be a simple fix, I think...
Hi,
Great plugin and additional properties, thanks for all the hard work.
Wondering if it is possible to add a property that determines if a given car is currently on a valid lap? I.E. if Car X is on an outlap or has invalidated the current lap, return 0, else return 1 , for example.
It seems this info is available within ACC on the track map but the current Simhub property (isValidLap) is available only for yourself and not other drivers.
Thank you
The default leaderboard config is generated at the first start of the plugin. At the moment this only seems happens if the selected game is ACC. However starting the plugin (with any game selected) needs to load that config file. So starting the plugin first time when the selected game is not ACC results in an error.
[2023-04-18 11:52:08,255] ERROR - An error occured while loading plugin settings control for DynLeaderboardsPlugin: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at KLPlugins.DynLeaderboards.Settings.SettingsControl..ctor(DynLeaderboardsPlugin plugin)
at KLPlugins.DynLeaderboards.DynLeaderboardsPlugin.GetWPFSettingsControl(PluginManager pluginManager)
at SimHubWPF.MainWindow.<>c__DisplayClass52_0.<LoadPluginsControls>b__0()
On my machine Simhub itself launches fine even with this error. Solution is to just select ACC, which will reload the plugin and generate the needed config file. Any following launches (with any game selected) work fine.
I have been maintaining a personal fork to allow me to use this leaderboard plugin for all my streams, even if the game is not ACC (and also address some short comings). https://github.com/LukasLichten/KLPlugins.DynLeaderboards/tree/generalized
However it is currently not in a state of being turned into a PR:
Before I rebase and or rebuild (potentially into multiple PRs) this I wanted to ask.
Firstly if I should do this at all.
But then in terms of design especially how and if other game multiclass should be handled, as it would require in the UI the ability to add more classes, perhaps require defining car names that would be put into the class (for AC for example), but especially the car classes could no longer be handled by an Enum.
Currently the other game support is run by in large parts emulating the way the websocket messages would be reencoded into classes like RealtimeUpdate (but instead using another constructor that takes the simhub data to construct it) using the ProcessViaSimHub function in Values.
For the other things that can be turned into other PRs:
this error is spamming logs
[2023-04-19 21:29:10,555] INFO - DynLeaderboards (ACCUdpRemoteClient.cs: ConnectAndRun,86)
Couldn't connect to broadcast client. Err System.IndexOutOfRangeException: Index was outside the bounds of the array.
at KLPlugins.DynLeaderboards.Values.<>c__DisplayClass72_0.<OnBroadcastRealtimeUpdate>g__SetStartionOrder|5()
at KLPlugins.DynLeaderboards.Values.OnBroadcastRealtimeUpdate(String sender, RealtimeUpdate update)
at KLPlugins.DynLeaderboards.ksBroadcastingNetwork.BroadcastingNetworkProtocol.ProcessMessage(BinaryReader br)
at KLPlugins.DynLeaderboards.ksBroadcastingNetwork.ACCUdpRemoteClient.<ConnectAndRun>d__29.MoveNext()
no errors in single player mode
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.