[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4586: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4588: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4589: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4590: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
AI Challenge Forums • View topic - Tell us your secrets, unleash your bot's code!

It is currently Fri Apr 28, 2017 6:03 pm Advanced search

Tell us your secrets, unleash your bot's code!

Share and discuss ideas for your entries here.

Re: Tell us your secrets, unleash your bot's code!

Postby Barefoot_Halibut » Wed Dec 01, 2010 7:06 pm

I would have loved to have written my bot in Scala. My bot does a lot of list/collection manipulation which would have benefited greatly from Scala's collections library. So much boilerplate in my Java code. But unfortunately I found out about the starter package way too late in the competition.
Barefoot_Halibut
Cadet
 
Posts: 4
Joined: Fri Nov 12, 2010 5:46 pm

Re: Tell us your secrets, unleash your bot's code!

Postby exaide » Wed Dec 01, 2010 8:10 pm

Name: exaide
Profile: http://ai-contest.com/profile.php?user_id=6249
Current Rank: 112
Language: Java

~1200 LOC except junit tests. Simple hill climbing algorithm combined with turn (and profit) simulation and defense planning. Think code well-commented to understand.
.
Last edited by exaide on Thu Dec 02, 2010 2:58 am, edited 1 time in total.
exaide
Cadet
 
Posts: 2
Joined: Sun Sep 19, 2010 1:05 pm

Re: Tell us your secrets, unleash your bot's code!

Postby RebelXT » Wed Dec 01, 2010 8:53 pm

exaide, I think your bot is the first open sourced bot which has test cases. Nicely done! Most of us (including me) skipped automated testing and payed pretty high price for this mistake in terms of debugging time. Lesson learned..
RebelXT
Colonel
 
Posts: 81
Joined: Fri Sep 10, 2010 2:05 pm

Re: Tell us your secrets, unleash your bot's code!

Postby bocsimacko » Wed Dec 01, 2010 10:19 pm

bocsimacko
Major
 
Posts: 36
Joined: Wed Feb 10, 2010 10:06 pm

Re: Tell us your secrets, unleash your bot's code!

Postby davidjliu » Wed Dec 01, 2010 10:32 pm

Name: davidjliu
Profile: http://ai-contest.com/profile.php?user_id=8047
Final Rank: 13
Language: python

So, what my bot essentially did was consider for an evaluation function for each planet, which was the change in the number of ships I have relative to the enemy if both of us do an all-out attack on that planet, with a horizon at the maximum distance between two planets. Then, it would carry out a hypothetical attack on that planet, and evaluate the results of that attack. If attacking the planet didn't negatively effect the evaluation function for other planets, then it would carry out the attack.

I've found that it's fairly good at opening expansions. The things that it pretty much fails at though are large-scale assaults against a lot of enemy planets, as when it takes an enemy planet, it doesn't consider the enemy taking it back so it will use the growth that the planet experiences in the future to take new planets even if the planet will be taken back next turn. It also won't take neutral planets that, after the horizon number of turns, hasn't paid itself back, which is a problem. The other issue is that I'm still using mostly the reinforcing code from a previous version of my bot, and it doesn't cooperate well with the structure in place.
Attachments
finalsubmit.zip
(33.49 KiB) Downloaded 217 times
davidjliu
Cadet
 
Posts: 7
Joined: Sun Sep 26, 2010 1:42 am

Re: Tell us your secrets, unleash your bot's code!

Postby flagcapper » Thu Dec 02, 2010 1:24 am

If anyone's interested, my messy 91st placing heuristic bot can be found here: http://flagcapper.com/?c1
flagcapper
Lieutenant
 
Posts: 10
Joined: Mon Feb 08, 2010 5:15 pm

Re: Tell us your secrets, unleash your bot's code!

Postby barabanus » Thu Dec 02, 2010 5:49 am

cpp bot v3.6 for planetwars challenge by barabanus, 2010-11-28
==================================================================================================================

Name: barabanus
Final rank: 41
Profile:

1. Each player has his own send order based on the topological index generated for each planet.
Its purpose is to send ships from backend planets first if possible. A planet gains +1 score
for each my planet it could defend and +1 score for each enemy planet it could reach before
my other planets. Lost planets (those which were conquered) are included in each side index
because of [2].

2. Each planet is assigned three values: my available ships to send, enemy ships, my reserved
ships to defend a planet. My available ships and enemy ships coexists on each lost planet,
so if my planet with 1000 ships had been conquered by enemy 2000 ships, I still have 1000 ships
on my planet, though they won't grow. In this way I could use these forces to conquer planets
(including the one I lost!) and defend.

3. Each turn consists of several phases:

a) initial plan: calculate TURNS_LIMIT (currently 35) turns ahead

