The Story of The Best Trackmania AI Ever Made
Vložit
- čas přidán 1. 06. 2024
- 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. - Věda a technologie
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.
You're probably safe: the AI has trouble with fullspeed maps as evidenced on A01.
But we'll definitely try!
@@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
@@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.
@@vitriha3787 Maybe you could increase the resolution in the middle of the image
@@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
Shots fired fr
😂😂😂😂😂 yes
I believe he'd lost a bet and had to use a swedish car for about month iirc
the disrespect 😂
Absolutely devious
Something tells me Wirtual is not going to try and beat it
He's welcome to try, but the challenge seems even harder than Deep Dip 2 😁
@@linesight-rl would be great to see if the AI could figure out Deep Dip 1.... maybe having height be a reward?
@@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?)
@@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 🤷
@@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.
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!
for now…
😢we’re really approaching the end times istg.
@@boom-jr8vi yeah in a couple months its gonna compete with tas runs so a01 wr will be the warm up lol
Remember that this Ai has a brain of a fruit fly. Nothing compared to the AIs currently out there
@@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)
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
section
It was only 1 map lol
The AI just needed a bit more training on that map
I feel like it won't find speedslides without some human input, and I doubt it could win simply by training more.
@@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?
having a 24/7 stream of ai on random map challenge would be so hype
@@StriderGW2 i would genuinely watch that every single second i could
i second this
AI cannot play different tracks on same neural network 😢
@@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.
They'll recruit the AI
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
@@daniellima4391had me in the first half ngl 😂
@@daniellima4391 Fr, my boy TAS was robbed.
He does other games too, and it's disgusting how communities ignore him
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.
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.
Ngl didn't expect you here lol
i mean it would be awesome to use it for mappers to be able to automatically validate and set author times on the maps
@@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
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.
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.
The AI may have a problem with its context window if the track is very long and has many unique sections.
@@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.
@@SamuelBoshier You sure it isn't you that has a misunderstanding of how the map works?
@@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.
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 am speechless
@@ExhaustedPenguin I had to deeply think about, it was really hard but I managed to write it
hi speechless nice to meet u
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?
@@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
@@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!
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.
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.
@@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.
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.
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!
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).
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.
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.
@@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!
I can't get over how good this video production is mate. Well done!
I'm waiting for Rastats' comment 😏
A hat needs to be eaten
But did you show the deep fear completion, for real I haven't seen it
@@-_-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.
go forth, linesight. make a man eat a hat
I responded in another comment unreal improvement on the AI !
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 :)
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.
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
This was a very nice and interactive watch ! Thanks for sharing and please keep progressing the A.I. :)
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
The editing is amazing this time around! Crazy improvements
3:18 This visualisation of a local vs global minimum for AI training is the best I've ever seen, you should post it as a gif for use in university lectures and other training material
Amazing job, I loved the editing :D 14:10, and was surprised at the significant gain on D06 with just pure driving skill.
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
Well done, that's insane progress. Can't wait to see how good it will get at reading new maps
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 one of the most interesting, well presented and entertaining videos I've watched on CZcams 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!
Now for the ultimate test: unleash it on Deep Dip!
it currently cant run in TM2020 since it uses TMinterface which is a tool only available in TMNF.
@@poruzu That's a shame, I'm just picturing a cascade of AI cars falling everywhere
what a great video. excited for the next installment
Wow. An unbelievable technical achievement and an absolute joy to watch. Huge congrats!
Loved every second of the video! Great job on the AI and the video editing
OMG am an IWO memeber too
You need to beat a cut WR with the intended way, membership is probably even harder than FWO 😅
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
Found the Big Tech company alt account.
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
Thank you for working so hard to improve the game and whats (in)humany possible. Incredible job🔥🙏
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.
Oh no, ai is even taking over tm now..
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.
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❤
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
Visualization is so top-notch. A lot of good world class engineers fail to present their work; but you did amazing. P.S. DL programmer myself.
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
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
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.
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 ❤
Started watching your videos for the AI, but god damn your editing is also super good!
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 improvements since the last videos! And great video again! Bien joué :)
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.
the great thing is this is showing what is humanly possible on these maps - the AI is learning the intended way, and if that is beating some of the cut map world records, then This will open a new era in track optimizations and map world records falling across the whole campaign
Wow! Thank you for your work. This is so satisfying to watch! Keep 'em coming.
Awesome content with the right amount of technical depths into AI technology, keep going!
I think you titled it well in the actual video when you said "The best trackmania AI ever made", I think that would grab someone's attention more than "The Rise of AI in Trackmania". Just a thought :) Great video
I like that suggestion...
I've changed the title, and the thumbnail. Let's see if your idea helps :)
@@linesight-rl Best of luck! ❤️
This was incredibly well made, with so much effort. Thank you for keeping CZcams good.
Good video. I have some suggestion that could improve your AI:
- once you have your general AI, you could use it as a based model and then fine tune it for specific maps. So you can get an optimized model for that track but with less training time needed per track
- to find new path and shortcuts, you could use a deep reinforcement learning that takes curiosity into account (check the paper from 2017 called "Curiosity-driven Exploration by Self-supervised Prediction" for more information). But that aproche may not be compatible with your current AI architecture.
- an other approach to find basic shortcuts (this is pure speculation and may only work with shortcuts that are close to the intended path), it's to keep the reward from the red line only during the beginning of the training, and once the AI gets a good and consistent time remove that reward and only keep the final time as a reward
Very nice production quality of the video. And the content is outstanding of course!
Was just watching the Deep Dip video and thinking "I wonder if the AI guy could handle that map" and suddenly you come around and post a new video.
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 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!
Love your videos every time. Absolute bangers.
Fascinating video and amazing production quality. Thanks for sharing!
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.
sublime editing, great information and an all around awesome video! I may not know much about trackmania... or AI.. but I still loved this.
This was both so interesting and so entertaining. Really great work dude
This is so incredibly fascinating to watch and see how the AI/training is progressing.
I love programming and AI stuff and you are absolutely smashing this category. You need more subs and views
Awesome video! You deserve more subs for how high quality this is. You've got me signed up!
The roadmap looks interesting and I'm very looking forward to the deep fear run!
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
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 !
Holy shit this title is the understatement of the year. Ai beats several world records
Amazing video. Really enjoyed it, looking forward for the next video.
The topic AND the editing of this video are crazy !!
Actually insanely good editing, writing and content! Keep it up
loved the hock run at the end - great vid !
Awesome video! Very interesting subject, keep on this amazing work
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.
Once again I am super impressed by 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
Thanks. I did go a few steps further than the hockolicious video here !
Quite incredible, and quite enjoyable to watch!
Awesome work
It’s so cool to see AI play video games like this great work
this is insane. Really good work !
Great video!
I pretty much only play stadium, so I'm all for the stadium content, but I think it would be pretty cool if the AI got challenged to play on some more environments.
Very curious on how well it would do!
Man, you are the best! This channel is sooo underrated.
Very interesting video! Well done and well explained! Keep up the good work!
This is a great video for such a small channel !
I love the multiple cars method of visualizing how the AI is improving when compared to the humans. It was super cool in the minitrial section
Amazing video, thank you for your work!
the video editing and graphics were great!
I would love to see the AI try deep dip 😅, love the videos!!! Keep up the good work 💪
If I was a player, I'd understand any misgivings someone may have in having an AI come and take records that were fought over for years... but as a long time Trackmania Lurker this is truly amazing and I am so here to see more. This was phenomenal to watch! I can't wait for more!
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 was SO waiting for this!
spectacular AI my friend with some amazing results.