FastAI learns to play Fall Guys - Undetectable Fall Guys bot.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Cool project, you could train a second network to detect the map and make some kind of mechanism to find out if the network won.

Then let it play and record the footage every time it won/qualified.

Relearn every n (e.g. n=100) successful games and plot how many games it did have to play to reach 100 wins.

You might also train on the past 3 images for one output and see if performance increases, that would be interesting. I probably wouldn't use rnns for speed reasons, but they actually could be decent if you keep the state from the last input.

πŸ‘οΈŽ︎ 65 πŸ‘€οΈŽ︎ u/le_theudas πŸ“…οΈŽ︎ Sep 24 2020 πŸ—«︎ replies

Awesome project! I'm the founder of fastai, the lib used here, and wanted you all to know that if you're interested in learning how to do this too, the software, course, and book are all free as a service to the community, and have no ads:

FYI, the approach shown in this Fall Guys video very closely follows what you learn in lesson 1 of the course (chapter 1 of the book).

πŸ‘οΈŽ︎ 55 πŸ‘€οΈŽ︎ u/jeremyhoward πŸ“…οΈŽ︎ Sep 25 2020 πŸ—«︎ replies

That's a really interesting project! Nice work

πŸ‘οΈŽ︎ 44 πŸ‘€οΈŽ︎ u/StrandhillSurfer πŸ“…οΈŽ︎ Sep 24 2020 πŸ—«︎ replies

It's late so I will clean the code up a bit more tomorrow but here is the GitHub if you want to start messing around!

GitHub

Small programming group Discord

πŸ‘οΈŽ︎ 9 πŸ‘€οΈŽ︎ u/Dwigt-Snooot πŸ“…οΈŽ︎ Sep 25 2020 πŸ—«︎ replies

Really Nice!! Great work!

πŸ‘οΈŽ︎ 7 πŸ‘€οΈŽ︎ u/JoseDLopez πŸ“…οΈŽ︎ Sep 24 2020 πŸ—«︎ replies

Nothing against OP and I think this is well done for the method being used, but to me this points out a lot of what is wrong about AI right now. This method takes a problem that could easily be solved by using some generic vision processing and mostly hard-coded logic, over-simplifies it so that even the best resulting AI model will still not be optimal, runs an inefficient and generic machine learning algorithm that is not particularly suited for this specific task, and results in a block box model that is probably overfit to the exact data it was trained on and cannot be easily tweaked to apply to even very similar problems.

Obviously this project is just for fun, but the same sorts of methods are being used for things like trying to make autonomous vehicles and other things that are actually important. There are some problems that are appropriate for just throwing a ton of data into a grinder and hoping a good model comes out, but these sorts of methods seem to be used for everything these days.

πŸ‘οΈŽ︎ 28 πŸ‘€οΈŽ︎ u/burnmp3s πŸ“…οΈŽ︎ Sep 24 2020 πŸ—«︎ replies

Great work! Much respect! Was a little bit hoping for a reinforcement learning algorithm as well though!

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/tee2k πŸ“…οΈŽ︎ Sep 24 2020 πŸ—«︎ replies

Easy Anti-Cheat is such trash, just week I played a game where every single level this one person just flew instantly to the end and beat the level in 5 secs. It was the most obvious thing ever. If they can't catch something that basic, literally never touching the ground the whole game or beating the map in 1/10 the minimum time it takes, then idk what hope there is for that game.

That being said, Colab and the free training GPU they give you is really awesome!

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/Ph0X πŸ“…οΈŽ︎ Sep 25 2020 πŸ—«︎ replies

Interesting that you used canny for preprocessing. Was it used in the originally trained network as well?

While it worked as a proof of concept (awesome results given the effort), supervised learning as applied here doesn't seem to be a good fit for exploring bugs and cheats. But if semi-supervised or reinforcement learning were successfully applied, it would be a great tool for just regular testing in video game development (which I think is really lacking these days).

