Elma Lev AI

General discussion about the games and the scene.

Moderator: Moporators

Post Reply
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Elma Lev AI

Post by ribot »

I've been experimenting a bit with AI and tensorflow, and I created this simple bot that classifies levels. The challenge is this: if you give the AI an level, can it tell what designer has made the lev?

At first I tried to include all designers who have made more than 20 battles, but the accuracy of that bot was only 20%. It was around 10x better than chance, but still too low for me to be satsified with it. So I only classifed the levs of those designers that have made the most battles in eol, namely those who made more than 1000 battles out of the last 43 thousand.

The most productive designers were: chris, ramone, divan, reefer, tl and hosp. So the AI can estimate whose of those levels any other level resembles the most, with 70% accuracy. This was quite good result I thought, that there was so much of a pattern among thousands of levels.

Examples
Abula trademark lev:
Image
Probabilities (in other words it's 52% the style of a hosp lev, 38.9% divan lev, etc)
hosp 0.52100295
divan 0.38949144
ramone 0.059302453
tl 0.025936488
chris 0.0021542115

Zweq lev
Image
tl 0.7488377
ramone 0.07706588
hosp 0.06867181
reefer 0.054614637
chris 0.03462214

Markku lev
Image
hosp 0.84586275
ramone 0.054361705
divan 0.04248529
tl 0.041901782
chris 0.015178781

Chris lev
Image
chris 0.40407652
ramone 0.26367325
hosp 0.14755668
reefer 0.07845462
tl 0.062295906

Jappe2 lev
Image
divan 0.3256531
ramone 0.3128114
hosp 0.26134405
chris 0.077579334
tl 0.012356319

Chris lev old style
Image
chris 0.4889992
ramone 0.2368741
divan 0.11239079
reefer 0.105590016
hosp 0.034840234
-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
User avatar
pawq
38mins club
Posts: 6547
Joined: 24 Aug 2008, 19:56
Team: TR
Location: Southampton, UK

Re: Elma Lev AI

Post by pawq »

Wow, this seems sick!!! I'd be really curious to hear how it works in more detail if you orka write, but cool either way =) Are you thinking about using it for some "contest" or sth? For example testing which player has the most characteristic level design (the highest self-correlation), or a challenge for every designer [who wants to participate] to make a level with as high % match to his name as possible, meaning that people would have to try to make a level with exactly their typical style. That would be cool imo, but not sure if works well enough for enough people for that to work?

Also this:
ribot wrote: 23 Mar 2018, 15:08Examples
Abula trademark lev:
Image
chris 0.0021542115
made me laugh hard :D the level has more than 2 polygons -> probability that chris made it is 0.2% :D
User avatar
Xiphias
39mins club
Posts: 4098
Joined: 23 Nov 2004, 23:05

Re: Elma Lev AI

Post by Xiphias »

Very interesting work. Please show a tl level and the predictions! I have a feeling tl's levels are the most consistently following the same patterns. At least during the mega run of levels he was starting few years ago.
Thorze wrote:I just wanted to make a cool topic like Juish have cool topics..
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Elma Lev AI

Post by ribot »

pawq wrote: 23 Mar 2018, 16:18 Wow, this seems sick!!! I'd be really curious to hear how it works in more detail if you orka write, but cool either way =)
I wanted to make a modern AI, using some advanced tools like tensorflow. I also wanted to make something really simple, since I'm only starting out with machine learning. So I thought perhaps the simplest thing I could make is a level classifier.

However it was not that simple that I thought. Usually an AI receives an array of values of the same size, so basically all levels would have to be the same amount of verteces. Then I realized that there is a free open source tool you can use called inception/imagenet which is an already trained AI that can distinguish between different images. Then I can use images of levels instead of level data, and I don't even have to worry about the image size being consistent (though in fact this is an easy problem to solve: you just fill in black pixels instead of empty space in all images that are too small).

Using inception/imagenet I didn't have to write a single line of code, but instead I could learn the experience of machine learning. I had to find a way to get the data of 43k levels, a system to store them on the hard drive, and practical data handling things. After that I got the AI to perform only with 20% accuracy, which seemed useless to me so I left this project.

After that I realized that it's probably difficult to classify based so many designers. What If I only use a few? So then I checked which designers had made the most levels and only these six made more than 1000 in this dataset. Now the accuracy was good enough to share, even if the accuracy would not be accepted by machine learning scientists.


pawq wrote: 23 Mar 2018, 16:18 Are you thinking about using it for some "contest" or sth? For example testing which player has the most characteristic level design (the highest self-correlation), or a challenge for every designer [who wants to participate] to make a level with as high % match to his name as possible, meaning that people would have to try to make a level with exactly their typical style. That would be cool imo, but not sure if works well enough for enough people for that to work?
I didn't think of any way to use this yet. Since it was only a learning exercise I didn't think of putting it into more use. I could of course make a lot of improvements of the model, but maybe it would be more fun to make a different type of AI. Your contest is a very nice idea, and there are probably others too who can come up with interesting ways for how to use this. Though to make the contest more fair it would probably be that anyone can design a tl lev, a ramone lev, a chris lev, and so on, and see who can get the best accuracy. If the bot would be online they could even experiment for a while.


pawq wrote: 23 Mar 2018, 16:18 Also this (...) made me laugh hard :D the level has more than 2 polygons -> probability that chris made it is 0.2% :D
Yes in fact I would also intuitively guess that it would estimate a chris lev. Even in my old level generator I made chris levs that ridiculously simple. However, if you look at the lev it does have a few polygons, and perhaps chris usually make extremely complicated or extremely simple (one polygon) levels, but never anything in between? I do find it interesting that it did guess correctly for both the chris levs (they were chosen by chris and not by myself). For the other levs you cannot measure the accuracy, but only compare similarities.


Xiphias wrote: 23 Mar 2018, 23:55 Very interesting work. Please show a tl level and the predictions! I have a feeling tl's levels are the most consistently following the same patterns. At least during the mega run of levels he was starting few years ago.
I can check this later when I'm back home. I'm at gf's place now )
-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
User avatar
kuchitsu
Kuski
Posts: 1423
Joined: 13 Aug 2010, 20:31

Re: Elma Lev AI

Post by kuchitsu »

How does it work with collab levs? Are there any e.g. Hosp+Ramone levs that we can test?
User avatar
Hosp
38mins club
Posts: 2105
Joined: 30 Aug 2009, 20:55
Team: MiE
Location: up yours
Contact:

Re: Elma Lev AI

Post by Hosp »

THC102.lev
both of these are like 2009 or 2010 wasn't really good at making stuff, I made some basic levs and Ramone took second look then I took final look
(3.51 KiB) Downloaded 188 times
THC104.lev
(7.14 KiB) Downloaded 172 times
Image
ToMaT
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Elma Lev AI

Post by ribot »

I took a tl lev and it got it right:
Image

tl 0.41473073
chris 0.31199294
hosp 0.16288896
ramone 0.09790392
reefer 0.009217833


kuchitsu wrote: 24 Mar 2018, 17:09 How does it work with collab levs? Are there any e.g. Hosp+Ramone levs that we can test?
It only takes regard to those designers I mentioned. Even though Hosp and Ramone are included, the AI has no concept of any such combination. It will just say the probability of being any single one of the designers.

Hosp, you will have to give me eol links if you want me to test.
-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
Dorknoob
Kuski
Posts: 39
Joined: 22 Jan 2021, 06:23

Re: Elma Lev AI

Post by Dorknoob »

At first I had another topic that was kind of different, but now perhaps they have become somewhat similar (as this topic gave me some idea)

viewtopic.php?f=1&t=10139&p=269980#p269980
Post Reply