How I Solved Ice (And Everything Else) in Trackmania
I solved Ice in Trackmania by deriving a model then creating an Openplanet plugin to show me the car's acceleration and gearing behavior at different slip angles.
The first part of this video is a demo of what this tool is capable of and some usage directions. The second part is a more technical analysis of how I actually solved for it.
The model was solved for using a greedy N-piecewise polynomial regression algorithm.
Once the Openplanet team allows such tools to be public, the repositories below will be made public and the plugin will be available on the plugin manager.
github.com/sma...
github.com/sma...
Acknowledgements:
Openplanet Team
XertroV (Update-warning plugin code contribution)
Matt's Ramblings (inspiration, • In search of the perfe... )
Bux (inspiration, some early work reference)
Пікірлер: 129
To clarify the release of this plugin and where to find it: The Openplanet team will be releasing a "learning mode", where you can use plugins like this *but* any times you drive won't submit to the leaderboards. This way, players will be able to use these types of plugins to learn without impacting the competitive scene. This is currently still in active development, and there's no release date at this time. Once this is done, I'll be releasing the plugin on the Openplanet plugin store and making the github repos public. If you have more questions about this or want to know more, please join the Openplanet discord: openplanet.dev/link/discord
@aughlnal7333
Жыл бұрын
Wouldn't it be incredibly easy too circumvent that? Running 2 instances of Trackmania with the same inputs, but only one with Openplanet?
@ZaKeRGFX
Жыл бұрын
@@aughlnal7333well you can already cheat in the game easily if u want. Like nothing prevent you to make a TAS for instance.
@b005t3r
Жыл бұрын
@@aughlnal7333 It's even easier to download the plugin and modify the code, removing this restriction :)
@faremir
Жыл бұрын
@@b005t3r Except Open Planet itself will be doing the plugin check and leaderboard prevention. But go for it.
@b005t3r
Жыл бұрын
Open Planet is open source, there's nothing stoping anyone from removing the leaderboards checking code and using the modified build. For cheaters determined enough, this will not be an issue, just a minor inconvenience.
Damn man, impresive stuff. I think with this it is highly possible to teach a neural network how to actually play trackmania, since it gives such a elegant tool to maximize acceleration and therefore, minimize time needed to finish the track.
@sergeantbigbird
Жыл бұрын
Pedro is working on a project just like that! Check it out here - www.twitch.tv/pedroaitm (not personally affiliated)
Great job, man, good to see you're using your Ph.D. to make the world a better place :) But seriously, impressive stuff. PS. I love that "early vhs footage" part :)
as an architect who's passionate about parametric design and AI optimization, and as a beginner at trackmania, you are awesome! please keep doing what you're doing
Amazingly done! Do you think you would be interested in narrating a Trackmania Course? Think you'll do insanely well
@Bitz.
Жыл бұрын
i think that 2
@sergeantbigbird
Жыл бұрын
I’ll definitely consider it! The response to this has been better than I was expecting. The biggest problem is that I’m personally quite a mediocre TM player, but it could be a really fun project.
@RacetasClub
Жыл бұрын
@@sergeantbigbird oh epic! feel free to HMU then, email, discord wherever you want, only need a few minutes of your time :) If you are interested that is hehe
@RacetasClub
Жыл бұрын
@@sergeantbigbird I am super sorry for this, but important for me to tell you, that I probably found someone by now. That being said, your voice is great, and super interesting, and I say it after reviewing 3,000+ voice actors in the past, so trust me when I say you got potential. If you put work into it, sky's the limit. The 'explainer' mode in the middle of the video is the best part, because it feels effortless, the tone is interesting, there are good "high's" and "lows" to it to ease sentences and so I can see potential. It can take even 5-10 years to become a great voice actors, but you need like maybe 1 or 2 hehe, that's all, hope it helps :)
@sergeantbigbird
Жыл бұрын
No worries! Sorry it didn’t work out this time (life stuff came up, ended up away from my desk for the night) but would always be happy to be in touch if anything comes up in the future.
This reminds me somewhat of assists such as Racing Line in other games like the F1 games. In F1 2022 the Racing Line assist gives the player a visual indication where to place the car and when to brake to get through every corner in the best possible way; taking the racing line. Similarly this plugin gives a visual aid on how to angle the car ideally to make a corner as fast as possible (and finally give a clue on why a slideout occurs). I am glad this will be available in Learning Mode in Openplanet. So well done! Really good stuff! Although I believe Nadeo would do good with implementing some of the basic but popular quality of life improvements from Openplanet (like the speedometer with gears) to the vanilla game and the more advanced stuff like this to a Learning Mode. It also reminds me of World of Tanks, which is a vastly different game but has a similarity with having a community modding scene that introduced features and QOL Improvements through a mod installer not unlike Openplanet that have been gradually implemented into the vanilla game. If I remember correctly Wargaming (the World of Tanks Developer) on occasion gave out cashprizes to the modders when implementing their mods, many of which have been essential to the game and community for the better part of a decade. However this did not displace the modding scene as there remain novel and installworthy mods to this day (which may or may not be implemented to the base game eventually).
holy crap.. this is a well thought out video amazing presentation, your voice over is great, the problem solving is ++. this is superb. keep it up.
I think a nice addition to just using the average curves would be to include a shaded area around it (that includes 1, 2, or 3 standard deviations from the average at that point). That may provide a leeway of sorts and the driver can see that their current acceleration falls inside the shaded area. It can also show places where the model might not be such a good fit, and where the driver can optimize more on their own.
This is such an interesting video! Thanks for showing off the model on my map, Capybara ft Henkisme (3rd place World on the map). That downhill gear was most player's worst nightmare during COTD so it's interesting to see it solved in a sense with the speed model. Ice is definitely one of those harder surfaces to master and this tool should definitely help beginners to train on it.
Amazing effort from you! Gotta love the creativity of the TM community :D
Nadeo, give this man a job, this is ridiculously cool.
After a quick look I couldn't find anything online about how acceleration is calculated. Might be worth looking at the source code and seeing if you can find the method. Would reduce data needed massively. "If your code runs too slowly and you have optimised as much as you can, solve it directly". I don't play trackmania but I respect the maths and python, super nice video.
@Michaelonyoutub
Жыл бұрын
I doubt people have completely figured out ice enough to solve it yet, but some of the more normal surfaces have been solved I am pretty sure. Back when speed sliding was first being discovered and looked into, people found out it was due to sliding in the game being modeled as a sideways acceleration, so by sliding slightly you get a slight acceleration due to trigonometry, when you usually wouldn't get much acceleration at all, if any.
@marcelinio9988
Жыл бұрын
Well the problem is the sorce code is not public
I still don't understand why they won't let these tools go public, everyone would have equal access to the tool, for free, with minimal effort. It's such an incredible training tool that would let people like me, who don't have hundreds of hours a month to dump into the game, stand a chance at actually learning how to ride various surfaces
@sergeantbigbird
Жыл бұрын
It will be public once learning mode comes out - there’s too much risk for the competitive scenes for these to be public before then (especially for fullspeed)
That's amazing, great data science skills man
whoever made ice in trackmania deserves P A I N
very cool tool! had to watch twice because i was confused the first time but youve explained it pretty well.
This is exactly how I like doing data science.
@cubicinfinity2
Жыл бұрын
Well, except that I use R.
@xanboyyy
Жыл бұрын
@@cubicinfinity2 I've used both, and found out that I prefer python. Do you have a reason why you use R instead? Or is it just the language that you started with?
interesting that you chose to release this, as another youtuber made something similar for speed slide angles and chose not to release it because they were concerned people would use it to cheat edit: it was matt's ramblings who made the speed slide tool
@sergeantbigbird
Жыл бұрын
The tool will only be public once Learning mode is released on Openplanet - that will make sure that records aren’t submitted to leaderboards when tools like this are active. The Openplanet discord has a thread with more details.
@0xGRIDRUNR
Жыл бұрын
@@sergeantbigbird got it, glad to hear my concerns had been taken into account.
Have you tried to get the curves via FFT? :) Would be nice to sample some speeds and parametrize the FFT component values.
@sergeantbigbird
Жыл бұрын
I totally forgot about FFT when I was implementing this. That's a really interesting idea. Will have to look into it
took me a little to understand the meaning of the graph but once i got it i think this would be very helpful for beginners like me
Gotta love those if statements
Not sure about the details for the 4000+ if statements, but you could probably have an even better performance speedup if you mapped all these functions with an hashmap instead (assuming all your ifs have the same type of data as a parameter (or are mappable to the same type), and the conditions don't overlap). You could go down to something like 0.003ms instead, even lower maybe. I don't think 0.3ms is that impressive for 4000 ifs, the computer can iterate and compare a lot of operations quickly. I think it's actually pretty slow for an if else section xD But yeah, don't mind me saying whatever caught my attention during the explanation of how you did it, I think you did an amazing work here. I don't think you "solved" trackmania, because it looks like there is still a significant error margin on some angles. I think we'd need to reverse engineer the code to actually do that haha. That being said, your contribution seems like a good step in the right direction, and you can pat yourself in the back for that!!!
@sergeantbigbird
Жыл бұрын
The biggest bottleneck in the plugin is, unfortunately, NanoVG. Each frame always takes ~3-5ms with reasonable settings, and at high settings (higher solved point density, player trails, etc) it can easily turn into a slogfest. The underlying data structure is currently closest to an unbalanced tree; each call is bucketed individually by gear, slip, then speed. A typical lookup goes through three checks (gear, slip, speed), with 5, ~100, ~100 checks within each of those buckets (of which, the average result will return halfway through). As an example: (curGear
@itellyouforfree7238
Жыл бұрын
@@sergeantbigbird instead of an unending list of if statements, arrange the cutoff values in an array and find the correct bin with binary/linear search
@sergeantbigbird
Жыл бұрын
@@itellyouforfree7238 By the time the machine runs it, what's linear search beyond an ordered set of 'if' statements? Honestly, the biggest reason I haven't bothered to fix this yet is iteration time - it's super easy to just dump in a new model, reload the plugin, and have it effective immediately rather than having to purge and reload model params from some external source. I'm probably going to implement something like that for the prod release, but it's an annoying problem. (Especially since I'll be adapting this to add new features in the future, e.g., solving for reactor boost trajectories. I only want to have to build the coupling interface once for all future projects)
@itellyouforfree7238
Жыл бұрын
@@sergeantbigbird Maybe I wasn't clear enough. Your sequence of if statements is equivalent to searching an item in a sorted array by scanning sequentially from start to finish. This can be improved by searching the cuts that bracket your input with a binary search. Generating that isn't more difficult at all. Instead of printing a long list of if statements with expressions inside, you dump a few arrays with the cuts and the parameters needed for the interpolation. Then the interpolating function finds the bracketing cuts with binary search (or possibly better linear search) and uses the corresponding parameters to compute the interpolated value.
@itellyouforfree7238
Жыл бұрын
The time complexity difference is that you find the correct "branch" of the interpolating function in O(log n) instead of O(n), where n is the number of branch cuts
Fascinating, I wonder if that could be applied to cars irl.
I barely play trackmania but this is so cool, good work man
Biggest respect for this!
Nice video man, wow. Are you plotting the absolute magnitude of the acceleration force? If not which angle do you measure the force vector relative to, the velocity?
@sergeantbigbird
Жыл бұрын
I’m taking acceleration as the scalar ||V2|| - ||V1||. If we take the pure acceleration vector (V2 - V1), then the turning action of the car will be included in the resultant vector rather than just the increase in speed.
@yoloswaggins2161
Жыл бұрын
@@sergeantbigbird Makes sense, thanks.
Great work, liked the video and shown content a lot.
This reminds me of a training video at work..
That's an amazing training tool
Trackmania community is ourworld
thats gonna be so helpfull
Data mining: Ew Research: That's the shit!
Bro u should work at Formula 1 , give this man a job!!!
Whoa this is so cool!!
As a fairly new player, I suck at most ice maps. This tool will help me improve which is amazing. Only issue I’m facing, how do I read it?
so like. It's been a solid year. Is open planet ever going to allow visual tools like this? Is your plugin ever going to see the light of day?
@sergeantbigbird
8 ай бұрын
Eventually - learning mode isn’t killed, it’s just delayed. It’s a hard thing to launch with a lot of risk, so it has to be done right and Miss (openplanet dev) is pretty busy
Look so cool to learn! Thanks!
is there any progress with publishing it to the public? i'd be greatful for any info
Do you try cubic spline/bspline or multi linear sub model to fit your data ? It's seams like your fitted model is not as smooth as it could be. Do you plan to release the data, I could give it a try with my own approach
@sergeantbigbird
Жыл бұрын
I’ll be releasing the full dataset! I’ll clean up my APIs as well to make it easier for others to make a model and get it applied in the game. I didn’t explore those ideas - there’s been a lot of really interesting suggestions in the comments. Going to follow up on them and see how they hash out (those included)
Game changer.
Amazing!
freaking amazing
What I learned from this video is i will never be a programmer Great video tho!
Where is download link i cant find it and the github link is down
Any chance you would share the collected dataset?
@sergeantbigbird
Жыл бұрын
Sure, will do once it’s released
Nice work You also can use gaussian processes for this data :)
awesome
Can plug in be used with the standard version of tm?
can't seem to find this anywhere, is it released yet?
@agitated_cat
Жыл бұрын
also is there an api or something to use the data from it in other plugins? would be interesting to use this to make "perfect" speedslides or wiggles (obviously not for real runs, presumably this would be used in the "learning mode")
@sergeantbigbird
Жыл бұрын
Not yet unfortunately :/ Learning mode still isn't out. I can look into exposing APIs for these projects when they're released - once stuff is out, @ me on discord and let me know what you'd like to see there
Awesome!
It should probably record data from everyone that uses it so it will get better over time. (Probably everyone will be using it)
And he didn't even mentioned the power this has on Full Speed
Is it useful for speeddrifts?
@Michaelonyoutub
Жыл бұрын
from the graphs it showed of normal surfaces, it sure looks like it since they had peaks slightly to the left and right
Professors out here acting like I can't use 4,924 if statements but then I see it work well in real-time. Must be because the statements are all so small?
@sergeantbigbird
Жыл бұрын
It’s structured like a very lopsided tree rather than truly 4900 comparisons per data point - instead, the typical call will see around 150-300 ifs before it finds the right value. This still isn’t ideal (should be a balanced tree for that sweet log(n) performance), but I’m kind of lazy and this implementation works well enough. Rendering the UI still takes 10-20x longer anyway 🤷♀️
cool
5k if statements part hurt to look at.
Crazy
It would be nice if openplanet let certain plugins disable getting official times. A tool like this is amazing for training and learning, but using it for actual time attempts starts to get into a gray area I feel.
@commander8625
Жыл бұрын
I would probably say its cheating (in a legit run). In trackmania, cheats frequently come in the form of tools (outside of the game itself) that are used to gain an advantage while driving a track. In particular, we (the community) tend to care about a competitive advantage, which is why TAS is acceptable if you aren't going for a world record (or other competitive run), for example. Although, you are certainly right. This tool is a grey area, since it doesn't make the inputs easier, but rather improves understanding of the game. In my opinion, however, even if we were to discredit the previous argument, it would be negative for the competitive spirit of trackmania. I presume that the use of this tool in competitive runs would just lower skill level of players across the leader boards, or at least reward players with true skill and talent less than they would otherwise be rewarded. A tool like this lowers the skill gap (in the understanding of the game), but it also has the potential to lower the skill ceiling and progression of players who use it too frequently. Although, what do I know? Im not even good at trackmania.
@Michaelonyoutub
Жыл бұрын
Thats apparently literally what they are planning, you can have it enabled, but when it is, openplanet will not upload times to the leaderboards.
wait so you didnt fix anything ore change physics you just ,made a viewing window to help you dial it in
@amazingjackJF
Жыл бұрын
@@bgtgbbgbtvggt8200 i know
oh, i thought you RE'd it from the game code
Good effort, still don’t understand the tool tbh
Why not crowdsource the crapton of data for the best model possible? (:
@sergeantbigbird
Жыл бұрын
While things have to stay private yet (before school mode is out), I’m hesitant to do too much of that - the hardest part of data collection is covering all angles and speeds. The easiest way to do that is to have the real plugin running while you’re doing the data collection, so you can see where the existing model has weak points. As this expands, though, I might try and recruit some people to cover more surfaces (icy plastic, wet grass, magnet, platform, etc - basically all the stuff that I don’t want to spend an hour doing myself).
wow
inb4 wirtual finds this
now just get rid of acceleration penalty please, sure you should loose alot of speed when crashing but you should be able to acceslorate as fast as u can all the time, and also swapping from forwards to reverse takes so long
what is it that people use to filter out mouth sounds on recording? whatever it is please use it... aside from that great stuff
@sahatlst8708
Жыл бұрын
ok I can't actualy bear to listen to this, which is a shame because it looks realy interesting! (yes I know I said "great stuff" before I just didn't want to be too negative)
@sergeantbigbird
Жыл бұрын
A pop filter - noted. I'll make sure to pick one up before the next video I make like this. (was just recorded on a bare SM57)
Can't you make like a legal agreement to collect player data for your bucketing algorithm? I mean you need alot of data right? What if you make an application that can extract the pro player movement and use it for your algorithm? Since pro player is always willing to help if it's help the community to play trackmania game. Like wirtual probably will help you
@sergeantbigbird
Жыл бұрын
With something like this, I luckily don’t need any skills at all as far as actually driving goes. The data collection that’s left to do is to just fill out my graphs for every speed and every angle, and all of that is fully deterministic. It’s possible to watch any replay with this tool, but the data is of very poor quality - nowhere near good enough to actually train the model. It’s useful to watch and validate that what I’m doing is right, though.
damn, it will feel like cheating using this haha
Dude what
made this a long time ago, i was refused from publishing on the openplanet site, and was recommended by someone at nadeo not to publish it myself.
@derickd6150
Жыл бұрын
That's so weird. I feel like just knowing the ideal curve doesn't make you able to do it
@Cara.314
Жыл бұрын
@@derickd6150 looks as though they are finaly changing their tune, nadeo has been fine with people making these visual assistance tools but suggested against publishing, but looks like openplanet will soon have a learning mode specifically to allow these kinds of tools in the right contexts. It was Miss of Openplanet who was against signing SD plugins for anyone to use.
Bruh
nice, way to gatekeep trackmania
Please do not release this for fullspeed! There is a discussion abput similar sd/accel plugin that Shows how good or Bad your sd is and nearly every fullspeed Player is against any visual helping Tools or plugins.
@sergeantbigbird
Жыл бұрын
The Openplanet team will be releasing a learning mode where players cannot submit any times to the leaderboard. It’s only in this context that I’ll be releasing the plugin. There’s been a lot of discussion around this in the Openplanet discord - please join the conversation there to see the exact implementation details and to raise your concerns if you feel that an issue isn’t being addressed properly. openplanet.dev/link/discord
@chosen_none
Жыл бұрын
I'd love to have this as a player who's trying to learn FS. Much of the time I have no idea if I have the optimal angle and if or what I need to do the improve. Not having it for real times is fine by me, but I could really use it to help learn what I need to do.
@RemixDas
Жыл бұрын
@@chosen_none yes I see your point, but plugins like this would ruin the competetive scene
nihhgg