Api for Automated Genetic Learning AI

BenoitRanque
Hello World
Hello World
Posts: 3

Api for Automated Genetic Learning AI

Post#1 » 27 Jun 2017, 02:38

Hello

I have been playing with this game and lurking in this forum for a while now.
I very much like that while the premises are simple, this game can get very complex very fast.

I was wondering if the desktop version comes with an api or what would be the best way to interface this with a genetic learning neural network? So we could have an AI making AIs.
This would not go online, the AI would play against other "species" of itself.

Ideally the AI could access the menu by an API an accelerate matches to get results. I am curious how long it would take and what AI could be generated.
Of course the project would be open source, if authorized by @GFX47 ;)

Please note, I am not a machine learning expert. Just some junior javascript dev :geek:

Any information welcome, I am not even sure what language this game is in! :D

User avatar
Eric S
Hello World
Hello World
Posts: 5

Re: Api for Automated Genetic Learning AI

Post#2 » 27 Jun 2017, 03:10

I've wanted to do the same thing too! I think it would be a huge amount of effort for the developer to publish some API that can interface with the game to do what you want.

You could always load games and intercept the traffic with Fiddler or something. You get a bunch of hex numbers which I assume is information about the map and the AI instructions for each bot. I doubt you could decode it, but you might be able to introduce random mutations and see if you could improve it over a long amount of time. But without being able to decode the information, you wouldn't know why your bots are doing what they are doing. =~)

sollniss
Automaton
Automaton
Posts: 178

Re: Api for Automated Genetic Learning AI

Post#3 » 27 Jun 2017, 03:33

This game doesn't even have bot count or complex functions yet and you guys want want to make neural networks lol.

mcompany
Autonomous Entity
Autonomous Entity
Posts: 872

Re: Api for Automated Genetic Learning AI

Post#4 » 27 Jun 2017, 06:25

It is not possible to really get any information out of the game unless you somehow manually have a way to detect what is going on on-screen. Otherwise, you are better off creating your own simulation outside of the game

User avatar
Kanishka
Skynet
Skynet
Posts: 1420
Contact:

Re: Api for Automated Genetic Learning AI

Post#5 » 27 Jun 2017, 06:40

