[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 - razed hill detection

It is currently Sun Aug 18, 2019 11:46 am Advanced search

razed hill detection

Share and discuss ideas for your entries here.

razed hill detection

Postby spiderx » Tue Oct 25, 2011 1:29 am

Any way to tell that the hill has been razed already? All my ants seem to do is raze a hill and then swarm it.
spiderx
Cadet
 
Posts: 2
Joined: Sat Oct 22, 2011 8:18 pm

Re: razed hill detection

Postby GarySWest » Tue Oct 25, 2011 3:04 am

The server only passes hill information if the hill is alive (and is visible.) So, if on turn 41 you get the following line:

h 17 32 1

You know that enemy player 1 has an unrazed hill at location 17 32. If on turn 42 you don't get that line passed, and that square is still visible, then it's been razed.
GarySWest
Major
 
Posts: 34
Joined: Mon Feb 15, 2010 3:45 pm

Re: razed hill detection

Postby antimatroid » Wed Oct 26, 2011 6:30 am

An easy way to properly keep track of ant hills (and food) outside of view is as follows. I'm going to assume your hill locations are stored in a vector like the c++ starter bot, but it should be pretty similar for all languages.

1. Before you wipe your vector of ant hills between turns make a copy of it, let's call it old_ant_hill_locations.

2. At the start of the turn read the state information from the engine and update your vision information for the current turn.

3. Re-add the ant hill information from old_ant_hill_locations for any of the locations that are currently not visible.

For any location that is visible in old_ant_hill_locations, either the hill is still there and the engine just passed you information for it or the hill no longer exists and you don't need to worry.

Also, obviously, if a location is currently visible and you don't see a hill there then the hill has been razed since the location was last in view.
antimatroid
Brigadier-General
 
Posts: 126
Joined: Tue Feb 16, 2010 7:41 am

Re: razed hill detection

Postby icefox » Thu Oct 27, 2011 1:42 am

An easy and 100% sure way: If your ant is on the hill and the hill isn't yours it is razed.
icefox
Cadet
 
Posts: 9
Joined: Wed Oct 26, 2011 6:08 pm

Re: razed hill detection

Postby GarySWest » Thu Oct 27, 2011 4:06 am

GarySWest
Major
 
Posts: 34
Joined: Mon Feb 15, 2010 3:45 pm

Re: razed hill detection

Postby icefox » Thu Oct 27, 2011 4:53 pm

icefox
Cadet
 
Posts: 9
Joined: Wed Oct 26, 2011 6:08 pm


Return to Strategy

Who is online

Users browsing this forum: No registered users and 1 guest

cron