I Trained an AI for 2 Years on Trackmania. It's Breaking Records.
Ғылым және технология
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/Linesight-RL/lines...
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 300
You did not trained AI. AI does not exist, stop using words you do not understand. People will start to think YOU do not have "I".
@blai8
3 күн бұрын
Not the pin of shame lmao
@NinjaOfLU
3 күн бұрын
The pin of shame always gives me a chuckle. You love to see it!
@AnymMusic
3 күн бұрын
realistically we're talking semantics
@CaptainXJ
3 күн бұрын
I mean they are right, AI doesn't exist.
@freakydeaky1435
3 күн бұрын
@@AnymMusic please, its 2024, say sepersontics
Putting Wirtual in the video with a swedish car is wild
@SAPANNow
Ай бұрын
Shots fired fr
@tiquitita2001
Ай бұрын
😂😂😂😂😂 yes
@satansbarman
Ай бұрын
I believe he'd lost a bet and had to use a swedish car for about month iirc
@MackAttack101
Ай бұрын
the disrespect 😂
@THICCTHICCTHICC
Ай бұрын
Absolutely devious
Something tells me Wirtual is not going to try and beat it
@linesight-rl
Ай бұрын
He's welcome to try, but the challenge seems even harder than Deep Dip 2 😁
@rasol136
Ай бұрын
@@linesight-rl would be great to see if the AI could figure out Deep Dip 1.... maybe having height be a reward?
@RubyPiec
Ай бұрын
@@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
Ай бұрын
@@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 🤷
@camoflasche
Ай бұрын
The AI does not work for tm 2020 tho@@rasol136
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..
Ай бұрын
yeah that was such a good way of visualizing WR times.
@brianhecimovich4488
7 күн бұрын
It was like a 3D racing line… never thought of something like that before
@flwi
2 күн бұрын
Agree, very interesting way of visualizing it. Would be cool if racing games had that.
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
Ай бұрын
You're probably safe: the AI has trouble with fullspeed maps as evidenced on A01. But we'll definitely try!
@tylercorrin1615
Ай бұрын
@@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
Ай бұрын
@@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
Ай бұрын
@@vitriha3787 Maybe you could increase the resolution in the middle of the image
@Murzac
Ай бұрын
@@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.
i love how humans still beat it on a01, truly shows how insane the a01 wr is!
@boom-jr8vi
Ай бұрын
for now… 😢we’re really approaching the end times istg.
@poruzu
Ай бұрын
@@boom-jr8vi yeah in a couple months its gonna compete with tas runs so a01 wr will be the warm up lol
@tom_skip3523
Ай бұрын
Remember that this Ai has a brain of a fruit fly. Nothing compared to the AIs currently out there
@poruzu
Ай бұрын
@@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
Ай бұрын
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
Ай бұрын
section
@lolcat69
Ай бұрын
It was only 1 map lol
@R4MMU5
Ай бұрын
The AI just needed a bit more training on that map
@lukeskyguy2238
Ай бұрын
I feel like it won't find speedslides without some human input, and I doubt it could win simply by training more.
@R4MMU5
Ай бұрын
@@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
Ай бұрын
having a 24/7 stream of ai on random map challenge would be so hype
@poruzu
Ай бұрын
@@StriderGW2 i would genuinely watch that every single second i could
@HK_BLAU
Ай бұрын
i second this
@cyanhacker
Ай бұрын
AI cannot play different tracks on same neural network 😢
@Krarilotus
Ай бұрын
@@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
Ай бұрын
They'll recruit the AI
@daniellima4391
Ай бұрын
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
Ай бұрын
@@daniellima4391had me in the first half ngl 😂
@xerfrex7869
Ай бұрын
@@daniellima4391 Fr, my boy TAS was robbed. He does other games too, and it's disgusting how communities ignore him
@cholsreammos
Ай бұрын
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
Ай бұрын
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
Ай бұрын
Ngl didn't expect you here lol
@anselme198
Ай бұрын
i mean it would be awesome to use it for mappers to be able to automatically validate and set author times on the maps
@nashh600
Ай бұрын
@@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
Ай бұрын
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
Ай бұрын
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
Ай бұрын
The AI may have a problem with its context window if the track is very long and has many unique sections.
@TheSuperappelflap
Ай бұрын
@@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_
Ай бұрын
@@SamuelBoshier You sure it isn't you that has a misunderstanding of how the map works?
@AtotehZ
Ай бұрын
@@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
Ай бұрын
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
@pahom2
9 күн бұрын
Well. Its more like a genetic algorithm approach than a neural network application
@Picodoux.
9 күн бұрын
@@pahom2 :-B well akshually
I am speechless
@loupphok
Ай бұрын
@@ExhaustedPenguin I had to deeply think about, it was really hard but I managed to write it
@ShcrTM
Ай бұрын
hi speechless nice to meet u
@linesight-rl
Ай бұрын
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
Ай бұрын
@@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
Ай бұрын
@@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)
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
Ай бұрын
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
Ай бұрын
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
Ай бұрын
@@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
Ай бұрын
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.
@Starwisp7193
Ай бұрын
It's also going to be incredibly cathartic to beat the AI
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!!
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
Ай бұрын
Man, incredible. GJ
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!
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
Ай бұрын
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
Ай бұрын
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
Ай бұрын
@@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.
I can't get over how good this video production is mate. Well done!
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 :)
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'm waiting for Rastats' comment 😏
@unbreakablefootage
Ай бұрын
A hat needs to be eaten
@-_-LouLou1234-_-
Ай бұрын
But did you show the deep fear completion, for real I haven't seen it
@alansmithee419
Ай бұрын
@@-_-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
Ай бұрын
go forth, linesight. make a man eat a hat
@Rastats
Ай бұрын
I responded in another comment unreal improvement on the AI !
Well done, that's insane progress. Can't wait to see how good it will get at reading new maps
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
Amazing job, I loved the editing :D 14:10, and was surprised at the significant gain on D06 with just pure driving skill.
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!
Loved every second of the video! Great job on the AI and the video editing
what a great video. excited for the next installment
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.
Wow. An unbelievable technical achievement and an absolute joy to watch. Huge congrats!
Amazing improvements since the last videos! And great video again! Bien joué :)
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
Now for the ultimate test: unleash it on Deep Dip!
@poruzu
Ай бұрын
it currently cant run in TM2020 since it uses TMinterface which is a tool only available in TMNF.
@Whitewingdevil
Ай бұрын
@@poruzu That's a shame, I'm just picturing a cascade of AI cars falling everywhere
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
Thank you for working so hard to improve the game and whats (in)humany possible. Incredible job🔥🙏
As a developer, this video has me worried about my job security. You probably think I'm referring to AI taking my job, but no. I'm talking about people like Agade and pb4 massively raising the programming bar! I feel pretty bad putting my dopey little pet projects on a resume after watching stuff like this!
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.
Congrats on the awesome work! I follow your work as a fan of racing games and gamedev. So proud of the results, and to hear you are wanting to open source the code to get help from the community is just even more respectable!! THANKS!
Wow! Thank you for your work. This is so satisfying to watch! Keep 'em coming.
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
Ай бұрын
Found the Big Tech company alt account.
OMG am an IWO memeber too
@linesight-rl
Ай бұрын
You need to beat a cut WR with the intended way, membership is probably even harder than FWO 😅
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
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.
Oh no, ai is even taking over tm now..
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
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 👌
One of the best videos I've ever seen, i was ready to watch the whole campaign in this format
Awesome content with the right amount of technical depths into AI technology, keep going!
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.
Love your videos every time. Absolute bangers.
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 ❤
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.
Started watching your videos for the AI, but god damn your editing is also super good!
This was both so interesting and so entertaining. Really great work dude
This was incredibly well made, with so much effort. Thank you for keeping KZread good.
Fascinating video and amazing production quality. Thanks for sharing!
Very nice production quality of the video. And the content is outstanding of course!
Awesome video! Very interesting subject, keep on this amazing 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❤
sublime editing, great information and an all around awesome video! I may not know much about trackmania... or AI.. but I still loved this.
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! You deserve more subs for how high quality this is. You've got me signed up!
loved the hock run at the end - great vid !
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!
Quite incredible, and quite enjoyable to watch!
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 !
Amazing video. Really enjoyed it, looking forward for the next video.
I had a blast watching this video, keep it up
The topic AND the editing of this video are crazy !!
I was SO waiting for this!
Really excited for your progress. Keep it up mate.
This is so incredibly fascinating to watch and see how the AI/training is progressing.
Once again I am super impressed by your work!
Very interesting video! Well done and well explained! Keep up the good 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 😁😁👍🏼
this is insane. Really good work !
The roadmap looks interesting and I'm very looking forward to the deep fear run!
Awesome work It’s so cool to see AI play video games like this great work
I love programming and AI stuff and you are absolutely smashing this category. You need more subs and views
Actually insanely good editing, writing and content! Keep it up
What a well made video. Thank you for your work!
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.
Amazing video, thank you for your work!
Very impressive, keep up the work !
can't wait for the next one this is amazing!
Man, you are the best! This channel is sooo underrated.
This is a great video for such a small channel !
I would love to see the AI try deep dip 😅, love the videos!!! Keep up the good work 💪
Please give us academics among your viewers a deep dive into the tye technical details. This is mind blowing cool and would love to know how you solved many of the problems
this is mind blowing to me. thanks for your incredible work
the video editing and graphics were great!
This is super cool! Thanks for sharing.
great work and great vid. Keep it up!
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
this is seriously crazy, it seems your ai is progressing so exponentially I bet in a few years from now it will get wr runs in only a few attempts
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
Ай бұрын
Thanks. I did go a few steps further than the hockolicious video here !
Great content! Please, keep it coming
Great Story telling Great Showcase Great Idea -> I want more of this !!