Should I Release the AI Player`?

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:

Should I Release the AI Player`?

Post by ribot »

Is there really an AI player?
yes, made by me 2 years ago

Is it good?
no

Is it real AI?
yes (no, only machine learning), neural network

Does it play with any intelligence/skill?
yes, but see quesiton 2

So why should I release it? Could be fun to see what kind of intelligence it develops and how it evolves. There could also be visuals and discussions of problems of making a good ai.
Last edited by ribot on 29 Apr 2020, 17:19, edited 6 times in total.
-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
User avatar
A.K.B.
37mins club
Posts: 4122
Joined: 10 Dec 2005, 11:12
Location: Brisbane
Contact:

Re: Should I Release the AI Player`?

Post by A.K.B. »

ribot please respond to my rpg coment

also ask jon if AI-cycle is okeallowed
Image
1 Golden Apple Award: Rookie of the Year
FinMan wrote:I prefer AKB:s topics to Xratios ones :)
User avatar
kuchitsu
Kuski
Posts: 1423
Joined: 13 Aug 2010, 20:31

Re: Should I Release the AI Player`?

Post by kuchitsu »

Go for it man! And don't beg for 10 likes or whatever, that feels a bit attention whorish. Just do it!

Btw Stini (?) is also working on something similar, not sure if he released the code but I've seen some recs and they were really fascinating.

edit: oh, or are you asking because some people might be against the idea? in that case sorry for the whore remark.
User avatar
AndrY
38mins club
Posts: 718
Joined: 14 Dec 2015, 17:41
Team: .lev
Location: Perm, Russia
Contact:

Re: Should I Release the AI Player`?

Post by AndrY »

make a poll with some 5 suspected ppl and we will guess:)
Image
My levs and other Elma things: sites.google.com/view/elma-andry + youtube
User avatar
pawq
38mins club
Posts: 6547
Joined: 24 Aug 2008, 19:56
Team: TR
Location: Southampton, UK

Re: Should I Release the AI Player`?

Post by pawq »

I think this might be better discussed than voted, do you think there's any potential risk ribot? Could it be better to release some offline recs like Stini has done first, before letting it battle, if it's good enough?

One thing for sure: it should be clearly labelled as a bot/ai in its nick, so it's obvious to everyone.

Pretty exciting that there's another one developed in the community tho! Soon elma AI league :D
User avatar
ArZeNiK
37mins club
Posts: 883
Joined: 30 Jul 2016, 09:18

Re: Should I Release the AI Player`?

Post by ArZeNiK »

if it is irreproducible for online use making it seem like a normal player (no matter if superior or not), then yes please release it i am very much interested
hi im arzenik :>
elmzuke.lev is the greatest piece of art ever created
Image
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Should I Release the AI Player`?

Post by ribot »

AKB: I can't remember anything about RPG now, and ai player won't work on other elma version because it controls bike thru reverse engineering of eol.exe
Kuchi: the reason I ask for interest is because it's quite a lot of work to make this release, and without any attention why should i put in the efforts`?
AndrY: I would make poll in here it if were possible
pawq: there could potentially be risk if i release code, but I doubt my code is anything of use to someone with skills like that

Everyone:
Just so you know there is nothing fascinating about this. It's a very simple machine learning bot that becomes better by itself. But it would not beat the worst noob in battle, even after many hours of training that level. Or at least me with awful elma skills will beat the bot at first try.

To me it was still exciting to see how it would play in the beginning and how it would learn.

The bot doesn't use volt keys, as I gave up before it could learn to play with those. However, it does look like it has some real elma styles.
-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
User avatar
jonsykkel
Kuski
Posts: 982
Joined: 24 Nov 2009, 20:53
Contact:

Re: Should I Release the AI Player`?

Post by jonsykkel »

release it, awsj needs someone to compete against in balles
status:ONLINE - - -  drinking:GOFE - - - iq:85 - - - elasto mania ranking:#1
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Should I Release the AI Player`?

Post by ribot »

When I wrote this topic I didn't know there was Stini's AI. I don't think there's any point releasing it.
Last edited by ribot on 29 Apr 2020, 17:20, edited 4 times in total.
-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Should I Release the AI Player`?

Post by ribot »

Anyway, no one has protested that I release the code.
-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
mena
39mins club
Posts: 40
Joined: 13 Aug 2011, 00:31

Re: Should I Release the AI Player`?

Post by mena »

