[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/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 - AI state images

It is currently Fri Dec 15, 2017 6:32 am Advanced search

AI state images

Share and discuss ideas for your entries here.

AI state images

Postby smiley1983 » Wed Dec 21, 2011 8:03 am

Here is an image of the connections between my pathfinding beacons:
beacon-pathfinding.jpg
solifugid pathfinding beacons
beacon-pathfinding.jpg (122.38 KiB) Viewed 4286 times

The green beacons are satisfied with their cached maps; the red ones will request explorers and periodic re-init of their map and connections until they are complete.

Large scale distribution of ants is done by breadth first search across these beacons, allowing many more searches of the map than could be done with a fine-grained search. Each beacon caches a list of references to its neighbors, and an array containing the path to itself.

The system is not without its problems, but it handled the 200x200 maps well when they were around.

If other people have visualizations of their AI state, I'd love to see them.
smiley1983
Colonel
 
Posts: 54
Joined: Tue Oct 05, 2010 6:28 pm

Re: AI state images

Postby J.S.F. » Wed Dec 21, 2011 10:20 am

Awesome! I wanted to something like this but I couldn't figure it out in time since I started Dec 5th during exams. On the last day I figured out a nice little algorithm but unfortunately I couldn't get the bugs out in time for submission. I've got it working now though, so at least I can use it for TCPants :)

After the orders are issued in spare time my bot links the tiles surrounding the hill to the hill using a dictionary, then links other tiles to those tiles and so on. It doesn't keep track of all possible neighbours for each tile, just the first one that it finds that is already on the list, this keeps the search time linear. Now this dictionary gets pretty big (I know cuz I print it to a log file :) ). I have a get_path method that uses the dictionary and finds a path from the hill to target. I know, I know, "what good is that? we want a path from our ant to the target!". This is the trick, the path from the hill to the target is the "bus route", all I have to do is direct the ant to the nearest "bus stop". This is done by putting each step in the path into a list(distance from ant, location), sorting the list and taking the first element. I also optimize by cutting the pathfinding short if the path ever comes within one step of the ant.

I'm experimenting with it now, so far it works very well, it's amazing to see 50 step paths from far away food that weave tightly around obstacles and end up back at the hill!
J.S.F.
Lieutenant
 
Posts: 16
Joined: Sun Dec 04, 2011 7:50 pm

Re: AI state images

Postby J.S.F. » Wed Dec 21, 2011 10:34 am

I don't have any pretty pictures but I have log files, here's a snippet:

passing: (1, 110) and (1, 101) to get_path
Path: [(9, (0, 101)), (10, (0, 102)), (9, (31, 102)), (10, (31, 103)), (9, (31, 104)), (8, (30, 104)), (9, (30, 105)), (8, (30, 106)), (7, (30, 107)), (6, (30, 108)), (5, (30, 109)), (4, (31, 109)), (3, (31, 110)), (2, (31, 111)), (3, (0, 111)), (2, (0, 112)), (3, (0, 113)), (4, (0, 114)), (5, (1, 114)), (4, (1, 115)), (5, (2, 115)), (6, (3, 115)), (7, (3, 116)), (8, (4, 116)), (9, (4, 117)), (10, (4, 118)), (11, (5, 118)), (12, (5, 119)), (13, (6, 119)), (14, (6, 120)), (15, (7, 120)), (16, (7, 121)), (17, (7, 122)), (18, (7, 123)), (19, (7, 124)), (20, (7, 125)), (21, (7, 126)), (22, (7, 127)), (23, (7, 128)), (24, (7, 129)), (25, (6, 129)), (24, (5, 129)), (23, (4, 129)), (22, (3, 129)), (21, (3, 128)), (20, (3, 127)), (19, (2, 127)), (18, (1, 127)), (17, (1, 126)), (16, (1, 125)), (15, (0, 125)), (16, (31, 125)), (17, (31, 124)), (16, (31, 123)), (15, (30, 123)), (16, (30, 122)), (15, (30, 121)), (14, (29, 121))]
Nearest bus stop: (0, 112)
returned: n
awarding points for: (0, 110) since this_direction = n
passing: (2, 111) and (1, 101) to get_path
Path: [(11, (0, 101)), (12, (0, 102)), (11, (31, 102)), (12, (31, 103)), (11, (31, 104)), (10, (30, 104)), (11, (30, 105)), (10, (30, 106)), (9, (30, 107)), (8, (30, 108)), (7, (30, 109)), (6, (31, 109)), (5, (31, 110)), (4, (31, 111)), (3, (0, 111)), (2, (0, 112)), (3, (0, 113)), (4, (0, 114)), (5, (1, 114)), (4, (1, 115)), (5, (2, 115)), (4, (3, 115)), (5, (3, 116)), (6, (4, 116)), (7, (4, 117)), (8, (4, 118)), (9, (5, 118)), (10, (5, 119)), (11, (6, 119)), (12, (6, 120)), (13, (7, 120)), (14, (7, 121)), (15, (7, 122)), (16, (7, 123)), (17, (7, 124)), (18, (7, 125)), (19, (7, 126)), (20, (7, 127)), (21, (7, 128)), (22, (7, 129)), (23, (6, 129)), (22, (5, 129)), (21, (4, 129)), (20, (3, 129)), (19, (3, 128)), (18, (3, 127)), (17, (2, 127)), (16, (1, 127)), (17, (1, 126)), (16, (1, 125)), (15, (0, 125)), (16, (31, 125)), (17, (31, 124)), (16, (31, 123)), (15, (30, 123)), (16, (30, 122)), (15, (30, 121)), (14, (29, 121))]
Nearest bus stop: (0, 112)
returned: e
awarding points for: (2, 112) since this_direction = e

The hill is at 28, 121 this gets popped off the stack to prevent them from trying to step on the hill, yo can see the last step in each path is adjacent to the hill!! map is cell_maze_p08_01 for those who need more convincing that this works :)
J.S.F.
Lieutenant
 
