:: Community ::
ForumsMessagesGroupsChat (3)Friends
 

Forums :: Mods :: Release: botwar

You must sign in to post.

Page 1 / 212

Release: botwar :: May 27, 2007 @ 10:37am

Ensign philhassey

Joined: Nov 30, 2006
Posts: 1239
Location: Zarcon

Hey - I've put together a BotWar mod so you can watch bots duke it out at high speed (generally games take 5-10 seconds!)

BotWar

So far it appears that ThirdParty's cobra bot is the best :)  I'll look into porting the in-game bots so I can see how they fair against it.

Get yourself ready, because pretty soon I plan on annoucing an official "BotWar" competition!

I've updated this mod with the main in-game bot "bot5000" and touched some minor things up a bit.

- Phil
post updated on May 27, 2007 @ 5:50pm
Re: Release: botwar :: May 27, 2007 @ 6:15pm

Ensign thirdparty

Joined: Dec 20, 2006
Posts: 291
Location: New Jersey, USA

It's a little buggy.  For your convenience I've written a variant of Kamikaze which exploits those bugs.  Here it is.  [Edit: I've removed Cheatbot since Phil has now seen the bugs.]  It uses four distinct cheats; you can comment out all but one of them if you want to see what each does.

- "cheat_horde" botwar allows cheatbot to send more ships from a planet than it owns (Suggested fix: see any of my released mods)
- "cheat_tamper": botwar allows cheatbot to directly modify planet ships, production, and owners
(Suggested fix: I don't know.  Somehow make the level read-only to bots, or pass the bot a fake copy.)
- "cheat_junk": botwar allows cheatbot to issue orders to other players' ships
(Suggested fix: probably similar to the fix for direct modification.)
- "cheat_winner": botwar allows cheatbot to modify its own win count
(Suggested fix: instead of making win counts variables which belong to the user in question, make them seperate)

Of course, we _could_ simply proof-read bots to make sure that they don't cheat.  But it'd be better if Botwar were robust enough that they didn't work in the first place.  With a sufficiently-complicated bot, it would be hard to tell for sure if it was doing anything fishy.
post updated on May 30, 2007 @ 8:40am
Re: Release: botwar :: May 27, 2007 @ 6:26pm

Ensign philhassey

Joined: Nov 30, 2006
Posts: 1239
Location: Zarcon

I'll fix cheat_horde and cheat_junk for sure .. Since those should be "filtered" automatically by the level.fleet / level.redirect methods.  Doing something wrong with those would be easy enough.  (From watching some bot wars, I think some of my bots are doing bad plays by mistake.)

As for the other two - I think we'll leave 'em as "honor system" items.  I mean - if someone wins "the bot war", people are going to want to check out the code.  And if the code contains a cheat, boy are they gonna get it ;)  (The only way to fix the cheat_wins would be to fix cheat_tamper, and fixing cheat_tamper would be a lot of work!)

- Phil
post updated on May 27, 2007 @ 6:26pm
Re: Release: botwar :: May 27, 2007 @ 6:33pm

Ensign philhassey

Joined: Nov 30, 2006
Posts: 1239
Location: Zarcon

Okay - I fixed the cheat_horde issue.  Looks like cheat_junk is the same issue as the other two, so I'm not so sure I can fix that without some hassle.

Anyway - that first one was a pretty important one.

- Phil

p.s. it's a lot of fun to run a war at 8x or 12x .. because then you can still watch the battles pretty well.
post updated on May 27, 2007 @ 6:34pm
Re: Release: botwar :: May 27, 2007 @ 6:40pm

Ensign thirdparty

Joined: Dec 20, 2006
Posts: 291
Location: New Jersey, USA

By the way, I'm trying to splice bot5000 into a mod like Classic so I can play against it, and am having trouble doing so: it raises odd exceptions.  What gives?

(edit: rest of post obviated by phil's latest post)
post updated on May 27, 2007 @ 6:40pm
Re: Release: botwar :: May 27, 2007 @ 6:41pm

Ensign philhassey

Joined: Nov 30, 2006
Posts: 1239
Location: Zarcon

btw - just uploaded an update - with that fix as well as a cool tweak so you can change the speed in game with the number keys.  Fun Fun Fun.
Re: Release: botwar :: May 27, 2007 @ 6:42pm

Ensign philhassey

Joined: Nov 30, 2006
Posts: 1239
Location: Zarcon

By the way, I'm trying to splice bot5000 into a mod like Classic so I can play against it, and am having trouble doing so: it raises odd exceptions.  What gives?

(edit: rest of post obviated by phil's latest post)


Can paste in the exception (at least the ending of it)?  It should be saved in your mods/data/log.txt file.

Thx.
Re: Release: botwar :: May 27, 2007 @ 6:58pm

Ensign thirdparty

Joined: Dec 20, 2006
Posts: 291
Location: New Jersey, USA

Yep, that's fixed Horde, which is the only one that could really happen by accident.  (Ah, it was so beautiful to watch, though: an expanding ring of death flashing outward from the homeworld like wildfire.  Only Kamikaze could survive the initial burn, and even it had no real chance.)

When I spliced Bot5000 into Classic, this error happened when I loaded the mod:
File "level.py" line 43, in init
File "bot5000.py" line 33, in init
File "bot5000.py" line 17, in change
AttributeError: Planet instance has no attribute 'rect'
['exec: g.init()']
post updated on May 27, 2007 @ 7:01pm
Re: Release: botwar :: May 27, 2007 @ 7:13pm

Ensign thirdparty

Joined: Dec 20, 2006
Posts: 291
Location: New Jersey, USA

Uh, wait a minute.  I just saw Bot5000 with a negative planet population.  Does your code really say "f.ships = max(from_.ships,ships); from_.ships -= ships"?  That's terrible, really completely terrible.  It ought to be "f.ships = min(from_.ships,ships); from_.ships -= f.ships".

Also, how about a countdown timer for when no planets are left?  Ending the game instantly isn't fair, often it's possible to come back from not having any planets if one still has lots of ships.  (For example, it's an entirely legitimate move against a Kamikaze with a better starting position than your own to try to swap places with it.  But under your rules, doing so yields a loss.)
post updated on May 27, 2007 @ 7:13pm
Re: Release: botwar :: May 27, 2007 @ 7:19pm

Ensign thirdparty

Joined: Dec 20, 2006
Posts: 291
Location: New Jersey, USA

So far it appears that ThirdParty's cobra bot is the best

Not only that: I think my lass bot is second-best.
Re: Release: botwar :: May 27, 2007 @ 9:19pm

Ensign philhassey

Joined: Nov 30, 2006
Posts: 1239
Location: Zarcon

third - 

To get bot5000 to work, add a self.sync() before the bot is inited (see my level.py in botwar)

I fixed that bug (oops!)  How silly of me.

Regarding "end of game conditions" I gave it a bit of thought, a couple things come to mind:

1.  Games need to have a time limit for botwars, 'cause if you get to lousy bots, they could go at it forever, slowing down the war.

2.  Timeouts should result in a winner and a loser usually, otherwise a bot might be programmed to try to stalemate games it wasn't going to win.  And that just isn't "the Galcon way".  Likely this could be done the same way /stop is calculated - person with the most production wins.

3.  Need to have fair ending conditions for the game that don't hint at any particular strategy.  I suspect if #2 is fixed proper, I could just use the ending conditions from "in-game", because those seem to be just fine.

Thoughs?
Phil
Re: Release: botwar :: May 27, 2007 @ 10:04pm

Ensign thirdparty

Joined: Dec 20, 2006
Posts: 291
Location: New Jersey, USA

I think that the rules for the botwar game should be as much like the rules for the net game as possible.  But I agree on the need for a time limit followed by effectively a "/stop".
Re: Release: botwar :: May 28, 2007 @ 12:10am

Ensign philhassey

Joined: Nov 30, 2006
Posts: 1239
Location: Zarcon

I think that the rules for the botwar game should be as much like the rules for the net game as possible.  But I agree on the need for a time limit followed by effectively a "/stop".


I just posted an update .. Check it out .. It's not quite the same as in the net game - since it allows dragging out the game for the full five minutes (no 30 second countdown).  

But it does good tie-breaking "production first, then ships" for deciding the winner of a round.  Please take a look and see if I didn't do something stupid again ;)

Phil
Re: Release: botwar :: May 28, 2007 @ 12:25am

Ensign philhassey

Joined: Nov 30, 2006
Posts: 1239
Location: Zarcon

-- interestingly enough, my simple kamikaze bot seems to do pretty well.  I might have to set up a basic genetic algorithm to play with the 3 factors I have in that basic bot and see if I can find the optimal numbers.
Re: Release: botwar :: May 28, 2007 @ 12:26am

Ensign philhassey

Joined: Nov 30, 2006
Posts: 1239
Location: Zarcon

-- on a whole different angle, is which bots are:

1. The funnest to play against a human
2. The hardest to play against a human
Re: Release: botwar :: May 28, 2007 @ 3:41am

Ensign carn

Joined: Dec 16, 2006
Posts: 75
Location: SF

Thirdparty, when you get a chance come by #galcon on irc.freenode.org -- We have a working implementation of the galcon client protocol and currently have a simple bot that plays like zanthor. Phil has suggested that we make the multiplayer bot api identical to the mod bot api so that anyone who writes a mod bot can have their bot play online as well. Come help.
Re: Release: botwar :: May 30, 2007 @ 4:51pm

Ensign thirdparty

Joined: Dec 20, 2006
Posts: 291
Location: New Jersey, USA

botwar is occasionally throwing an exception (especially when running on large galaxies):
"level.py" line 112 in loop
"level.py" line 165 in stop
TypeError: comparison function must return int.


My guess is that the int(x) function is failing to produce an integer for sufficiently large values of x.

line 164 of level.py read:
return int(round(p * 1000000 + s))

I replaced it with:
if p * 1000000 + s > 0: return 1
elif p * 1000000 + s < 0: return -1
else: return 0

and this seemed to fix the problem.
Re: Release: botwar :: May 30, 2007 @ 6:51pm

Ensign philhassey

Joined: Nov 30, 2006
Posts: 1239
Location: Zarcon

Thanks - added that in.  Will post sometime later...
Re: Release: botwar :: May 30, 2007 @ 10:18pm

Ensign thirdparty

Joined: Dec 20, 2006
Posts: 291
Location: New Jersey, USA

Here's a suggested modification to BotWar:
BotTourney

I've added an option for "tournament mode".  What it does is plays each level it generates with every possible mapping of positions to bots.  (For example, if you have bots A, B, and C in the game, and you're set to play one-on-one's, then each level will be played six times: once with A blue and B red, once with A blue and C red, once with B blue and A red, once with B blue and C red, once with C blue and A red, and once with C blue and B red.

It's not as interesting to watch, but it has the effect of eliminating luck due to pairings or to uneven starting positions: scores better reflect bots' skill levels.
Re: Release: botwar :: May 31, 2007 @ 11:12am

Ensign philhassey

Joined: Nov 30, 2006
Posts: 1239
Location: Zarcon

Here's a suggested modification to BotWar:
BotTourney

I've added an option for "tournament mode".  What it does is plays each level it generates with every possible mapping of positions to bots.  (For example, if you have bots A, B, and C in the game, and you're set to play one-on-one's, then each level will be played six times: once with A blue and B red, once with A blue and C red, once with B blue and A red, once with B blue and C red, once with C blue and A red, and once with C blue and B red.

It's not as interesting to watch, but it has the effect of eliminating luck due to pairings or to uneven starting positions: scores better reflect bots' skill levels.


Yeah - that would likely yield statistically meaningful results much quicker.  Looks good.

Page 1 / 212

You must sign in to post.