ignorance77 / TransformiceAPI

10 stars 6 forks source link

Teaching bots to pass bootcamps using genetic algorithms #11

Open ignorance77 opened 13 years ago

ignorance77 commented 13 years ago

Hey, Anyone wants to participate in this awesome project? :)

izstas commented 13 years ago

Sounds awesome for me, but I never tried to make any kind of AI before so I can't help. However it'd be interesting for me to watch this project.

danley commented 13 years ago

I thought about that earlier, too. You would have to implement the Game engine with Box2D though (there are dynamic Bootcamps). But i would be very interested and i can help out with an old version of the game's sourcecode ;)

Contact me with your idea

icewolf-zz commented 13 years ago

I tried implementing jBox2D (Java port of box2D) quite a while back. I successfully parsed the map XML and built a physics world for each round but never managed to get the player movements working quite right. Sounds interesting though :)

danley commented 13 years ago

The first step is to get a fully working game client (at least the functional parts). I think that's more work implementationwise. Implement the game Physics in Box2D and all. Then make a model to predict and rate the different possible ways to solve a map. That should be the easy/less code part as i see it right now.

@icewolf, do you want the actionscript sourcecode of a version from ~december? you could find all the variables for the movement and all. that would be a great step forward, i think. i'd send it to you, if needed. As far as i have seen TFM hasn't changed anything on the Box2D engine, shouldn't be much of a problem adapting it.

icewolf-zz commented 13 years ago

I have no idea where to start with AI. I've got the as source for the current version as of writing this (0.167). It's just very messy and my French is horrific ^^'

I'm currently working on porting the API to objective-C and creating an iOS client so I doubt I could be much help. I'm also trying to figure out the most recent update which has added further protection against 3rd party clients. So unfortunately I wouldn't be much help.

Mujaflore commented 13 years ago

Hi. Unlike Icewolf, my english sucks but I speak french..

I thought about something like that. My solution was to create a bot that register the best performance (with a discret voting system to approuve that the guy who did it wasn't a cheater), and then to repproduce it. Cause if you implement an algorithm to solve the map, the bot would make strange things. Think about maps in which you can jump on lava and directly finish why a lot of luck. The bot will just do it, and make impossible performances..

Like jumping on lava, bouncing on the ice that nobody use, get the cheese in flight, and enter the hole, time : 1s.. Then just think about lava. The bot will jump 0.001 seconds after touching lava, it will never die, insensible to restitution .-. Its just an example, there must be a bunch of situations like this one. I think that the implementations on these kind of algorithms is possible, but make the bot act as a humain does, and be sure that it doesn't finish the maps in a abused way would be a lot harder.

The solution is to create constraints for any maps, like "Don't jump on this lava, with a restitution of 100, normal people instantly die...", "Don't make these bounces, these slides, it's really abused, you avoid the map...". However it requires a lot of investments.

Oh and for the protection, I have an algorithm, I will pull it if I understand how Github works :D

danley commented 13 years ago

@Mujaflore I think ignorance didn't want to reproduce other players behaviours but make the bot learn how to solve a level itself. I found these quite nice for an introduction to genetic algorithms: http://www.obitko.com/tutorials/genetic-algorithms/index.php http://www.ai-junkie.com/ga/intro/gat1.html so what you do is you find a way to solve the map and then you 'mutate' it to find better solutions. (correct me if my brief description fails...)

@others is there any progress with the Box2D model? can i help there? would you post your current work so we can work together on this?

ignorance77 commented 13 years ago

Danley is right, I want bot to learn itself, I just imagine how impressive it will be, if bot could pass even simplest map :)

Unfortunately, I have no time at all, so I'd postpone the project.. moreover I've heard they will change the protocol again :/

danley commented 12 years ago

@icewolf, @ignorance77 I hope you get this. I made the API working again and planning on working on this idea. i could really use some help with the jBox2d implementation, if you still have the code, @icewolf. If you're interested you could just visit us devs in #tmdevs on irc.rizon.net