b) initial plan: send ships to defend actual enemy fleets currently in the fly (<defend> order)

I assume that enemy doesn't defend his planets because:
(1) I usually send my ships number so that to cover possible enemy defence potential,
(2) If enemy could conquer (read: defend) his planet it would be taken into account
in evaluation function
(3) In this way enemy has bigger potential to conquer my another planet I could consider

c) for each plan: expand a plan by trying to conquer each enemy / neutral (<conquer> order)

The number of ships to send consider the max possible enemy defence force from nearest planets.
For neutral planets I assume that enemy is going to wait one turn to snipe it.

d) evaluate each plan

Evaluation function takes into account my ships number minus enemy ships number in TURNS_LIMIT + 100 turns.
If my planet could be conquered by enemy I assume it's lost, so the cost of a plan decreases.

e) take the best plan (initial plan might appear to be the best plan)

f) send excess ships from each planet to the planet with the greatest index (<excess> order)

In this way I get those support lines from backend planets. To check whether it's good to send
all the excess ships from the planet, I clone the plan, send those ships and evaluate the new plan.
If the new value is less than the original (e.g. enemy could conquer the planet because of
missing forces) I don't send any ship from that planet.

4. Technically the bot implementation is heavily optimized:

a) memory pool
b) power-of-two size of arrays
c) no constructors for the most used classes
d) preprocessor directives to disable debug code
e) a lot of assertions and comments

I could expand 15000 plans per second, though the most time a turn took < 0.1 sec

==================================================================================================================
Attachments
barabanus-36.zip
(21.28 KiB) Downloaded 179 times
Last edited by barabanus on Thu Dec 02, 2010 6:07 am, edited 2 times in total.
barabanus
Lieutenant-Colonel
 
Posts: 44
Joined: Fri Sep 24, 2010 6:01 am

Re: Tell us your secrets, unleash your bot's code!

Postby barabanus » Thu Dec 02, 2010 6:02 am

lua bot v1.5 for planetwars challenge by barabanus, 2010-10-19
==================================================================================

Rank: ~400

The bot is written in lua and submitted as C package with lua code.
Get time function replaced with gettimeofday() (original had been clock())
Unfortunately, contest organizers didn't support lua.

This was original bot I wrote when entered the contest. The cpp bot had been written in the last
three days before the deadline with 4 hours sleep a day =) I made a big progress in this days
from rank ~400 to 41. My problem was a perfectionism that didn't allow me to submit non-ideal bot.
Unfortunately, I hadn't too much time to improve the final version.
Attachments
barabanus-15.zip
(147.62 KiB) Downloaded 130 times
barabanus
Lieutenant-Colonel
 
Posts: 44
Joined: Fri Sep 24, 2010 6:01 am

Re: Tell us your secrets, unleash your bot's code!

Postby Xrillo » Thu Dec 02, 2010 8:49 am

Xrillo
Captain
 
Posts: 24
Joined: Fri Oct 01, 2010 8:17 am

Re: Tell us your secrets, unleash your bot's code!

Postby bocsimacko » Thu Dec 02, 2010 10:18 am

bocsimacko
Major
 
Posts: 36
Joined: Wed Feb 10, 2010 10:06 pm

PreviousNext

Return to Strategy

Who is online

Users browsing this forum: No registered users and 1 guest

cron