Dr. Strangebot

Come in here to talk about your sky-net style world-destroying super bots!

Moderator: Defcon moderators

User avatar
poptart911
level1
level1
Posts: 33
Joined: Thu Jan 13, 2011 6:04 pm
Location: Iowa, US
Contact:

Dr. Strangebot

Postby poptart911 » Fri Jan 14, 2011 6:25 am

Hi all,

I've adopted a defcon bot for an academic project. I'm a big fan of the game, and the defcon world poses some huge challenges. I'll be writing the bot in native C++. I plan to incorporate diplomacy and some probabilistic decisions. This is a school project, so you can be sure that I will see this through. I'll post the binaries regularly and the source when it's done.

Owen J


EDIT: I have the bot's source in a public github repo. Dr. Strangebot lives here: https://github.com/owen2/Strangebot
Last edited by poptart911 on Wed Feb 16, 2011 6:36 am, edited 1 time in total.
User avatar
Sam Kennedy
level1
level1
Posts: 20
Joined: Wed Dec 01, 2010 11:33 am
Location: Newcastle

Postby Sam Kennedy » Fri Jan 14, 2011 2:03 pm

I wish I could do that for my school project!

Have you considered using Lua? It is easier to use, and if you need help, it is more likely people here can help you :)

Good luck, I'm really interested to see how it develops!
User avatar
trickser
level5
level5
Posts: 1823
Joined: Thu Mar 06, 2008 2:15 pm
Location: The Senate ; GMT+1
Contact:

Postby trickser » Fri Jan 14, 2011 2:05 pm

Hi, I am the greeting committee.

Good luck with your Bot, dont forget to feed us with some screenies.

Cheers.
User avatar
poptart911
level1
level1
Posts: 33
Joined: Thu Jan 13, 2011 6:04 pm
Location: Iowa, US
Contact:

LUA vs C++

Postby poptart911 » Sat Jan 15, 2011 12:43 am

Perhaps I will use lua instead. The luabot bindings seem to work okay, and the lua language is more abstract than C++, so I think it may be more appropriate for an AI project. I'll a little more closely at both languages because I don't really know either of them yet. (I usually use python or PHP)

Does anyone know of a working python binding? I'm not sure if I know how to make my own, but I know it can be done.
User avatar
poptart911
level1
level1
Posts: 33
Joined: Thu Jan 13, 2011 6:04 pm
Location: Iowa, US
Contact:

Bug

Postby poptart911 » Sat Jan 15, 2011 11:30 am

Anyone notice that the

Code: Select all

GetRemainingUnits(unittype)
function doesn't work? It always returns 6.

EDIT: actions don't actually happen until the next tick. So if you have a loop that tries to place all silos in 1 tick using

Code: Select all

while GetRemainingUnits() > 0
, it won't work.


Anyway, lua it is. I really like lua so far. And it appears diplomacy can be done with bots. The agent currently asks for alliances in defcon 5.[/code]
Last edited by poptart911 on Thu Jan 27, 2011 5:42 pm, edited 1 time in total.
User avatar
poptart911
level1
level1
Posts: 33
Joined: Thu Jan 13, 2011 6:04 pm
Location: Iowa, US
Contact:

Progress

Postby poptart911 » Wed Jan 19, 2011 5:22 pm

Dr. Strangebot now picks the best (hopefully) possible alliance and sends a request to join it. :D Also, I'm building a world perception layer that I will share with you when it is completed.

Here's a permalink to the latest source of the bot. When I update it, it will be available here in its latest version: http://owenjohnson.info/dev/defcon/strangebot.zip
User avatar
tllotpfkamvpe
level5
level5
Posts: 1768
Joined: Fri Aug 31, 2007 12:04 am
Contact:

Postby tllotpfkamvpe » Mon Jan 24, 2011 6:15 pm

Hi Owen, when you get your bot up and running I'll be happy to play against it for testing.
User avatar
Schubdüse
level5
level5
Posts: 1210
Joined: Tue May 08, 2007 10:00 pm
Location: Seoul

Re: Progress

Postby Schubdüse » Mon Jan 24, 2011 10:24 pm

Dear Owen,
so far no Bot has come to alive. I hope, yours will make it. :D

poptart911 wrote:Dr. Strangebot now picks the best (hopefully) possible alliance and sends a request to join it.


Consider this: There are four players. One is EU, one is Russia, one is Africa and your Bot is Asia.
Which one will your Bot choose to ally with?
User avatar
poptart911
level1
level1
Posts: 33
Joined: Thu Jan 13, 2011 6:04 pm
Location: Iowa, US
Contact:

Re: Progress

Postby poptart911 » Mon Jan 24, 2011 10:50 pm

Schubdüse wrote:Consider this: There are four players. One is EU, one is Russia, one is Africa and your Bot is Asia.
Which one will your Bot choose to ally with?


The bot would choose Russia assuming all three opponents were independent based on the highest amount of shared radar coverage. If Africa and Europe were a team, then it would attempt to join that team. (Assuming all human players)

