[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/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 - Yet another combat approach - Matrix based

It is currently Fri Apr 20, 2018 11:41 pm Advanced search

Yet another combat approach - Matrix based

Share and discuss ideas for your entries here.

Yet another combat approach - Matrix based

Postby Weir_Doe » Mon Dec 12, 2011 10:25 am

I really appreciated reading other people's approaches in developing my own. I admit my approach is flawed, and I am working on the problem of teamwork in particular (each ant assumes other ants will help it out, but is not prepared to risk its own life to help others).

I did implement some of the ideas I read about in Memetix's viewtopic.php?f=24&t=2083 and a1k0n's viewtopic.php?f=24&t=2044 . However I found that creating lists or even iterating is far slower in my language than in theirs. Either that or they code much more tightly than I do.

Much has been said about the use of influence, and I have been trying to see if it is sufficient to merely use the influence without having to create lists of whom is fighting. My method is thus:

For simplification I used two influence grids, allies and enemies.
To create either of these influence grids I used a mask of influenced cells and added it at each ant's position, I got this idea from who ever designed the Octave starter pack. I was very impressed with the ease and fluidity with which they had updated the vision information each turn, and applied this in a very similar way to make a map of every point which an ant may attack within its next turn. The mask thus looked like this:

Mask:
0 0 1 1 1 0 0
0 1 1 1 1 1 0
1 1 1 1 1 1 1
1 1 1 1 1 1 1
1 1 1 1 1 1 1
0 1 1 1 1 1 0
0 0 1 1 1 0 0

One concession I had to make to using entirely influence information was to determine all the positions that visible enemy ants could move to. I made a grid of these positions by rotating the matrix of enemy positions through the cardinal directions (Basically diffusing their locations to all the positions they could move to).

According to the locations of food, enemy ants and hills my ants consider each of the directions open to them. When considering a location an ant checks if its enemies have influence over that position. If the enemies do have influence I unfortunately have to do some iteration (I am trying to replace this with a single matrix instead of a loop, if anyone has any ideas...).

Thankfully I don't have to iterate through every position though, only a normal combat radius around the currently considered location needs to be evaluated for a possible enemy move (using the gird of possible enemy moves). On each of the locations of a possible enemy move I compare my allies influence to the enemies influence over my ant's position.

If none of these positions are considered 'dangerous' I go ahead and move there.

Let me know if you spot any deadly flaws, or if the method downright doesn't work. I can't claim it is the best method out, but I believe it is a simple method to implement especially in a language like Octave in which so many matrix operations are available. It has done some good things to my ranking, and I hope that the other Octave users or anyone interested has some luck with it.
Weir_Doe
Cadet
 
Posts: 6
Joined: Fri Dec 09, 2011 5:35 pm

Re: Yet another combat approach - Matrix based

Postby agent_smith » Mon Dec 12, 2011 8:06 pm

I like the matrix-based approach in general, it's Octave's strength, as I was able to learn in ml-class.org. I am not sure how it could be useful further specifically in this contest, as I am no Octave expert and in Python I just iterate.
agent_smith
Colonel
 
Posts: 54
Joined: Mon Nov 28, 2011 2:28 pm

Re: Yet another combat approach - Matrix based

Postby Tortortor » Tue Dec 13, 2011 12:07 pm

I had a try with similar matrix fights.
My findings:
1) replace zero on your matrix with 1->0 gradient (0.5,0.1,...) - it help to define 'hold' and 'retreat' ants' moves
2) 'help' influence matrix from allies should be different from enemy matrix
3) based on allies matrix you can build a group from you ants and move them like groups
Tortortor
Major
 
Posts: 37
Joined: Fri Oct 21, 2011 12:10 pm



Return to Strategy

Who is online

Users browsing this forum: No registered users and 2 guests

cron