I also made an AI player but she is stupid, can't finish int01. We could make an AI WR table maybe.
Image
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Should I Release the AI Player`?

Post by ribot »

I think mine could finish warm up.

I guess the main difference from mine and Stini's would be that mine was playing elma in real time, so you can imagine what a waste of computer power I have done. And that his was actually impressive.

Now this topic can be delete.
-
"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: Should I Release the AI Player`?

Post by pawq »

That someone else made something more impressive doesn't mean that your stuff is worthless =) Would still be fun to see!
User avatar
ArZeNiK
37mins club
Posts: 883
Joined: 30 Jul 2016, 09:18

Re: Should I Release the AI Player`?

Post by ArZeNiK »

please dont compare yourself to other people, creating an ai that can play elma is already a feat by itself no matter how advanced it is.
go for release imo!
hi im arzenik :>
elmzuke.lev is the greatest piece of art ever created
Image
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Should I Release the AI Player`?

Post by ribot »

-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Should I Release the AI Player`?

Post by ribot »

I made new AI that could finish 01-04. You can see quite clearly that it's a computer that is playing.

01: https://elma.online/r/grkqqpyjec
02: https://elma.online/r/7y7ei8mchw (better time only using gas)
02: https://elma.online/r/890bah8ldx
03: https://elma.online/r/goqsm9db2e
04: https://elma.online/r/gqhuj6dk77

and pipe: https://elma.online/r/eokowdyohc (episodes: 1730, time: 4.59 seconds, elmatime: 5972.76 seconds; inception speed 1299X)
Last edited by ribot on 11 Jun 2020, 21:15, edited 2 times in total.
-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
User avatar
ArZeNiK
37mins club
Posts: 883
Joined: 30 Jul 2016, 09:18

Re: Should I Release the AI Player`?

Post by ArZeNiK »

looks decent, actually
hi im arzenik :>
elmzuke.lev is the greatest piece of art ever created
Image
User avatar
ROKKEBOL
Kuski
Posts: 376
Joined: 30 Jan 2011, 08:02
Team: BAP
Location: asdf
Contact:

Re: Should I Release the AI Player`?

Post by ROKKEBOL »

Very good recs imo! 1-3 playing like a real human nab player, but stronger, no panic volts osv.
4th rec is quite pro for a nab, resolute moves at killers and everywhere.
5th rec showing uphilling skills, also noticed wheelpoo and cool end.
Me - like the AI Player :D
Image

Image
User avatar
iCS
Kuski
Posts: 352
Joined: 31 Dec 2015, 11:36
Location: Hungary
Contact:

Re: Should I Release the AI Player`?

Post by iCS »

Impressive and amusing replays. Good to see such complex moves and routes.
User avatar
kuchitsu
Kuski
Posts: 1423
Joined: 13 Aug 2010, 20:31

Re: Should I Release the AI Player`?

Post by kuchitsu »

This is super fascinating! The pipe rec is sick. I have a question: does your AI essentially learn each level "from scratch", or can it gain knowledge from one level and then use it in another level?
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Should I Release the AI Player`?

Post by ribot »

Thanks for your feedback!

Kukitsu: it learns from scratch
-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
User avatar
Xiphias
39mins club
Posts: 4098
Joined: 23 Nov 2004, 23:05

Re: Should I Release the AI Player`?

Post by Xiphias »

Wow that is insane :) Great work Ribot!
Will your AI player play online some day? :) Is that possible (if we ignore eol anti-cheat rules)?
Thorze wrote:I just wanted to make a cool topic like Juish have cool topics..
User avatar
kuchitsu
Kuski
Posts: 1423
Joined: 13 Aug 2010, 20:31

Re: Should I Release the AI Player`?

Post by kuchitsu »

