The Story of The Best Trackmania AI Ever Made
Ғылым және технология
I trained an AI that plays Trackmania with reinforcement learning. It's getting good enough to challenge Official World Records. This is the story of how my AI reached such an incredible level.
Link to raw run playlist: • Full runs
Link to replay pack: drive.google.com/file/d/19p10...
Link to input files: drive.google.com/file/d/12Jfp...
Project Github: github.com/pb4git/trackmania_...
Game: Trackmania Nations Forever
Buymeacoffee: buymeacoffee.com/linesight
00:00 Intro
00:43 map5 (v1 and v2)
03:58 A01
05:10 map5 (v3)
07:27 Official Campaign intro
08:42 A02
11:11 D06
14:22 Official Campaign
15:59 vs TAS
17:14 Minitrial
22:04 Method
23:14 Zero-shot
24:03 Next steps
25:38 Finale - Hockolicious
27:04 Credits & Times
#AI #reinforcement #learning #trackmania #world #record #official #campaign #tmnf
Music Tracks:
Luge - Geographer
Instant Crush - Corbyn Kites
Subway Dreams - Dan Henig
Hall of the Mountain King - Kevin McLeod
I got a stick - Kevin McLeod
Envision
Arp Bounce - Geographer
Up the steps - Geographer
Shitsubo Shita - Josh Lis
Just Breathing - NEFFEX
Tinker Time - Nathan Moore
Contact us:
First join the TMInterface Discord / discord , then head over to the #programming-talk channel / discord
This project would not have been possible without the awesome TMInterface tool, provided by @Donadigo.
Пікірлер: 1 100
Bruh... If I was picky I'd say that this is not exactly the same learning method, but I'll mark my words and eat my hat if you drive Deep Fear respawnless with AI v4.
@linesight-rl
18 күн бұрын
You're probably safe: the AI has trouble with fullspeed maps as evidenced on A01. But we'll definitely try!
@tylercorrin1615
18 күн бұрын
@@linesight-rlhow come it struggles with full speed? As a human that naturally prefers the full speed elements of trackmania I feel like surely it should be easier because there’s less complex inputs? Just curious
@vitriha3787
18 күн бұрын
@@tylercorrin1615 My guess based on the information given in this video, FS might be harder to train because of the low resolution screenshots and low fps the AI has available. If you look at 5:50, you can see how hard it is to see far ahead, which is critical in high speeds, because what is far ahead will be much closer much earlier in high speeds compared to low speeds.
@Red_Fox_Miro
17 күн бұрын
@@vitriha3787 Maybe you could increase the resolution in the middle of the image
@Murzac
17 күн бұрын
@@vitriha3787 I'm also going to bet that it's really hard for it to do accurate speed slides when the skidmarks are like 2 pixels wide.
Putting Wirtual in the video with a swedish car is wild
@SAPANNow
20 күн бұрын
Shots fired fr
@tiquitita2001
20 күн бұрын
😂😂😂😂😂 yes
@satansbarman
20 күн бұрын
I believe he'd lost a bet and had to use a swedish car for about month iirc
@MackAttack101
20 күн бұрын
the disrespect 😂
@THICCTHICCTHICC
20 күн бұрын
Absolutely devious
Something tells me Wirtual is not going to try and beat it
@linesight-rl
20 күн бұрын
He's welcome to try, but the challenge seems even harder than Deep Dip 2 😁
@rasol136
20 күн бұрын
@@linesight-rl would be great to see if the AI could figure out Deep Dip 1.... maybe having height be a reward?
@RubyPiec
20 күн бұрын
@@linesight-rl okay now i'm curious whether an ai can climb deep dip (it'll be harder to train it on the new trackmania though, wouldnt it?)
@meraldlag4336
20 күн бұрын
@@rasol136you would have to take the floor of a height modulo something (assuming they are equally spaced) as one big jump could ruin that model. Or maybe it just uses that as a shortcut 🤷
@dovos8572
20 күн бұрын
@@rasol136 the problem is that deep dip is in tm 2020 and that game doesn't allow AI/tas. it is why linesight is training it on the older game.
I love the visualizations with multiple copies of a run. It's really awesome to see the differences in human vs AI racing lines.
@snowe..
20 күн бұрын
yeah that was such a good way of visualizing WR times.
i love how humans still beat it on a01, truly shows how insane the a01 wr is!
@boom-jr8vi
19 күн бұрын
for now… 😢we’re really approaching the end times istg.
@poruzu
19 күн бұрын
@@boom-jr8vi yeah in a couple months its gonna compete with tas runs so a01 wr will be the warm up lol
@tom_skip3523
17 күн бұрын
Remember that this Ai has a brain of a fruit fly. Nothing compared to the AIs currently out there
@poruzu
16 күн бұрын
@@tom_skip3523 i mean a brain of a fruit fly is pretty impressive since it can use it perfectly. Yeah there might be better ais but not in trackmania (atleast i think there aren't)
@wroomwroomboy123
15 күн бұрын
s4d is not a mechanic neural networks just learn to use. Pretty sure the model is not adapted to work with so many degrees of freedom.
i like how you even included the sections where humanity beats the ai
@lLostGems
20 күн бұрын
section
@lolcat69
18 күн бұрын
It was only 1 map lol
@R4MMU5
18 күн бұрын
The AI just needed a bit more training on that map
@lukeskyguy2238
17 күн бұрын
I feel like it won't find speedslides without some human input, and I doubt it could win simply by training more.
@R4MMU5
17 күн бұрын
@@lukeskyguy2238 Did it not find the speedslide by itself in the video? 😆
It would be really interesting instead of 0-shot learning to see how few-shot learning would work. Let the general AI fine tune on the new map for a few minutes to see how much it improves. Maybe we can see the AI play Random Map Challenge at some point?
@StriderGW2
20 күн бұрын
having a 24/7 stream of ai on random map challenge would be so hype
@poruzu
20 күн бұрын
@@StriderGW2 i would genuinely watch that every single second i could
@HK_BLAU
20 күн бұрын
i second this
@cyanhacker
20 күн бұрын
AI cannot play different tracks on same neural network 😢
@Krarilotus
20 күн бұрын
@@cyanhacker It can, but as you see the tchniques here applied are generally guiding the AI a lot and the neural network is small. With techniques that give the AI abilities to look ahead, it could very well surpass and even plan its own route faster than humans. It woudn'T need to have human reqard shaping, insteadyou could employ PPO for optimizing the reward function along a general goal. so props to the author but a fruitfly brain is notgoing to cut it. I would love to see a breakdown of the Neual network used currently and maybe with some added hardware getting that up to speed already beats the challenge
If this doesn't go viral, I'm going to be so sad. The AI just gets so interesting every time. Can't wait for the time that FWO itself will have trouble beating it.
@evoknz
20 күн бұрын
They'll recruit the AI
@daniellima4391
20 күн бұрын
I really doubt they'll recruit AI. Jealous as they are there's no way that they'd welcome someone better than them at the game. I mean, how many years has it been since TAS entered the WR scene and they don't even consider recruiting him to the team? He's been crushing every map he plays and they keep denying him membership
@latergator9622
20 күн бұрын
@@daniellima4391had me in the first half ngl 😂
@xerfrex7869
20 күн бұрын
@@daniellima4391 Fr, my boy TAS was robbed. He does other games too, and it's disgusting how communities ignore him
@cholsreammos
20 күн бұрын
I mean they might like give a version of this an honorary induction to FWO. Perhaps the first version capable of trying its own short cuts
The day trackmania AIs can scout and lab tracks on their own, we're all cooked.
@eightheve
20 күн бұрын
I mean technically it can, it discovered the barrier jump on its own. the issue is that the scoutting and labbing that it does is very very inefficient as it doesn't actually know what its looking for. a human could say "i think this might be faster" and try something new, but a neural net simply doesn't have the capability to do something like that, it can only make small adjustments.
@cholsreammos
20 күн бұрын
Ngl didn't expect you here lol
@anselme198
20 күн бұрын
i mean it would be awesome to use it for mappers to be able to automatically validate and set author times on the maps
@nashoo2968
19 күн бұрын
@@eightheve Yah it can, you could just tell it to go on the path you're trying to use (red line linesight talked about) and see if it works
@aerophile8372
19 күн бұрын
Deep Dip is Doomed
Honestly, a map like Deep Fear seems perfect for an AI. The only scary thing about it is its length. For a human, the problem with Deep Fear is remembering the track, focus, precise input and reaction time. The AI has no issues with any of these things.
@SamuelBoshier
20 күн бұрын
And I think the original commenter must have a misunderstanding about how it works, since they specify "respawnless," because there's no reason a fully trained version would need to respawn, it would just do the right inputs the first time.
@TheSuperappelflap
20 күн бұрын
The AI may have a problem with its context window if the track is very long and has many unique sections.
@TheSuperappelflap
20 күн бұрын
@@SamuelBoshier Its possible some sections are easier to do with the standing respawn, every checkpoint on the map is respawnable and has boosters, doing it segmented like that eliminates some variation. The AI could potentially learn to do it like that instead.
@Swarm_
20 күн бұрын
@@SamuelBoshier You sure it isn't you that has a misunderstanding of how the map works?
@AtotehZ
19 күн бұрын
@@TheSuperappelflap Regarding length I'm referring to the massive amount of computation it requires. Nothing else really.
Trackmania AI youtube videos are the reason why I am so invested into learning Neural networking now. This amazes me. You're amazing. I'm already subscribed, but if I could, I'd subscribe twice.
@Tyrant_2000
17 күн бұрын
You can... Sub #2 = Patreon But there's MORE!... Sub #3 = GoFundMe - Contribute towards PC upgrades. Sub #4 = Secret OnlyFans 🤫- Can't imagine of what 'Content' could possibly be posted here that's Trackmania themed? AI can. 😉 /s
Needless to say the ai work is amazing, but I think this video is brilliant in many other ways. I think you’ve made the cleanest and easiest to understand visualisation of the learning, with the waves of different coloured cars, and the train of WR cars to beat. Fantastic job on both the technical stuff and the video production!!
I feel like such AI can be both a good thing and bad thing for the world recording competition. It showed how some minor improvements can be made in places human players might not think of, but also it might led most people to just blindly copy the AI's approach, like how it went in Go. One of the biggest charm of watching world records run is the creative ways players figured out to gain even the thinest margin. But anyway, this video is such a joy to watch, absolutely great work!
@jewels3846
16 күн бұрын
Honestly, I am interested in how AI can be used in TASing. TASing requires so many human inputs and knowledge of what saves time or at least thought possible so it can be attempted via TAS. The thought of AI being a tool that can be trained to help test theoretically possible shortcuts or how fast something can truly be makes me wonder about how far it can be pushed. Yes AI needs to be trained, and so still requires at least a standard level of the aforementioned knowledge, but still I think it could be a massive tool for TAS's. Especially of AI can be developed for other games where TASing is heavily reliant on human play + savestates due to a lack of other available compatible tools.
@Ezz_Fr
16 күн бұрын
If you think about it AI is basically in the same position as a human, when a human gets a world record everyone tries to copy him, same could go with the AI the difference is that one is human and one is a AI.
@leeleo9615
15 күн бұрын
@@Ezz_Fr That’s definitely true, but there’s a catch: AI can try more times in days than human can in years. When you know that someone plays the game so much more times than you do, I think it’s hard to think that you yourself can even find a better way with the your ‘super inefficient’ approach. After all, it takes too much time and luck for a human player to find, test, and execute an approach to perfection.
@christopherlperezcruz1507
10 күн бұрын
In the world of Chess AI has overtaken human for a long time now. AI vs AI is what generates progress and humans are studying AI tactics to learn new strategies. We are a long way from that in physics based games. Chess is just a discrete decision matrix. The video game genre that could probably be optimized the fastest would be 2D fighting. It's discrete.
I am speechless
@loupphok
20 күн бұрын
@@ExhaustedPenguin I had to deeply think about, it was really hard but I managed to write it
@ShcrTM
20 күн бұрын
hi speechless nice to meet u
@linesight-rl
17 күн бұрын
Damn you for beating Rollin's 56.86 before we released the video!! Also nice run by the way :) I have no idea about the viability of a D06 run with 2 laps intended way + 1 lap cut, what do you think about it?
@loupphok
17 күн бұрын
@@linesight-rl ahah sorry about that :D In my opinion it would give a huge advantage to the AI to do that 3rd lap jump, it clearly doesn t need for the 2nd one but at least, since you have to release otherwise, the last jump is very doable for the AI and would add an extra 1 or 2 seconds to the ai
@mapron1
17 күн бұрын
@@loupphok what do you mean by "doable by AI"? robot always do perfect inputs, yes, but with current approach discovery is questionable. getting 'some' jump is not a problem for AI; problem that human can understand 'oh I see i can make it eventually' while AI punished over and over at mistake and not progressing on discovery. So... in theory AI can discover jump but as DL engineer I feel it will be very unlikely. Especially other 'brother competitors' of current model will finish the map. Discovery of jump only can found by AI if there are no competitor model that progress further IMO. (like with gamma anywhere greater than zero ofc)
Me: would be interesti... Linesight: in the future I could try TAS records
Man, I only watched 10m and I am already amazing of the quality of the video and the quality of the AI. Holy shit, this is the best AI I saw not supported by money. So inspirational!
@elpred0
20 күн бұрын
Man, incredible. GJ
Maybe not something zero shot but more like how we currently use llms Maybe have a model that is trained on a ton of different tracks(base model) and then fine tune it for the one it's currently attempting. This could lead to a large reduction in training time. Possibly even something use something like a Lora adapter so that only a few parameters have to be trained, and the rest can be frozen. This would mean the hardware requirements could be reduced while actually having a larger base model(no gradients and other training parameters in VRAM).
@TheSuperappelflap
20 күн бұрын
Just freeze everything except the last couple layers and then train on the track for a few iterations. This can be done easily in keras or pytorch or whatever hes using.
@mithril_leaf
17 күн бұрын
I was thinking similar thoughts how very inefficient all the Trackmania AI is when they're training from scratch every time they do a new track.
@TheSuperappelflap
17 күн бұрын
@@mithril_leaf well, that is how humans do it as well. People spend hours learning a track trying different lines and grinding. We just start out with more generalized knowledge and then take longer to optimize. A human trying a track ten times will get a better time than an AI without prior knowledge but given enough attempts the AI will do better.
Honestly this is ASTOUNDING! This AI is in a league of its own. The wheel clip for the trial map was simply incredible. Well done!
This was a very nice and interactive watch ! Thanks for sharing and please keep progressing the A.I. :)
The editing is amazing this time around! Crazy improvements
I can't get over how good this video production is mate. Well done!
Well done, that's insane progress. Can't wait to see how good it will get at reading new maps
Amazing job, I loved the editing :D 14:10, and was surprised at the significant gain on D06 with just pure driving skill.
This was awesome, not just the AI, but also really well put together and presented. Having recently started video editing myself, this is so much above what I currently could reasonably do Looking forward to your next video :)
I'm waiting for Rastats' comment 😏
@unbreakablefootage
20 күн бұрын
A hat needs to be eaten
@-_-LouLou1234-_-
20 күн бұрын
But did you show the deep fear completion, for real I haven't seen it
@alansmithee419
20 күн бұрын
@@-_-LouLou1234-_- That was listed as a next step. Not something that has been done. I think Linesight just wants Rastats to respond to the challenge being accepted, but IDK.
@TheOneWhoHasABadName
18 күн бұрын
go forth, linesight. make a man eat a hat
@Rastats
18 күн бұрын
I responded in another comment unreal improvement on the AI !
Best trackmania video I've seen in a long time Amazing job, huge effort and it's so nice to see how far your ai is coming. It's like watching your child learning to ride a bike or something
Loved every second of the video! Great job on the AI and the video editing
This is one of the most interesting, well presented and entertaining videos I've watched on KZread in a long time, and I've never played the game! I have however kept up with a few videos coming out about the game over the last year. What an exciting prospect; bravo!
what a great video. excited for the next installment
Now for the ultimate test: unleash it on Deep Dip!
@poruzu
20 күн бұрын
it currently cant run in TM2020 since it uses TMinterface which is a tool only available in TMNF.
@Whitewingdevil
20 күн бұрын
@@poruzu That's a shame, I'm just picturing a cascade of AI cars falling everywhere
Wow. An unbelievable technical achievement and an absolute joy to watch. Huge congrats!
Can't wait for the next part! Awesome job man! Years of records destroyed in days. Video edits are also top notch! Really enjoyed that.
Since you want to open this to the community, maybe it is worth to look into distributed machine learning: The learning process can be run on multiple machines in parallel and at any time the partial solutions can be sent to some master NN that combines all of them.
You know what would be a cool project. You could set up some code to scrape all the world records for maps and used those records to generate your race lines, and deploy your code to some sort of compute cluster. Then you could have it automatically grind every WR
@Gahanun
19 күн бұрын
Found the Big Tech company alt account.
Amazing improvements since the last videos! And great video again! Bien joué :)
One of the best videos I've ever seen, i was ready to watch the whole campaign in this format
I really appreciate that you know what you're talking about compared to some of the new "ai creators" who are glorified prompt writers... that aren't even really good at prompts
Oh no, ai is even taking over tm now..
great job not only on the A.I. but also on the video, always good to see people put on so much effort, hope this channel keeps growing, can't wait for future videos
Fantastic video and astonishing AI! I didn't think it would get this good this quickly. Having one system capable of learning the different tracks is impressive. I'd love to see a single general model playing next. Im looking forward to the code release 👌
OMG am an IWO memeber too
@linesight-rl
20 күн бұрын
You need to beat a cut WR with the intended way, membership is probably even harder than FWO 😅
Trackmania and computer science are evolving... First there were normal runs, then FWO joined the game and cuts got mainstream, then more and more tricks were found, kacky joined the game... Then everything evolved and now we have TAS, which is not that new, but it really got mainstream in TM too, and now I see AI evolving. I just love it.
Can't wait to see what's in store next for this incredible project. It has truly been a journey and I have a feeling that the next instalment in this great saga will be truly a marvel to behold.
Started watching your videos for the AI, but god damn your editing is also super good!
As impressive as this is, it just kind of takes all the fun of trying to discover new runs and beat records when you can just learn and copy these runs lol
Thank you for working so hard to improve the game and whats (in)humany possible. Incredible job🔥🙏
BRAWO This is so powerfull. Thanks to you and your AI in near future we will see new records because there is some spece to improwment ❤
BIG respect for you making the AI open source (in the future). Thought the whole video till that point about how cool it would be if it was open source
Awesome video! You deserve more subs for how high quality this is. You've got me signed up!
This was both so interesting and so entertaining. Really great work dude
Wow! Thank you for your work. This is so satisfying to watch! Keep 'em coming.
Very nice production quality of the video. And the content is outstanding of course!
Love your videos every time. Absolute bangers.
I appreciate the really well informed video and the inclusion of the crazy stuff people are able to come up with, it's really nice to see someone in AI really proud of the work of people too.
Amazing video. Really enjoyed it, looking forward for the next video.
This was incredibly well made, with so much effort. Thank you for keeping KZread good.
loved the hock run at the end - great vid !
Fascinating video and amazing production quality. Thanks for sharing!
I love programming and AI stuff and you are absolutely smashing this category. You need more subs and views
Awesome content with the right amount of technical depths into AI technology, keep going!
sublime editing, great information and an all around awesome video! I may not know much about trackmania... or AI.. but I still loved this.
The topic AND the editing of this video are crazy !!
Actually insanely good editing, writing and content! Keep it up
i don’t usually comment on youtube but the video was so great, you explained very well and the montage is so clean keep the good work !
Man thanks for doing all this work, i know its for fun only, but it also helps to put capabilities of A.I / Neural Networks / Reinforcement Learning into perspective. I'd love to see a "outtake" Video on some of the struggles you were going through, like with the Punishment being to high for the AI to actually take risks. Keep going, this is gonna be amazing going into the future.
Awesome video! Very interesting subject, keep on this amazing work
The roadmap looks interesting and I'm very looking forward to the deep fear run!
I had a blast watching this video, keep it up
Very interesting video! Well done and well explained! Keep up the good work!
Once again I am super impressed by your work!
Only 5 minutes in and I can already tell this is a great video, almost on the level of Wirtual’s videos which is something the majority of Trackmania content creators struggle to accomplish. Be proud for what you have created and strive to make more content like this❤
this is insane. Really good work !
This is a great video for such a small channel !
This is so incredibly fascinating to watch and see how the AI/training is progressing.
Man, you are the best! This channel is sooo underrated.
Awesome work It’s so cool to see AI play video games like this great work
the video editing and graphics were great!
I was SO waiting for this!
Quite incredible, and quite enjoyable to watch!
This is one of the most impressive AIs I've seen so far. How it manages to find wallbangs and that wall clip on the trial map still baffles me. Nice work!
Man, you are a true talent. First of all your video is so well made, this alone deserves applaus. Then there‘s your skill in programing AI. Im not an expert in this field but in my understanding this need quiet some knowledge to do. I really hope for you that you will use these skills in your career. I hope you all the best and looking forward to see a new update video 😁😁👍🏼
I would love to see the AI try deep dip 😅, love the videos!!! Keep up the good work 💪
What a well made video. Thank you for your work!
It's not just your AI that's getting better. Good Job on the video.
@linesight-rl
20 күн бұрын
Thanks a lot 🙂
Very impressive, keep up the work !
great work and great vid. Keep it up!
This is truly insane. Good job, really. I love how this channel is the perfect blend of Virtual and CodeBullet, but less neurotic and better at engineering.
spectacular AI my friend with some amazing results.
this is mind blowing to me. thanks for your incredible work
can't wait for the next one this is amazing!
Amazing video, thank you for your work!
normally never comment, but i thought u deserved to know that this was amazing to watch. Not just the Ai doing its thing, but also your editing has gotten way better
@linesight-rl
19 күн бұрын
Thanks. I did go a few steps further than the hockolicious video here !
the way this car moves looks crazy. nice work
Great content! Please, keep it coming
I love this type of Videos, Keep it up!
I like the visualisation with the repeated world record cars. It really lets' one see the small and big improvements (and deviations) the A.I. takes.
Damn, you are the first creator I see that manage to build an AI that can beat human across multiple map, this is so cool
Nice video this deserves way more views
What a nice video and impressive AI. Since there is the event going on, let it climb Deep Dip 😉 Also, I would be interested in the path you give the AI to follow, especially on the Minitrial map (and if you think it would be able to plan ahead and find the gap onbits own in the future)
I think i recommended in a previous video breaking the course up into sections, i think i suggested by sector. I'm glad to see something similar help so much.