Posts: 16
Joined: Sun Dec 04, 2011 7:50 pm

Re: AI state images

Postby Tortortor » Wed Dec 21, 2011 5:15 pm

I have something similar which I call 'nodes':
nodes.jpg
nodes.jpg (39.35 KiB) Viewed 4205 times

Some nodes are red - they are calling for support, so more ant will go here
Nodes near my hill marked with yellow ring - ants allowed so suicide here to protect the hill
Tortortor
Major
 
Posts: 37
Joined: Fri Oct 21, 2011 12:10 pm

Re: AI state images

Postby imcmeans » Thu Dec 22, 2011 2:16 am

How did you guys do the debug rendering? I was rendering separate images so I could inspect the state of my influence maps :(
imcmeans
Cadet
 
Posts: 2
Joined: Thu Dec 22, 2011 2:15 am

Re: AI state images

Postby analyst74 » Thu Dec 22, 2011 2:43 am

analyst74
Major
 
Posts: 39
Joined: Wed Feb 17, 2010 7:45 pm

Re: AI state images

Postby imcmeans » Thu Dec 22, 2011 3:02 am

Here's my "dist to frontier" influence map (the distance travelled by a BFS started at all the points on the boundary between visible and invisible). When ants had nothing better to do (no food nearby, no enemy ants or hills either), they'd follow this gradient to the frontier. (Actually, the gradient of this mixed with the "time since seen" map, and "chance of enemy at this spot" map).

Image

It was buggy until I rendered it to an image, and I never would have realized without being able to see it. I wanted to do a "dist from my hill" map too, (you generally want to explore close to your hill first, and defend against ants close to your hill) but ran out of time.
imcmeans
Cadet
 
Posts: 2
Joined: Thu Dec 22, 2011 2:15 am

Re: AI state images

Postby Khaos » Thu Dec 22, 2011 6:57 am

Put my diffusion array output into a csv file for each turn. Load up into excel (change to r1c1 mode for grid references) and use the "conditional formatting" to create nice colour heat maps. If you size the maps correctly you can scroll through the turns and have cheap animation :)

Image
Khaos
Cadet
 
Posts: 1
Joined: Thu Dec 22, 2011 6:34 am

Re: AI state images

Postby DrClaes » Thu Dec 22, 2011 6:58 am

Imcmeans: I used a very similar method for exploration, "distanceToEdge" which was recalculated each turn, setting the distance to 0 all around the edge, then BFS flood filling the interior of explored space. I didn't like that some paths would get explored by one or two ants initially, then none at all for a long time assuming those ants didn't run into too many branching paths (as in a maze), and "fixed" / hacked that by letting previously spotted food piles increase their attractiveness linearly each turn... this drew out groups of ants in a nice distribution in all directions from my hills.
DrClaes
Lieutenant-Colonel
 
Posts: 49
Joined: Sat Oct 29, 2011 6:27 am

Re: AI state images

Postby codetiger » Thu Dec 22, 2011 7:30 am


codetiger
Lieutenant-Colonel
 
Posts: 47
Joined: Sun Aug 21, 2011 4:47 am

Next

Return to Strategy

Who is online

Users browsing this forum: No registered users and 1 guest

cron