What happens if you give it an auto level? Can it eventually realize that the best tactic is to not press anything?
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Should I Release the AI Player`?

Post by ribot »

Xiphias wrote: 12 Jun 2020, 15:49 Wow that is insane :) Great work Ribot!
Will your AI player play online some day? :) Is that possible (if we ignore eol anti-cheat rules)?
It's possible. So far it didn't perform very well but it could be fun some way.
kuchitsu wrote: 12 Jun 2020, 17:42 What happens if you give it an auto level? Can it eventually realize that the best tactic is to not press anything?
TL;DR
It would just play randomly getting closer and closer to the flower until it finds a way to finish. After that it will make some improvements but it will still suck as hell, unless the level is extremely simple. I don't think the best way to finish auto levels is to do nothing, but if that would truly be the best way to finish (meaning getting the best time) the AI could find that out depending on the level and scoring system. In my case I don't think it would do nothing becasue some random stuff would not cause a worse time so the AI would never realize it can do nothing.

The AI did beat me on one level but it did not beat the best players. On this battle https://elma.online/battles/152353 pressing only gas, the AI could beat me getting 7.62 in no time at all. I would say perhaps faster than Spef, but then it wouldn't improve to anything better than 7.60. It could get 7.44 pressing all keys. One way to estimate the simplicity of the level is that random play at this level pressing only gas resulted in 7.77 (where I thought i had implemented an AI that contained a fatal bug).

Explanation:
From the way I see it (I'm really a nab at machine learning). First of all the quality of performance is dependent on the accuracy of a score system. Every attempt to play a level (episode) will give a score, and the AI will try to get the highest score possible.

A simple scoring system is to measure the distance from the bike to the flower: The shorter the distance, the higher the score. And then a bonus for finishing the level, and a higher bonus for a better time. This is enough for teaching the AI to finish some levels and make some improvements.

But how far can it go? How well can it perform?
Well, easy levels like internals 1-4 have big scopes of allowing non-fatal mistakes. In other words you can finish those levels in endless ways, even if you make mistakes. So you don't need to find a difficult and accurate combination of moves.

Now the AI tries things randomly. So the probability of it making some insane and accurate combinations is perhaps feasible, but would the score system be accurate enough to tell the AI that it did good? For this to be true the scoring system would have to take into account that a bad ride with a very good part is better than a descent ride. Things like punishment for death and distance from flower are no longer enough. The distance from flower has to be upgraded to take into account all parts of the kuski that can touch the flower.

I simply could not come up with a good enough scoring system to make the AI get good rides.
-
"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: Should I Release the AI Player`?

Post by pawq »

Sick stuff! That last killer dodge in twin peaks is dope, especially with no brake :D And sik piping skiallz!
User avatar
Bludek
38mins club
Posts: 1725
Joined: 23 Sep 2009, 10:56
Team: CART
Location: Some pub in Prague

Re: Should I Release the AI Player`?

Post by Bludek »

I was wondering, if machine learning could be useful in SL.

Maybe human can drive the parts that are hard to learn for AI and AI can brute force some stuff like killer dodging in int39 Haircut wr-style or idk.

AI so far seems to have very few advantages over human (maybe turning in rapid succession and killer dodging?), but they might be not negligible.

Is it possible to even use AI in SL? Does AI really have any advantages over mans or am I just making stuff up?
Image
EOL top 10 kuski of 2014 and 2015.
21:03:48 <umiz> i like 99% of bludek levels
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Should I Release the AI Player`?

Post by ribot »

First of all it depends if you mean my Ai or a state of the art Ai of 2020 (or say 2030). It's possible we will see the day when AI can beat all wrs.

I guess it could be used with saveload, but I'm not familiar with those file formats.

Maybe the current AI's do have an advantage in piping. In piping it's not so important what you did earlier, compared to a brutal volt where you have to do some different moves in combination for it to work. Maybe only straight pipes, but perhaps difficult ones. For example driving a stilt bike (modded) is super hard, yet AI made the pipe using it:
https://elma.online/r/drnj90fzlp

A combination with human players is possible and I think the most realistic approach until a lot of AI progress is made. An AI could brute force a small part of the level if there is some logical way to tell which ride is better than the other. Things like taking the apple or not dying might work, but as I said earlier I couldn't find a very good way to do this in general. Another approach is to create a training lev where the player will for sure die unless doing something really good.

I see possibilities but not that easy to implement.
-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
User avatar
gimp
Kuski
Posts: 1140
Joined: 28 May 2007, 08:47

Re: Should I Release the AI Player`?

Post by gimp »

The over and under rec does appear to have some inhuman element to it. Like it is doing tons of turns to try and maximize some formula, doing flips in odd spots also to land on wheels that i dont think a human would do intuitively. Was interesting, wondering if it has potential to beat humans.
God Bless America
ofta
Kuski
Posts: 88
Joined: 5 Dec 2013, 19:46

Re: Should I Release the AI Player`?

Post by ofta »

nice ai, i got an idea is it poss to tell the ai to keep the head as close to the ground as possible while still collecting aples and flower? that way it mb stops doing those 360 volts and perform better?
User avatar
Xiphias
39mins club
Posts: 4098
Joined: 23 Nov 2004, 23:05

