[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 - Visualising AI state

It is currently Mon Jul 23, 2018 4:09 am Advanced search

Visualising AI state

Topics about starter packages, visualizer or any other third party tools.
Please submit new language requests in the Language Request Forum.

Re: Visualising AI state

Postby nateman » Fri Nov 04, 2011 1:41 am

Hey smart people, anyone want to point me in the right direction?

When I run tutorial I get the expected output but then it opens Open Office instead of the visualizer. Any suggestion on how to fix this?
(I've installed the latest Java)
Thanks.
nateman
Cadet
 
Posts: 5
Joined: Wed Nov 02, 2011 5:09 pm

Re: Visualising AI state

Postby infernalmachine » Fri Nov 04, 2011 10:13 am

Sounds like your OS has associated .html files with open office instead of with your web browser. If so, then if you're running win7 you find an html file, right click on it, choose properties in the context menu, and in the window that pops up you'll have a line near the top that says "Opens with: programName and a Change button next to it. Use the button to find your browser .exe instead of openoffice.
infernalmachine
Lieutenant-Colonel
 
Posts: 48
Joined: Fri Oct 21, 2011 2:25 pm
Location: Toronto, Canada

Re: Visualising AI state

Postby infernalmachine » Fri Nov 04, 2011 11:16 am

@ jab_bott

Thanks so much for taking the time to develop this, and for sharing it with us all. I'm finding it really useful.

As to suggestions, I'm less interested in expanding to more bots (although a simple way to ensure that a bot that writes "v" commands can have them shown, no matter their order in the arg list would be nice), and more interested in the following.

First, it would be nice to be able to switch display of the overlay on and off in the visualizer page (like the fog of war feature).

And if this was possible, then the ability to write to more than 1 channel from the bot, and the ability to switch these channels on or off individually in the visualizer, would be ideal.
infernalmachine
Lieutenant-Colonel
 
Posts: 48
Joined: Fri Oct 21, 2011 2:25 pm
Location: Toronto, Canada

Re: Visualising AI state

Postby nateman » Fri Nov 04, 2011 1:48 pm

Thanks infernalmachine,

I will try when I get home. I'm running Vista but I assume it would be similar.
nateman
Cadet
 
Posts: 5
Joined: Wed Nov 02, 2011 5:09 pm

Re: Visualising AI state

Postby jlgrall » Fri Nov 04, 2011 2:11 pm

Thanks jab_bott for your message. It led me to find the source of the problem.
Actually I have no replay file in the "game_logs" folder. This is because I use the "live" visualizer, where the game is replayed at the same time that the game is computed, using unix shell pipes to redirect output from the game to the visualizer.
The point is that when the game uses the live replay, the data sent to the visualizer is not the replay data (which can only be computed at the end of the game), but some kind of turn data in a streaming format. See the section "Streaming format" at the bottom of the game specification page. In this format, only hills, ant and food positions are sent.

Finally the solution to my problem was to add the "-R" option to the "playgame.py" command line. Now it works :)

I wish I could have been able to use the visualization in combination with my method. But I am already very happy to have visualization so I can see the minds of my ants. Thanks for your great work.
jlgrall
Lieutenant-Colonel
 
Posts: 41
Joined: Sun Oct 23, 2011 11:26 am

Re: Visualising AI state

Postby tmc » Sat Nov 05, 2011 10:43 am

I haven't tried this yet, but it looks really awesome, thanks!

But I just thought I would point out that the engine will only read 100 lines of input from the bot per 10ms, so if you try to draw a rect over each tile of the map, outputting two lines per rect, then on a large map the engine will penalise your bot several seconds. So anyone using this will probably want to change this, in get_moves on line 369 of engine.py.
tmc
Brigadier-General
 
Posts: 101
Joined: Fri Oct 28, 2011 8:42 am

Re: Visualising AI state

Postby xoposhiy » Sun Nov 06, 2011 10:21 am

One more nice picture, made by this visualizer :-)
Image

* Prefixes of all assigned paths (yellow - to food, red - to enemy hill)
* "In the battle" state of the ant (red semitransparent circles)
* Enemy hill to be attacked (two red circles)
* Movement direction of scout-ants (green) and defender-ants (blue)
Last edited by xoposhiy on Mon Nov 07, 2011 5:44 am, edited 1 time in total.
xoposhiy
Cadet
 
Posts: 7
Joined: Sun Oct 30, 2011 5:06 am

Re: Visualising AI state

Postby kirnatbkdotru » Sun Nov 06, 2011 7:19 pm

Previously the overlay drawing worked only for bot 0. Now all the bots do the drawing.
Is it possible to switch off the overlay drawings for all the bots under the fog of war?
kirnatbkdotru
Cadet
 
Posts: 7
Joined: Sat Nov 05, 2011 12:36 pm

Re: Visualising AI state

Postby jab_bott » Mon Nov 07, 2011 12:29 am

jlgrall: If you use the player_seed you can ensure deterministic behaviour of your bot. I'm not sure if you can ensure deterministic behaviour of food-spawning (but there may be an option), but you could ensure deterministic behaviour of the other bots by checking their code and fighting against only other deterministic bots (or against yourself). Anyway, the point being if you can ensure the whole game is deterministic then you could play it once and get the replay data, then play it again under the debugger to get both the visualisation and the debug state.

tmc: Using visualizer commands is only expected for playing at home while developing your bot - I assume everyone will remove them or switch them off for submitted bots. So you can increase the timeout value when using visualizer commands to get an idea of how your bot thinks, but you'll have to switch them off completely to see how fast your bot can think. You can always print debug information to stderr instead of using the visualizer if you want to check processing times for your turn with the visualizer commands off.

xoposhiy: That looks awesome! I'm really glad to see it being used like this, what do all your overlays mean? Or is that information classified? ;)

infernalmachine: I want to add a setChannel command so you can do just this - it would take a string (the channel name) as its only parameter. The main issue is how to turn these on and off in the GUI. It would be great to pre-process the output and list all channels with check-boxes next to them (for each bot), but my Javascript knowledge is minimal and I don't have much spare time at the moment. A simpler idea would be to provide a text-box for each bot and you specify a space-separated list of channels you want to see. Empty would mean all channels. This way you could turn off other bots by putting some invalid channel into it and put in valid channels (or leave blank) for the bots you want to see. It would be a pretty clunky interface, but would do the job. If anyone can do better in the Javascript please go ahead and send me a pull request to re-integrate the code to my repo.
jab_bott
Lieutenant-Colonel
 
Posts: 44
Joined: Wed Oct 26, 2011 11:55 pm

Re: Visualising AI state

Postby xoposhiy » Mon Nov 07, 2011 5:42 am

xoposhiy
Cadet
 
Posts: 7
Joined: Sun Oct 30, 2011 5:06 am

PreviousNext

Return to Starter Packages & Tools

Who is online

Users browsing this forum: No registered users and 1 guest

cron