1. Salute, I know a bit of Javascript too.
2. The game is in C#
3. The AI produced would simply Idle (provided my source didn't lie) unless attacked.
Fixes break an AI more than bugs do. :ugeek:

Gladiabots Off-Topic Chat


My Stats: Kanishka_RN3;Kanishka_MiPad

pier4r
Skynet
Skynet
Posts: 3342

Re: Api for Automated Genetic Learning AI

Post#6 » 27 Jun 2017, 07:08

Kanishka it depends how you make the neural network. Surely given the amount of possibilities, unless one goes hardcoding solutions a neural network made by a single person may reach 1200. It is not that everyone is as good as the alpha go team.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

mcompany
Autonomous Entity
Autonomous Entity
Posts: 872

Re: Api for Automated Genetic Learning AI

Post#7 » 27 Jun 2017, 07:11

Kanishka wrote:3. The AI produced would simply Idle (provided my source didn't lie) unless attacked.

It depends on how well the network is made, if anything, that network idling was either a bug, or was a problem with how it was implemented

BenoitRanque
Hello World
Hello World
Posts: 3

Re: Api for Automated Genetic Learning AI

Post#8 » 27 Jun 2017, 08:34

Kanishka wrote:3. The AI produced would simply Idle (provided my source didn't lie) unless attacked.

That seems weird... Do you know what parameters where used as weight? I would guess winning the game, in the smallest amount of time, with the most bots still alive, in that order.

It is not necessary to know/see what the bots are doing during a match. Only to be able to modify the ais, send them to war, then get results (won/lost, number of bots alive on win, time elapsed, score).

The algorithm would then select the best ais using those criteria, and have them breed (yes, robots breeding), which may or may not produce better ais. Rinse and repeat until able to beat Kanishka/Computer dies ;)

User avatar
Kanishka
Skynet
Skynet
Posts: 1420
Contact:

Re: Api for Automated Genetic Learning AI

Post#9 » 27 Jun 2017, 18:54

BenoitRanque wrote:Rinse and repeat until able to beat Kanishka/Computer dies ;)


Hah
Fixes break an AI more than bugs do. :ugeek:

Gladiabots Off-Topic Chat


My Stats: Kanishka_RN3;Kanishka_MiPad

User avatar
Kanishka
Skynet
Skynet
Posts: 1420
Contact:

Re: Api for Automated Genetic Learning AI

Post#10 » 27 Jun 2017, 18:56

BenoitRanque wrote:The algorithm would then select the best ais using those criteria, and have them breed (yes, robots breeding)


https://twitter.com/GFX47/status/820655098707771393
Fixes break an AI more than bugs do. :ugeek:

Gladiabots Off-Topic Chat


My Stats: Kanishka_RN3;Kanishka_MiPad

User avatar
GFX47
Dev
Posts: 2865

Re: Api for Automated Genetic Learning AI

Post#11 » 28 Jun 2017, 09:21

Yep, an API would be great but I really don't have the time for it right now :(
Maybe post release?

BenoitRanque
Hello World
Hello World
Posts: 3

Re: Api for Automated Genetic Learning AI

Post#12 » 28 Jun 2017, 15:49

I was reading on another thread and someone suggested having the ability to export your ai in a text(JSON?) file.

If that could be done, the only additional requirements would be an api to download/upload an ai, delete ai, send ais to battle in test mode, and somehow log results of these battles

With that, its a matter of comming up with a good genetic algorithm. Still wondering how to handle robot mating.

Anyways this is just me rambling, and not a priority by any measure.

But the metrics needed to implement this are all collected by the game already (win/lose, score)

Anyways if this becomes a possibility in the future, it would make for an interesting project

User avatar
Kanishka
Skynet
Skynet
Posts: 1420
Contact:

Re: Api for Automated Genetic Learning AI

Post#13 » 28 Jun 2017, 17:05

GFX47 wrote:Maybe post release?


By that time you'll rule the world with a giant robot army.
Fixes break an AI more than bugs do. :ugeek:

Gladiabots Off-Topic Chat


My Stats: Kanishka_RN3;Kanishka_MiPad

Deche
Hello World
Hello World
Posts: 3

Re: Api for Automated Genetic Learning AI

Post#14 » 14 Jul 2017, 11:35

Holy shit just imagine Creating a lstm for this!!! Would blow my mind

shaulk
Hello World
Hello World
Posts: 1

Re: Api for Automated Genetic Learning AI

Post#15 » 10 Jun 2018, 08:32

Hi,
Any news on this? this can be really great PR too

pier4r
Skynet
Skynet
Posts: 3342

Re: Api for Automated Genetic Learning AI

Post#16 » 10 Jun 2018, 09:17

I would say no. While the project is nice, once it is done (and maybe open sourced ) then you have similar problems like lichess. Players playing with heuristic engines rather than themselves . One wouldn't know about cheaters and the game at the upper end will die.

Why should I spend time when an heuristic engine can develop a tactic like mine on a couple of hours ?
Why should I play when the next player may just brag his strength but he is using an engine ?

If one wants to develop an heuristic for the game one can replicate the game (in a simplified fashion) and then let an heuristic play in the replica not in this game.

It would be exactly the same result but without.consequences for the playerbase. The rest is , for me, only a whish to show off while using machine learning frameworks that do all the real work.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

User avatar
GFX47
Dev
Posts: 2865

Re: Api for Automated Genetic Learning AI

Post#17 » 10 Jun 2018, 17:38

It would take so much time anyway, it's just not the good moment for that.
So once again MAYBE after release.

M4L4
Script
Script
Posts: 49

Re: Api for Automated Genetic Learning AI

Post#18 » 13 Nov 2018, 10:55

mhhhh i have played with neural nets before, and that was one of my first thought when i saw this game.
Based on my experience i see two different approaches: bruteforce the game through neuroevolution, or use reinforcement learning.

Neuroevolution would be the easiest approach, you don't even have to look at the games, you just create thousands of random ai, let them battle, assign a score to each one, higher score means higher chance of reproduction through the next generation, create next generation, keep going on till you're satisfied.
The Problem is the depth of the game, think about how many combination of filters you can use on a single action, and how many conditions (with their own filters) you can apply to the single action. Add branches and logic gates and the combinations skyrocket to billions, bruteforcing billions of combinations can be quite timeconsuming.

Using reinforcement learning can be quite tricky, since we don't have control of the ai during the match. The typical Markov chain is basically a circle between the agent and the environment:
agent looks at the env state > agent predicts result of future actions > agent does something > agent receives new state and "reward" score from env > agent compares reward with prediction > agent looks at the new state > repeat. Since you do not make choices during the game, the net should be able to analyze the entire match afterward, and it has to look both at the game and at the decision tree to be able to understand relations between coded actions to the actual actions on the screen.

It would be really interesting, i'd love to try.

Return to “General Discussions”

Who is online

Users browsing this forum: No registered users and 0 guests