Advertisement

Using two different AIs

Started by November 05, 2004 04:31 PM
1 comment, last by pinacolada 20 years ago
Hey, I was just wondering how I would be able to have two different AIs play one another. For example, I have this computer competition with my friends and we are trying to see who can come up with the best AI for the game Checkers and to test this we wanted the AI to play each other. So what are some ways we can go about doing this? We are using JAVA as the language to program the AI, but could it be possible to have one AI programmed in C++ and another in JAVA all be able to play one another? Thank you, Praful Mathur -------------------------- Free Ipod (0/5) http://www.freeiPods.com/?r=8197578 PVPs for Free (1/10) http://www.pvps4free.com/default.aspx?r=32367
All you need to do is program an interface that say loads a dll with the Ai in it. This interface would include all of the code which execute the game of checkers and allows the AI to play the game. Graphics showing the game would also be optional. I'm not quite sure how to convert Java to a dll or if it is even possible (I assume it is) This way it wouldn't matter which language you program it in. It might actually be easier to use a dll for the AI coded in C and simply use the Java the way it is.

Its hard to be very specific in how you should implement it because I don't know what kind of interface your AI expects.

Dwiel
Advertisement
You could have the two applications running at the same time, and when one of them makes a move, they save a description of that move to a file. The referee program waits until that file is created, and opens it when it is. Then the referee program saves the new game state to a file, and the AI programs read the new game state, then one of them makes their next move, etc. As long as everybody agrees on a file format, you can write the AIs in whatever language you want.

This topic is closed to new replies.

Advertisement