Fighting Bots with Python and Machine Learning

Rebecca Martin

Pycon Ireland 2022

About me!

  • I really like parrots
  • No, I really like parrots
  • Apart from parrots, I really like Python and I play a lot of online games (Ballymena internet permitting)
  • I don't really use Twitter much so
    nowhere to send hate mail :(
  • I do however have a Mastodon however! Send all hate mail here:
    @laches1sm@mastodon.social
  • Add me on League on EUW if you're *really* bored: 100 glascs
  • 2020 happened.... need I say more?
  • Moving back with my parents, I rediscovered old games
  • One of them was League of Legends

Glossary

  • Smurf: a high ranking player who plays in lower ranked games, often for ego reasons
  • Elo: ranking
  • MMR: Match Making Rating - how Riot matches you with other players
  • Smurf Queue: abandon all hope, ye who enter here
  • Inting - short for Intentionally Feeding - you are feeding the enemy kills/gold/experience, making it almost impossible for your team to win the game
  • I made some new friends who also played
  • One of them noted a problem he was having
  • Bots, bots bots

He would like to reassure you all he has his arms by the way

I think firstly it's a lot harder to hit Challenger, the % of Challenger is even smaller than the % of Iron 4 I'm pretty sure, so Iron is much easier to reach purely based on that

 

And secondly it's easier to learn the skillset to consistently lose when everyone is trying to win rather than learn the skillset of trying to win when everyone is trying to win

You're competing vs your own team rather than the enemy team which is realistically much easier''

RATIRL gets flamed in Silver

0:14~0:31

I'm kinda in the League zone... I love stomping Iron players... it's the biggest ego boost in existence! And then you're gonna go on your main account...and you're gonna just stomp because you're in the zone and you think you're unstoppable..."

  • Whatley: "...however it's likely pretty damaging to the lower ranked player experience and the ecosystem as a whole. I think Smurf Queue actually did a good job to counter this issue."
  • Urpog: "People want to buy Iron accounts because they want to feel better than people.... it's very cringe"

How to even spot a bot?

  • They share several characteristics
  • Queue only in the support role
  • Tend to pick champions that can sit back and heal
  • Since we have some common characteristics for these bots...
  • ...that means we can categorise them using ML
  • First things first, getting the data
  • So, what do we need to collect?
  • Summoner name (aka player name)
  • Region the player is in
  • Champions played
  • Their overall winrate
  • Their summoner spells
  • Weird rune choices?
  • Create a CSV with the aforementioned fields....
  • ...and now the fun part
  • aka: Someone who failed their Maths GCSE twice and is not very good at maths tries to understand Machine Learning
  • Looking at what others have done before is always a good starting point!
  • Basic tutorials are also a good starting point, but I don't want to categorise plants for the millionth time, I want to categorise BOTS
  • Looked into folks categorising things like Twitter bots...
  • To train the actual model, I made a CSV of actual confirmed bots
  • I used XGBClassifier's model, part of XGBoost to classify them
  • SKLearn
  • Pandas!
  • How to find them you may ask?
  • op.gg

So, where do we go from here?

  • Or more importantly, what have we learnt?
  • A proper frontend would be nice so more people don't have to suffer through my manky CSV Python creation
  • False positives are a problem, I don't want to 'shame' people for being bad at a videogame
  • Riot suffers from the same problem too
  • Is it even possible to avoid false positives?
  • Riot has a lot more resources at their disposal
  • And Riot has added champ select anonymity
  • I'm a parrot dude

Last but not least, thanks are in order to:

  • No Arm Whatley: https://www.twitch.tv/noarmwhatley
     
  • Urpog: https://www.twitch.tv/urpog
  • The Dev Experience team in Bazaarvoice <3
  • And you! Thanks for coming!

Fighting bots with python and machine learning - Pycon Ireland 2022

By laches1sm

Fighting bots with python and machine learning - Pycon Ireland 2022

  • 363