Re: Should I Release the AI Player`?

Post by Xiphias »

I think the AI has great potential to be used in conjunction with auto generated levels to check if they are finishable.
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: Should I Release the AI Player`?

Post by ribot »

gimp wrote: 1 Jul 2020, 23:53 The over and under rec does appear to have some inhuman element to it. Like it is doing tons of turns to try and maximize some formula, doing flips in odd spots also to land on wheels that i dont think a human would do intuitively. Was interesting, wondering if it has potential to beat humans.
All the recs are pretty much playing randomly until being able to finish. So those moves were better than the prior, according to its previous experience.
ofta wrote: 2 Jul 2020, 01:21 nice ai, i got an idea is it poss to tell the ai to keep the head as close to the ground as possible while still collecting aples and flower? that way it mb stops doing those 360 volts and perform better?
This line of thinking is how you progress. You get an idea, implement, and watch the outcome. However, imo, as close to ground as possible means volt to death very soon. There could be a reward for being closer to ground, but I don't think it makes sense generally. You still have to balance everything beneficial with the reward of coming closer to flower, and yet not punish enough to make the kuski just freeze in fear of doing something wrong.
Xiphias wrote: 2 Jul 2020, 10:58 I think the AI has great potential to be used in conjunction with auto generated levels to check if they are finishable.
Uhm well... if the level is super easy. It can test things out, and learn very fast when I modded the bike. There's quite a difference in seeing its skill from the default bike compared to a bike that you're completely noob with.
-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
User avatar
Xiphias
39mins club
Posts: 4098
Joined: 23 Nov 2004, 23:05

Re: Should I Release the AI Player`?

Post by Xiphias »

ribot wrote: 2 Jul 2020, 11:25
Xiphias wrote: 2 Jul 2020, 10:58 I think the AI has great potential to be used in conjunction with auto generated levels to check if they are finishable.
Uhm well... if the level is super easy. It can test things out, and learn very fast when I modded the bike. There's quite a difference in seeing its skill from the default bike compared to a bike that you're completely noob with.
Does your AI play in real time? If so, could you use a modded elma.exe where time runs faster? I remember the MotoCoin project where you had to play an elma-clone to finish levels to generate hashes for the coins. In that project someone made a bot that would finish almost instantly (but real world time of run was 5-20 seconds I think) since they could just increase the time-clock speed by 100x-1000x or more.
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: Should I Release the AI Player`?

Post by ribot »

My fastest algorithm runs around 1500x faster than in realtime. Also my computers are like 10 years old.
-
"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: Should I Release the AI Player`?

Post by kuchitsu »

I guess ideally you would want to modify the exe so that it doesn't actually render anything, which should save quite a bit of processing power. Unless you're already doing that. :)
Dorknoob
Kuski
Posts: 39
Joined: 22 Jan 2021, 06:23

Re: Should I Release the AI Player`?

Post by Dorknoob »

So, going to release? I think ai could be interesting for the future of elma.

Does it seem possible to enumerate orders for taking apples then use last apple times to influence the score? Well, wouldn't play too friendly on pipes with many apples and only one way to take them. Also might make the ai worse at levels with no apples or do some very funny things when many apples are close together. Would be funny if anything to see it take the most retarded route and think it's the best. Not sure what the solution is here. Seems that to find best possible style it has to actually ignore apples but to drive faster on average, maybe apple times could help.
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Should I Release the AI Player`?

Post by ribot »

Dorknoob wrote: 28 Aug 2021, 01:44 So, going to release? I think ai could be interesting for the future of elma.

Does it seem possible to enumerate orders for taking apples then use last apple times to influence the score? Well, wouldn't play too friendly on pipes with many apples and only one way to take them. Also might make the ai worse at levels with no apples or do some very funny things when many apples are close together. Would be funny if anything to see it take the most retarded route and think it's the best. Not sure what the solution is here. Seems that to find best possible style it has to actually ignore apples but to drive faster on average, maybe apple times could help.
I don't think I'm going to release. There is too little interest.

Not sure how you mean about enumerating orders of apples. But if you base the score on last apple time you can't be sure that it will result in a good run. The scoring system is actually really difficult, because the moves in elma are super complicated. Stini suggested there could be inverse reinforcement learning, which basically means that the AI learns what to reward and what to punish by machine learning.

Having the AI learn apple order should be a possibility, but it would take a lot of resources. It requires both skill in AI making and a lot of computing power. In my case I just wanted to see how the AI would learn and behave, but I preprogrammed what apples it should take. By chance it could learn some simple tricks to go faster, but a trick like brutal volt is like hundreds of frames, and each frame should have the correct keypresses, which makes it way more complicated than something like a tekken combo. I don't see how it would ever learn that by chance, in the same ride where all other moves would also create a good time.

