Forum
KDICE BOTS
Posted By: Ryan at 7:50 PM, Tuesday December 9, 2008 EST
I'm working on doing some AI battles with KDice and was hoping to get some initial bots submitted as psuedo code algorithms. I'll name the bot after your kdice name and will have them battle each other. Eventually I can open up a kdice to write your own bot.
As a starting point, the current bots are dumb and run as follows:
findBattle(){
for each enemy border region
if my dice > enemy dice
return enemy region
return no region
}
Don't post your code here or others will take your good ideas! Ideally each bot is different. So email me first ([email protected]). I'll try to do a some battles on the test server and allow for some tweaking when they're done.
As a starting point, the current bots are dumb and run as follows:
findBattle(){
for each enemy border region
if my dice > enemy dice
return enemy region
return no region
}
Don't post your code here or others will take your good ideas! Ideally each bot is different. So email me first ([email protected]). I'll try to do a some battles on the test server and allow for some tweaking when they're done.
« First
‹ Previous
Replies 21 - 30 of 30
Zergme wrote
at 9:58 PM, Thursday December 18, 2008 EST any updates yet ryan?
|
sekki wrote
at 10:32 AM, Saturday December 20, 2008 EST What information is available to the bots? Firstly map information is needed. A function that returns a full graph may be more complex then you intend. A simplification would be:
Node[] getNodes(int distance, Node n); i.e. a list of Nodes (or lands or territories) that can be reached in a minimum of distance steps from Node n. Other info which would be needed is int getPlayerNumber(); // return 1-7 depending on which player you are int getTotalDice(int playerNum); int getReserveDice(int playerNum); Node[] getNodes(int playerNum); The Node object should look something like: class Node() { int numDice; int playerNumber; int id; // unique id or address of the node } I can't yet think of anything else needed that can't be derived from the above. Also, I think the starting player should always be player 1, since the bots are seated in a random order. This will make ordering code a little simpler. One other class of data that could be useful is player statistics aggregated over the whole game, and also at the end if the players last move. Useful info would include: total attacks % successful attacks average advantage on attack number of times attacked |
sekki wrote
at 10:35 AM, Saturday December 20, 2008 EST Also, is recursion ok?
|
Danny_DCB wrote
at 8:15 AM, Sunday December 21, 2008 EST I think the best way to approach the map would be using the graph theory. Each territory would be a node and borders would be weighted edges. Such a graph would have a single component and have the property of non-transitivity, anti-reflexivity and symetry (a non-oriented non-pseudo planar graph).
Once you have that it should be fairly easy to program the bots if you assign each edge with a weight based on "deciding factors". Using the knowledge of the graph theory would help a lot. Of course that would be the most tedious part of the program, that's why I leave it to someone else. |
probabler wrote
at 9:52 AM, Monday December 22, 2008 EST "and THE WINNER IS...": ***GENOBOT***
(after billions of crossingovers) |
Ryan wrote
at 9:15 PM, Monday December 22, 2008 EST I've finished MadWilly's bot and have done one of my own. There are three others that need to be done. Mine and MadWilly's do well and nearly always win over the dumb/aggressive bots.
I think once I have a bunch done I'll do a daily bot tourney. I might use some good bots for the iphone version. Also, if you can write a simple bot on someone's playing style we can add them in for fun (they don't all need to be good). As far as algorithms and data available anything is possible (just not too cpu intensive). At minimum theres a list of regions with dice and player ids. Each region has a list of neighbors. For MadWilly's bot I needed to add a graph theory algorithm - so anything is fair game. |
rgs258 wrote
at 11:25 PM, Wednesday February 18, 2009 EST So what ever came of this?
Oh, is kdice running on JBoss or just Apache? |
rgs258 wrote
at 11:33 PM, Wednesday February 18, 2009 EST ...or something else?..
|
ma1achai wrote
at 3:18 PM, Monday March 9, 2009 EDT Missed this post... I would have been nagging you about this since the first day had I seen it. I love this idea... I think it would be great fun to develop bots to do battle. I've played with similar types of bot programs before (especially microsoft's terrarium) and they are lots of fun and can really help people learn to code.
If you were to really spend some time on this, it could be quite a money maker. You could attract tons of young developers and hobbyists to your site if this was done properly... this is the type pf thing that spreads by word-of-mouth through dev communities quickly. You should really think about putting out an api to code against... forget the pseudocode. And it might be smart to make it available in multiple languages... I would think .Net and/or Java would attract a bunch of people. This idea has legs, Ryan... run with it! I have lots of thoughts on it already... |
Pawe? Woroniecki wrote
at 5:37 PM, Friday December 14, 2018 EST Is there any chance that this idea will be bringed back to life?
|