The bot will not ask [CPU] players for alliances because the introversion AI never accepts them. :P [/quote]
User avatar
Schubdüse
level5
level5
Posts: 1210
Joined: Tue May 08, 2007 10:00 pm
Location: Seoul

Re: Progress

Postby Schubdüse » Tue Jan 25, 2011 1:24 am

poptart911 wrote:
Schubdüse wrote:Consider this: There are four players. One is EU, one is Russia, one is Africa and your Bot is Asia.
Which one will your Bot choose to ally with?


The bot would choose Russia assuming all three opponents were independent based on the highest amount of shared radar coverage. If Africa and Europe were a team, then it would attempt to join that team. (Assuming all human players)


Interesting! But your Bot should ally with Africa. Africa and Asia vs EU and Russia is a nearly 100% win. This would be of course unfair, boring and lame. But Africa would be the most logically ally. 3vs1 could be risky, because the single player could nuke many, many cities and therefore could score more points than the others.
User avatar
poptart911
level1
level1
Posts: 33
Joined: Thu Jan 13, 2011 6:04 pm
Location: Iowa, US
Contact:

Postby poptart911 » Tue Jan 25, 2011 2:48 am

I'm an intermediate player at and I never thought about that way. Currently the algorithm uses shared radar cover as a heuristic ( a function that estimates "goodness" ). So perhaps I need to take some more factors into consideration.

I think I will update the heuristic to include the total enemy population that would result considering the alliance is formed. Thanks a lot for the tip.

Does anyone have any other suggestions for picking the "best" ally?

Also what are your ideas about silo placements? I hear lots of people saying that bunched silos do best, but my intuition says otherwise.
User avatar
rus|Mike
level5
level5
Posts: 2750
Joined: Thu Jun 28, 2007 5:52 pm
Location: Russia, St. Petersburg

Postby rus|Mike » Tue Jan 25, 2011 3:17 am

poptart911 wrote:Also what are your ideas about silo placements? I hear lots of people saying that bunched silos do best, but my intuition says otherwise.

For 1v1/2v2 "bunched" silos are a must or else they are going to be picked 1 by 1 and will not really protect anything. For 6-player game it's not always so, you might want to search the forum for a "Sui-silos" strategy when silos are placed spread but each maximaly close to 1 big enemy city like Leningrad (if you're Europe) giving you 99% chance to hit it first and score lots. But Sui-silos is about the only exeption of "cluster only!!!1111" rule for silos.

As for choosing an ally it's not that hard to enlist all possible cases, sort them best to worst manually and feed them to the bot. No need for any functions that way.
User avatar
Schubdüse
level5
level5
Posts: 1210
Joined: Tue May 08, 2007 10:00 pm
Location: Seoul

Postby Schubdüse » Tue Jan 25, 2011 2:38 pm

poptart911 wrote:I'm an intermediate player at and I never thought about that way. Currently the algorithm uses shared radar cover as a heuristic ( a function that estimates "goodness" ). So perhaps I need to take some more factors into consideration.


Just to understand your funtion:
There are three players playing EU, Africa and Russia. Your Bot is either Africa or Russia. Will your function make your Bot ally with Africa (or Russia)?
Because Africa and Russia can radar cover almost entire EU.

poptart911 wrote:Does anyone have any other suggestions for picking the "best" ally?


Generally, southern allies have the edge over northern allies. (SA and Africa vs NA and EU and so on).



poptart911 wrote:Also what are your ideas about silo placements? I hear lots of people saying that bunched silos do best, but my intuition says otherwise.


rus|Mike explained it very well, already. Maybe you should play some 1vs1 or 2vs2 with us, in order to "correct" your intuition. :wink:
BTW, did you read the "Gamma-Thread"?
User avatar
poptart911
level1
level1
Posts: 33
Joined: Thu Jan 13, 2011 6:04 pm
Location: Iowa, US
Contact:

Postby poptart911 » Tue Jan 25, 2011 6:56 pm

Just to understand your funtion:
There are three players playing EU, Africa and Russia. Your Bot is either Africa or Russia. Will your function make your Bot ally with Africa (or Russia)?
Because Africa and Russia can radar cover almost entire EU.


Playing as EU, Africa and Russia tie, and the first one tested would win (Russia I think). Playing as either Russia or Africa, the bot would certainly pick EU.

All teams start with score 1.0. If they are not adjacent, score *= .75, if self or cpu, score = 0, also score *= (numberOfAllies -1). I'm starting to see how inadequate this formula is. I'm thinking I'll update it include a change in ratio between friendly and enemy populations and perhaps a N vs S check.
User avatar
poptart911
level1
level1
Posts: 33
Joined: Thu Jan 13, 2011 6:04 pm
Location: Iowa, US
Contact:

Postby poptart911 » Thu Jan 27, 2011 10:27 am

Image
Something is wrong. :D

Return to “AI Bots”

Who is online

Users browsing this forum: No registered users and 1 guest