Then there is also the question of whether to make a general AI player, or that the AI just learns for a specific level. In my AI, and Stini's too I would think, the AI learned from scratch for each level.

In the future there will probably come more and more tools, so a really good AI player might come some day. But I think it would have to learn from all saved replays in existence.
-
"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: Should I Release the AI Player`?

Post by Dorknoob »

ribot wrote: 31 Aug 2021, 16:46
Dorknoob wrote: 28 Aug 2021, 01:44 So, going to release? I think ai could be interesting for the future of elma.

Does it seem possible to enumerate orders for taking apples then use last apple times to influence the score? Well, wouldn't play too friendly on pipes with many apples and only one way to take them. Also might make the ai worse at levels with no apples or do some very funny things when many apples are close together. Would be funny if anything to see it take the most retarded route and think it's the best. Not sure what the solution is here. Seems that to find best possible style it has to actually ignore apples but to drive faster on average, maybe apple times could help.
I don't think I'm going to release. There is too little interest.

Not sure how you mean about enumerating orders of apples. But if you base the score on last apple time you can't be sure that it will result in a good run. The scoring system is actually really difficult, because the moves in elma are super complicated. Stini suggested there could be inverse reinforcement learning, which basically means that the AI learns what to reward and what to punish by machine learning.

Having the AI learn apple order should be a possibility, but it would take a lot of resources. It requires both skill in AI making and a lot of computing power. In my case I just wanted to see how the AI would learn and behave, but I preprogrammed what apples it should take. By chance it could learn some simple tricks to go faster, but a trick like brutal volt is like hundreds of frames, and each frame should have the correct keypresses, which makes it way more complicated than something like a tekken combo. I don't see how it would ever learn that by chance, in the same ride where all other moves would also create a good time.

Then there is also the question of whether to make a general AI player, or that the AI just learns for a specific level. In my AI, and Stini's too I would think, the AI learned from scratch for each level.

In the future there will probably come more and more tools, so a really good AI player might come some day. But I think it would have to learn from all saved replays in existence.
I just mean have the AI be aware of possible apple orders, then use apple times to influence score. I have very little experience in AI anyways.

Is it possible to release the scaffolding so to speak that you used for the AI without any of the AI itself? As a web developer... i'd be hopeless at hacking the game to run a physics simulation at faster than real time and responding to my computer generated input.

I'd love to play around with an AI that learns on all levels but maybe this is super ambitious task. I wonder what's easier, a self driving car, or AI that can easily beat any WR in the game. I really don't know but my intuition says that elma AI is not so simple.
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Should I Release the AI Player`?

Post by ribot »

Well other than the ai itself there is the physics engine that can run as a function that on my 10 years old gaming computer 1000x faster than real time.

There are also some instructions for running the ai in real time, as well as a frame-by-frame save-load function. Those are some tools that I made for fun, but not really part of the ai scaffolding.

The physics is publicly available for rust, as seen in some old post. I won't release any other physics to respect this legacy.

I can also mention that I don't have any previous experience with ai than this. I did take some online courses to get an idea but in the end I just used street smarts to solve the problem.

In other words it's logical thinking other than implementing the advanced math. So as a programmer I'm sure you could figure it out.

Edit:
Dorknoob wrote: 1 Sep 2021, 22:00 I'd love to play around with an AI that learns on all levels but maybe this is super ambitious task. I wonder what's easier, a self driving car, or AI that can easily beat any WR in the game. I really don't know but my intuition says that elma AI is not so simple.
I'm really not the person to answer this but I'll share my thoughts anyway. First of all you have to be more specific of what a self driving car is. In the most extreme case, it's unfathomable to make a secure self driving car. In reality there are endless things that can happen that the self driving car can't learn from because of lack of data. Things that do happen but not often enough to learn from. Also things like could exist in the future like huge trucks or trains with animated ads that could display footage of traffic. Perhaps you have seen such AI tricking where you put an image inside an image, or even just putting a certain pixel, can completely fool an AI.

In that sense a AI player at least seems fathomable. And considering the budget of existing commercial self driving car projects it seems to me that whatever they are trying to achieve is a lot more difficult.

However, self driving cars have existed for decades already, if all it needs to do is to understand it should stay on the road. So the simplest version of a self driving car I would guess is a lot easier than a human AI player.
-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
User avatar
ribot
Not banned
Posts: 2416
Joined: 19 May 2002, 16:20
Location: Miranda: the true state
Contact:

Re: Should I Release the AI Player`?

