Thread overview | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
October 21, 2011 AI Challenge - Ants | ||||
---|---|---|---|---|
| ||||
Hi! I've been part of the team behind http://aichallenge.org/. We just started our next challenge about 30 minutes ago. This will be the first time that DMD 2.054 is supported there and since I've been posting on this NG a few times I though it would be a good place to make an announcement. So here is the deal: You write a program that controls a population of ants. You get a number of ant hills and explore the map with your ant horde looking for food to produce more ants and enemy ant hills that you can raze for points. There is fog-of-war and obstacles. Moving ants in groups gives them better chances to survive by outnumbering enemies. The map is on a grid and ants wrap around if they move over the edges. A match usually has between 2-8 players and is turn based. The players make their moves simultaneously within a time window of 500ms. Oh yeah and it is free to sign up and requires no previous knowledge in AI programming. Feel free to ask questions on the IRC channel #aichallenge on Freenode. - Marco |
October 21, 2011 Re: AI Challenge - Ants | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marco Leise | On Friday, October 21, 2011 06:22:43 Marco Leise wrote: > Hi! I've been part of the team behind http://aichallenge.org/. We just > started our next challenge about 30 minutes ago. > This will be the first time that DMD 2.054 is supported there and since > I've been posting on this NG a few times I though it would be a good place > to make an announcement. > > So here is the deal: You write a program that controls a population of > ants. You get a number of ant hills and explore the map with your ant > horde looking for food to produce more ants and enemy ant hills that you > can raze for points. > There is fog-of-war and obstacles. Moving ants in groups gives them better > chances to survive by outnumbering enemies. The map is on a grid and ants > wrap around if they move over the edges. A match usually has between 2-8 > players and is turn based. The players make their moves simultaneously > within a time window of 500ms. Oh yeah and it is free to sign up and > requires no previous knowledge in AI programming. > > Feel free to ask questions on the IRC channel #aichallenge on Freenode. Sounds cool, but there's actually a list specifically for announcements: digitalmars-d-announce. http://www.digitalmars.com/NewsGroup.html - Jonathan M Davis |
October 21, 2011 Re: AI Challenge - Ants | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jonathan M Davis | Am 21.10.2011, 06:31 Uhr, schrieb Jonathan M Davis <jmdavisProg@gmx.com>:
> On Friday, October 21, 2011 06:22:43 Marco Leise wrote:
>> Hi! I've been part of the team behind http://aichallenge.org/. We just
>> started our next challenge about 30 minutes ago.
>> This will be the first time that DMD 2.054 is supported there and since
>> I've been posting on this NG a few times I though it would be a good place
>> to make an announcement.
>>
>> So here is the deal: You write a program that controls a population of
>> ants. You get a number of ant hills and explore the map with your ant
>> horde looking for food to produce more ants and enemy ant hills that you
>> can raze for points.
>> There is fog-of-war and obstacles. Moving ants in groups gives them better
>> chances to survive by outnumbering enemies. The map is on a grid and ants
>> wrap around if they move over the edges. A match usually has between 2-8
>> players and is turn based. The players make their moves simultaneously
>> within a time window of 500ms. Oh yeah and it is free to sign up and
>> requires no previous knowledge in AI programming.
>>
>> Feel free to ask questions on the IRC channel #aichallenge on Freenode.
>
> Sounds cool, but there's actually a list specifically for announcements:
> digitalmars-d-announce. http://www.digitalmars.com/NewsGroup.html
>
> - Jonathan M Davis
Thanks for mentioning it.
|
October 21, 2011 Re: AI Challenge - Ants | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marco Leise Attachments:
| great, I'm going to try it out. I've been looking for something fun to do while improving programming skill for ages and this looks great :) |
October 22, 2011 Re: AI Challenge - Ants | ||||
---|---|---|---|---|
| ||||
Attachments:
| I just downloaded the starter package and it gives to following errors: ants.d -line 64: data.splitlines()=>splitlines(data) -line 65:line.strip().toLower()=>line.strip().toLower() -line 104: data.splitlines()=>splitlines(data) -line 111:tokens[0].toLower=>tolower(tokens[0]) -line 313:currentline.tolowerInPlace()=>tolowerInPlace(currentLine); |
October 22, 2011 Re: AI Challenge - Ants | ||||
---|---|---|---|---|
| ||||
Posted in reply to maarten van damme | I downloaded the starter pack last night and everything compiled. 2.055 and 2.054
On Sat, 22 Oct 2011 18:30:55 +0200, maarten van damme wrote:
> I just downloaded the starter package and it gives to following errors:
> ants.d -line 64: data.splitlines()=>splitlines(data)
> -line 65:line.strip().toLower()=>line.strip().toLower()
> -line 104: data.splitlines()=>splitlines(data)
> -line 111:tokens[0].toLower=>tolower(tokens[0])
> -line 313:currentline.tolowerInPlace()=>tolowerInPlace(currentLine);
> I just downloaded the starter package and it gives to following
> errors:<div>ants.d</div><div>-line 64:
> data.splitlines()=>splitlines(data)</div><div>-line
> 65:line.strip().toLower()=>line.strip().toLower()</div><div>-line
> 104: data.splitlines()=>splitlines(data)</div>
>
> <div>-line 111:tokens[0].toLower=>tolower(tokens[0])</div><div>-line
> 313:currentline.tolowerInPlace()=>tolowerInPlace(currentLine);</div>
|
October 23, 2011 Re: AI Challenge - Ants | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jesse Phillips Attachments:
| I'm noticing some problems, there are some methods missing used in the tutorial like "unocupied", the do_setup part and the visible method. Is this package complete or am I missing something? |
October 23, 2011 Re: AI Challenge - Ants | ||||
---|---|---|---|---|
| ||||
Posted in reply to maarten van damme | On Sun, 23 Oct 2011 16:24:09 +0200, maarten van damme wrote:
> I'm noticing some problems, there are some methods missing used in the
> tutorial like "unocupied", the do_setup part and the visible method. Is
> this package complete or am I missing something?
> I'm noticing some problems, there are some methods missing used in
> the tutorial like "unocupied", the do_setup part and the
> visible method. Is this package complete or am I missing something?
It doesn't appear to perfectly match the tutorial. I'm not sure if the tutorial is intended to have you write in the details (didn't check if the Java version provided them). But that is what I did anyway.
The one issue I've run into is trying to use the seed, details in the Random, not so random? post.
|
November 08, 2011 Re: AI Challenge - Ants | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jesse Phillips | Am 23.10.2011, 19:52 Uhr, schrieb Jesse Phillips <jessekphillips+d@gmail.com>:
> On Sun, 23 Oct 2011 16:24:09 +0200, maarten van damme wrote:
>
>> I'm noticing some problems, there are some methods missing used in the
>> tutorial like "unocupied", the do_setup part and the visible method. Is
>> this package complete or am I missing something?
>> I'm noticing some problems, there are some methods missing used in
>> the tutorial like "unocupied", the do_setup part and the
>> visible method. Is this package complete or am I missing something?
>
> It doesn't appear to perfectly match the tutorial. I'm not sure if the
> tutorial is intended to have you write in the details (didn't check if
> the Java version provided them). But that is what I did anyway.
>
> The one issue I've run into is trying to use the seed, details in the
> Random, not so random? post.
Sorry for not checking back here. When I wrote the D starter bot, the tutorial didn't exist yet and I didn't do anything with it later on except keeping it up to date with the game specs. If the Java/Python bots have this functionality it should have been added and I believe that other starter bots miss it as well. It is a bit of a mixed blessing though, because it doesn't define if a square changes its 'occupied' state when you issue an order for an ant to move onto it. The visible() function sounds nice to have though :p. It is needed to distinguish between items that went out-of-sight and those that were collected/destroyed in any case.
Funnily, after writing the visualizer, the D and Pascal starter bots and advertising the contest a bit I don't feel like participating in it any more. :)
|
November 08, 2011 Re: AI Challenge - Ants | ||||
---|---|---|---|---|
| ||||
Posted in reply to Marco Leise Attachments:
| I have stolen an isvisible method from the c# bot bool isVisible(Loc loc){ Loc[] offsets; int squares = cast(int)floor(sqrt(_viewradius2)); for (int r = -1 * squares; r <= squares; ++r){ for (int c = -1 * squares; c <= squares; ++c){ int square = r * r + c * c; if (square < _viewradius2){ Loc newLoc = {r,c}; offsets~=newLoc; } } } foreach (ant;_myAnts) { foreach (offset;offsets) { if ((ant.col + offset.col) == loc.col && (ant.row + offset.row) == loc.row) { return true; } } } return false; } But I have also lost interest because of a couple of shortcommings, the hell it is to debug that thing and when it finally compiles fine on 2 machines it gives a cryptic error about glue.c (that had something to do with rdmd) |
Copyright © 1999-2021 by the D Language Foundation