digitalmars.D.learn - AI Challenge - Ants
- Marco Leise (17/17) Oct 20 2011 Hi! I've been part of the team behind http://aichallenge.org/. We just
- Jonathan M Davis (4/22) Oct 20 2011 Sounds cool, but there's actually a list specifically for announcements:...
- Marco Leise (2/27) Oct 21 2011 Thanks for mentioning it.
- maarten van damme (3/3) Oct 21 2011 great, I'm going to try it out.
- maarten van damme (7/7) Oct 22 2011 I just downloaded the starter package and it gives to following errors:
- Jesse Phillips (3/17) Oct 22 2011 I downloaded the starter pack last night and everything compiled. 2.055
- maarten van damme (3/3) Oct 23 2011 I'm noticing some problems, there are some methods missing used in the
- Jesse Phillips (6/12) Oct 23 2011 It doesn't appear to perfectly match the tutorial. I'm not sure if the
- Marco Leise (14/26) Nov 08 2011 Sorry for not checking back here. When I wrote the D starter bot, the
- maarten van damme (30/30) Nov 08 2011 I have stolen an isvisible method from the c# bot
- Marco Leise (16/46) Nov 08 2011 Nice theft, although 'offsets' should really be a field of the Ants clas...
- bearophile (4/8) Nov 08 2011 What is the message of this cryptic error, and are you able to reduce th...
- maarten van damme (5/14) Nov 09 2011 dmd: glue.c:719: virtual void FuncDeclaration::toObjFile(int):
- Marco Leise (6/28) Nov 09 2011 Try compiling all *.d source files at once with DMD 2.054 (x86_64) and -...
- Marco Leise (4/4) Nov 09 2011 Looks like issue #6395 or any of the issues linked in there:
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
Oct 20 2011
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
Oct 20 2011
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:Thanks for mentioning it.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
Oct 21 2011
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 :)
Oct 21 2011
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);
Oct 22 2011
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>
Oct 22 2011
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?
Oct 23 2011
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? 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.
Oct 23 2011
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: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. :)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? 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.
Nov 08 2011
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)
Nov 08 2011
Am 08.11.2011, 21:04 Uhr, schrieb maarten van damme <maartenvd1994 gmail.com>: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; }Nice theft, although 'offsets' should really be a field of the Ants class and not recomputed on every invocation.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)I tend to use a 'general purpose' Makefile for building, that I symlink into new projects and wait for a bigger, better build tool. Then I use the 'debug' target as the build command in DDT (Eclipse) and have an 'External Launcher' that runs gdb with the executable. The flags look like this: -w -unittest -debug -gc -L--export-dynamic. Still I mostly use writeln for debugging algorithms and in/out contracts to avoid bugs that are easy to catch there. As for the Ants game, you can add a flag to the engine, I think it was -I, that has it save bot input in a text file. If you feed that to your bot via stdin, the bot will behave exactly as during the game, but this time you can wrap it in a call to gdb, use a special debug build or add flags to your bot that enables more debugging output.
Nov 08 2011
maarten van damme: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)What is the message of this cryptic error, and are you able to reduce the code that causes it? Bye, bearophile
Nov 08 2011
dmd: glue.c:719: virtual void FuncDeclaration::toObjFile(int): Assertion `!vthis->csym' failed. Not able to reduce the code that causes it as it compiles fine here and it takes 10 minutes to upload new code and let it compile/play. 2011/11/8 bearophile <bearophileHUGS lycos.com>maarten van damme: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)What is the message of this cryptic error, and are you able to reduce the code that causes it? Bye, bearophile
Nov 09 2011
Am 09.11.2011, 18:52 Uhr, schrieb maarten van damme <maartenvd1994 gmail.com>:dmd: glue.c:719: virtual void FuncDeclaration::toObjFile(int): Assertion `!vthis->csym' failed. Not able to reduce the code that causes it as it compiles fine here and it takes 10 minutes to upload new code and let it compile/play. 2011/11/8 bearophile <bearophileHUGS lycos.com>Try compiling all *.d source files at once with DMD 2.054 (x86_64) and -O -inline -release -noboundscheck, instead of using rdmd. That is basically what the server does. You may have triggered an unresolved and strange compiler bug unless this wouldn't happen with 2.056.maarten van damme:But I have also lost interest because of a couple of shortcommings,thehell 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 todowith rdmd)What is the message of this cryptic error, and are you able to reduce the code that causes it? Bye, bearophile
Nov 09 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6395 It could actually depend on the order the source files are found and appended to the command line by the server's compile script. :-/
Nov 09 2011