Post by ribot »

My approach to creating the AI was something similar to reinforcement learning. Basically I was rewarding certain behavior, so that the AI can compare different rides to each other and know which one is better.

Below I will go over the line of thinking that I have been using, and that should be enough to create my AI player as long as you can get a hold of the physics. I think it's fair that you should get a hold of it if you're interested.

A stupid solution for learning the apple order - apple take rewarding
So for example, if you want the AI to learn the apple order by itself, you can give points each time an apple is taken, at the same time as a punishment is given each frame (so that it will learn that being slow is bad). If an AI like this would be implemented, rewards would only come when random play results in taking an apple. Random play to take an apple is very horrible play, and with some randomness the style can be somewhat improved. After some time the next apple can be taken, and so on. So if the level is quite easy perhaps an AI could learn to finish it by random play.

Then you could run the same code multiple times again and see if other apple orders are chosen.

What's described above would be a stupid solution, but a simple first step to get started with the way of thinking.

The current method - distance shortening
Compare the above method the solution I (and probably stini too) used. That solution is to reward shortening the distance to the flower, with higher speed being rewarded too.

The stupid solution would only learn from taking apples, whereas distance shortening can learn almost from every frame (at least every ride is possible to evaluate and compare to other rides). So the stupid solution would be lost pretty much all the time, and every good trick it would perform would be disregarded unless an apple would be taken faster in that run.

I don't know how clear this is from my explanation, but learning from every ride means a lot faster learning than being lost most of the time, which means both a higher probability to finish levels and less training to gain skills.

Also, by preprogramming the apple order, the distance would no longer be a straight line from start to finish, but a series of straight lines from start to the first apple, to the next apple and so on, and lastly a straight line to the flower. This way I could use the exact same AI to finish apple levels, still being the same extremely simple brain of distance shortening.

However, distance shortening could seldom result in a good player.

As seen in earlier posts (where I shared recs), it is good at very specific piping levels, and I would guess it can outperform humans in piping levels that would be physically finishable and optimized for this AI.

Other than that the AI simply sucks. A reason for it sucking is that to measure the distance is not really that simple. It's simple from one point to another, but the bike is not a point. As you can touch the flower with either wheel or the head, you would at least have to include this somehow, and I haven't even figured out a good way to do this. Another reason for this method sucking is that in Elma sometimes you have to move away from the flower in order to get a better ride. Internal 10 (the steppes) is a good example of this.

Similarly, with your idea of rewarding apple times Dorknoob, (if I understood correctly) you would be optimizing for something that in my opinion doesn't really work. Take internal 04 (over and under) as an example. The fastest way to take the first or second apple would probably be to have as much speed as possible, but that would also mean a crappy landing, losing a lot of time before reaching the flower. So altough this is an interesting idea for a thought experiment, I don't see how an AI like that would perform well for most real life levels.

A better and more advanced method
As I suggested in an earlier post, a good AI could learn from all replays in existence. Or maybe only from good replays? Either way, it would have to have a starting point so that it at least learns that driving towards the flower is good, and pressing gas a lot is good. A basic starting model like this has been used by Google in other projects so your training doesn't have to start from scratch. From these basics it could perhaps learn to improve itself in simple levels, but to become something like a good player I would guess a lot of data is required. I don't know if it would be enough with all saved replays in existence. It might change however if the new EOL version stores replays automatically.

If some levels have shitloads of replays there could be AIs that learn individual levels. I really can't say if that would be better than learning from all levels and replays.

There is one problem with learning from replays: that they don't have keypresses stored (unless we're talking about okeol). But this should be solvable by having the physics engine outputting replays from keypresses, so even though you don't have keypress data in the existing replays, you can still make output data in replay format based on keypresses. Then a finished run can be rewarded with the average speed from start to goal, whereas non-finish-replays would be a lot harder to evaluate and maybe shouldn't be used as data for the AI (unless you have a specific level with no finishes at all, you can compare replays easier if all of them are unfinished).

Now, I don't really think if the AI would experiment with apple order with this method. I can't even imagine how an AI would do something like that, but maybe it will be evident in the future?
-
"leader status in the Elma against-the-system underground" - Abula
-
IncrElastoMania - Elma Simulation - Browser Game 2020
Elma Imager - Command Line Tool 2020
Post Reply