Games in Progress: 3 | Players logged in: 3 | Players Registered: 37413 | Games Played Total: 68649
Print Page - Create an AI API

Planet M.U.L.E.

Planet Mule 1 => Computer A.I. => Topic started by: WhoosThis on December 22, 2010, 02:56



Title: Create an AI API
Post by: WhoosThis on December 22, 2010, 02:56
I am a programmer, and have been programming java professionally for about 10 years. I was wondering if you could create an AI api that could be plugged in some how into the game. Perhaps you could do it with interfaces, and provide a model containing all the game information.

I think it would be fun to compete with other AIs, and see if you could create a bot that is close to optimal. It would also be a fun way for kids and new programmers to learn about programming and AI.

WhoosThis


Title: Re: Create an AI API
Post by: Peter on December 29, 2010, 07:37
The current AI was written by Adam Marcus. He contacted us through this forum and wanted to help out by trying to improve the AI with linear programming. What we did then was simply letting him access our repository with the full source code and do his AI branch. When the new AI was done we merged it into the game in an update.

I don't think we will make any stand alone interface for writing AI's, unless there are several players interested in doing that, but it's simple enough to interface with the game as is, if you have the full source code. All you have to do is issue commands such as "Outfit a Mule with this and go to that plot" and "Go to price $x in the auction". Email me if you'd like to give it a shot and we can talk about it.

However, note that it's a big task to write a fully working AI which can handle both the development phase and the auctions. It's an even bigger task to make it a challenging opponent. I would guesstiamte it requires around 100 hours of work to get something playable.


Title: Re: Create an AI API
Post by: Keybounce on January 13, 2011, 23:11
Quote
All you have to do is issue commands such as "Outfit a Mule with this and go to that plot" and "Go to price $x in the auction".

I've noticed that in some cases, the AI won't actually mange this -- attempting to go to location X and assay, for example, causes it to get stuck; going to a given price in the auction can fail to sale to the store. Is this a case of the AI program failing, or is it the mechtron engine in the main program failing to implement the AI commands?

Does the AI have the ability to see what other people are doing -- can it change the value of a good in the auction phase based on what other people are buying/selling for? In particular, can it change it's mind to buy or sell based on other people declaring as buyers or sellers?


Title: Re: Create an AI API
Post by: Peter on January 28, 2011, 14:16
I've noticed that in some cases...

I would think the AI gets stuck only when it takes over after a disconnected player. We have it in our list of things to fix for the next release.

The AI can always see what all other players are doing. It can react to what others sell and buy and what prices they stand at. The AI also has the possibility to change its mind depending on if others are buyers/sellers, but the current AI implementation never changes buyer/seller status. It decides this only once at the beginning of the auction depending on the supply and demand.


Title: Re: Create an AI API
Post by: Keybounce on January 31, 2011, 04:02
Hmm...

For debugging purposes, can an AI ask the game to pause? Specifically, can it output stuff to the chat window, and ask the game to pause to let people read what it's planning?

I might want to try this ...


Title: Re: Create an AI API
Post by: iso9001 on May 11, 2012, 16:20
Great idea.!  :)


Title: Re: Create an AI API
Post by: Chuckie Chuck on May 21, 2012, 18:33
Was just reading the original post here...

By WhoosThis
Quote
I am a programmer, and have been programming java professionally for about 10 years. I was wondering if you could create an AI api that could be plugged in some how into the game. Perhaps you could do it with interfaces, and provide a model containing all the game information.

Come to think of it, Mainstreams hosting bot provides and excellent base to create such an AI.  If you could get the source from mainstream for the basic characteristic for logging on, you probably could create an AI that actually plays.  Keep in mind, the fact that it's game play would be rated by the server like any real human player, but sounds like a great way to start out and experiment with writing a better AI.


Title: Re: Create an AI API
Post by: iso9001 on October 25, 2012, 15:54
Reminds me of Worms for the C64. Same publisher (EA) in the same age as M.U.L.E.

http://www.youtube.com/watch?v=gLCq5aqXh5M

You had to train your worm and could save it to disk to take it to someone and let them compete.