πŸ‘οΈŽ︎ 1 πŸ‘€οΈŽ︎ u/ComplexColor πŸ“…οΈŽ︎ Sep 24 2020 πŸ—«︎ replies
Captions
as you probably already know if you clicked on this video this is fall guys and today we're going to exploit this fun wholesome game using artificial intelligence i'm doing this for a couple of reasons one i want to show you how complex the programs you can create free with python and fast ai and also i want to highlight some of the ways that people are getting around anti-cheating engines to help stop it in the future please like and share this video with the creator mediatonic of fall guys and i will share every line of code i have here and help them prevent future hacks like this let's jump right in the plan is simple the first thing we need to do is avoid fall guys new anti-cheating system now all that means basically is we're going to have to make this very human-like and not actually exploit the internal workings of the game itself you've seen sheets like these where they're actually changing the behavior of the game those are going to get banned and flagged very quickly moving forward with this new anti-cheat system our system is going to work off of my own training data of me actually playing the game so it's going to play identically to how a human with one big difference we're going to erase the memories when i mess up or i don't qualify so hopefully it'll be actually better than i am at playing the game so how are we going to get the training data well basically i'm going to have a python script that runs in the background and takes screenshots of the game screen itself like you can see here i'm also going to save the data about what keys i'm pushing now to simplify this i'm going to have my agent always moving forward no matter what so just pedal to the metal during the whole game the only keys i'm going to have it decide between doing are moving left moving right or jumping there is a grab as well and a dive but we're gonna leave that out for now because i think i can qualify without using those buttons at all because we're going to train on the three races doordash gate crash and hit point when we take the screenshot we're also going to save the key so for example in this image here you can see that there's a pendulum that's going to come and sweep players off so here i might be pushing left to get a little closer to the edge and avoid that pendulum so we're going to save the image data as well as the keystroke however this image is pretty complicated for a neural network we're going to simplify it a lot for example the colors don't mean anything to our neural network so we're going to go ahead and wipe those colors out and then as we look at this image the textures and things like that don't really matter to us either for example you can see that the pendulum ball is still two shades of gray so we're going to simplify that image even farther and get just the line now if you look at this image you might think well we went too far we've lost too much data here but i want to point out a couple of things of why this is going to work for us you can see here that we still have the edge of the platform we're standing on and we still have the outline of the pendulum that we're trying to avoid this is giving our network just enough data to make an informed decision so this is the final image that we're going to go with except for resizing we're also going to resize this to be 224 pixels by 224 pixels because that is what the resnet 18 was trained on that we're going to use the type of network we're going to use if you don't take anything from this video at least watch this part where i'm going to show you how you can actually train a network quickly without a four thousand dollar gpu so the first key to our success here is using google colab if you've never used that check out this video in the top right corner where i show you how to set up google collab for free and the most important part about this is we can change our runtime to actually run on a shared gpu this is going to allow us to do calculations a lot faster and things that would take you days or weeks to do on a cpu so we're going to use fast ai in this the first thing that i do is just to upgrade the pandas library which is what fast ai needs then i install fast ai and import drive this is so i can grab my data off of google drive so i've actually loaded all the images that we saved from our last section to google drive and now i'm going to train on that data then here i just mount my google drive here you can see i'm using kind of linux commands here to actually list out all the data that's in my content folder in there i'm going to grab a tarball that i made of all the data and i can decompress all that to actually use this data now here's where the fast ai comes in basically i'm going to point at that directory and then i'm going to load that all into a data loader now the only thing that i'm doing for a labeling function is i'm going to label it the parent directory's name so what that means if you look at the data folder on my hard drive itself you can see that i have all the images separated into folders of what you're supposed to do jump left do nothing or write and then each one is an individual image you can see here this one is jump so what this is doing it's telling the network the answer to the image itself so this image means you should jump this image means you should go right or left so on and so forth then i simply print out the data loader you can see here i have 3400 images and here i just print out a sample batch so this is just showing some loaded in data so you can make sure nothing's going wrong here we're making a sort of important choice we're loading in that data loader from before and we're using a resnet 18 neural network now this network has already been trained to categorize images images that have nothing to do with what we're doing here however it still has learned some things from training on those classification images right it still learned how to pick up pick up edges and features and different things along that so we're gonna use that pre-trained network as a starting point now fast ai has some really cool tools in here like a learning rate finder where you can kind of pick a good learning rate and then down to the bread and butter here we're actually going to train this network down in this section here you can see that i'm using a method called fine tune so essentially it's just going to train the later layers of the network and leave the original layers alone and that's because those original layers are doing simple tasks like finding edges and different things like that that we don't need to retrain it on now the crazy part about this is you can see that i only had 3 000 images so it's only taking me like 20 seconds on each of these on a free cloud gpu that anybody can use this confusion matrix will show you uh what your network is getting wrong here you can see 28 times it guessed jump correctly and five times it guessed it incorrectly and did nothing so you can get a little more data back from your network there as well now what this is all showing us is or what i'm trying to show on this is how little data we need to actually get a functioning neural network now this isn't going to be anything crazy right now we could keep gathering data and make this network as crazy as we wanted but i wanted to show you how quickly we could get up and running so i only trained this network on like eight games of it watching me play ball guys so now let's actually get in and check out the neural network and see how it performs so i'm going to show you something here that might surprise you that i took the time to do one thing you always want to do when you're creating an ai or a bot or whatever it is is you want to have some sort of a baseline to compare it against for example if i wanted to create an ai bot that played fall guys and i ran it a simulation a hundred times with my trained agent that i thought was awesome right and it ended up qualifying 10 percent of the time is that good i have no idea what a baseline gives us is a number to compare it to so what i did here is i ran a completely random agent to see how it performed so i had kind of a baseline to stack it up against basically what i was asking here is if i just randomly if i go forward all the time just like my agent's gonna do and randomly choose to go left right or jump could it ever qualify and i won't make you watch many of these videos i did several tests and they were all horrific i don't know that i ever got past a third through any level but it did confirm to me that a simply random agent is never going to be able to qualify so we can start finding success if we can qualify at least once we will at least know we're on the right path it may not be great it may not be something that we want to show to the world but we at least know we're headed in the right direction i won't make you guys watch any more of this video of the completely random agent he is hilarious so what we have here i filmed my screen and i'm gonna do a cast a little bit later that i filmed myself so you can see that i'm not playing the game or anything like that but what i did was you can see that i've loaded up my learner there in the bottom corner you can see that it loaded up and i had a separate ai for each level depending on what level i was playing so here i'm playing hit parade so i loaded up the hit parade learner and i'm going to run through that right now so this is a fully automated ai that's playing this level you can see that already it's starting to correct itself when it gets a little off the beaten path and it immediately starts turning and going for the door as well hugs the edge just like i kind of do in my play style which makes sense and b lines is straight up the path here now this was actually my first run i'm going to show you a run after that that i recorded myself in my office here while the ai was playing a gate crash here i'm going to load up our gate crash learner i got a learner for each ai i'm swapping them out manually right now just testing out the program a little bit you see this lurk it's loaded in my gate crash learner now i'm going to press one key to start it i'm just going to press b which i've set up start valve for the plank gain gonna play like me i tend to move forward as much as possible not wasting a whole lot of movement so it should kind of do the same thing here [Music] feel it's still having some trouble getting stuck because [Music] we get through here good jump up buddy get over there get up it'll stop the algorithm again right now it's really i've trained on a total of eight games i think is all it's played so it's still learning its way and kind of figuring out its movements right now if we really dug into this and trained on 60 games or something like that you really start to see some really good behaviors happen right now it's still a little sketch this was a fun project i hope you guys enjoyed it as much as i do if you could please subscribe and like this video join our discord if you'd like to chat with me live i'm probably online right now and until next time keep coding
Info
Channel: ClarityCoders
Views: 718,040
Rating: undefined out of 5
Keywords: fastai, fall guys, ai plays fall guys, ai fall guys, python fall guys, fall guys hacks, Fall Guys bot, fastai2, fastai machine learning, fastai pytorch, Fastai marching learning
Id: GS_0ZKzrvk0
Channel Id: undefined
Length: 12min 13sec (733 seconds)
Published: Thu Sep 24 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.