[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 - Game viewer in C++ (also player&viewer merged together)

It is currently Thu Sep 20, 2018 6:05 am Advanced search

Game viewer in C++ (also player&viewer merged together)

Code won't compile? Found a bug? Post here!

Re: Game viewer in C++

Postby gerard » Thu Sep 16, 2010 4:37 pm

Hi albert,

Do you have any extra features planned for the viewer? I modified the original ShowGame.jar so it would display my debugging logs for the current turn. I would love that feature in this visulizer ^^. If you don't want to do it (position that you are in your right to hold :P), I might give it a shot at some point and fork it from you, but it's going to take some time for me since I'm not too much into SDL or any other gui toolkit (or maybe I use the canvas, I'm not sure yet)

BTW, here is the patch to get the logs on ShowGame.jar. The code is probably awful since I usually don't touch Java with a 10 foot pole :D


Oh, and excellent work, albert. Thanks to the new engine I can batch test faster :)
gerard
Cadet
 
Posts: 7
Joined: Mon Sep 06, 2010 5:25 pm

Re: Game viewer in C++

Postby albert » Thu Sep 16, 2010 4:48 pm

Yea I was planning something like this. I want to be able to attach debug information to each fleet/planet for each turn and also possibly some global debug info per turn.

Not exactly sure though in what way yet. Maybe I extend the viewer protocol and the bot protocol and I get that extra information when I start my bot with -debug. Or to make it simpler and faster, I may merge the viewer and the player together (which is quite simple actually with my code now and will make it really a bit faster).

I will leave a message here once I did sth like that.
albert
Lieutenant-Colonel
 
Posts: 44
Joined: Sun Sep 12, 2010 9:11 pm

Re: Game viewer in C++

Postby gerard » Thu Sep 16, 2010 5:32 pm

gerard
Cadet
 
Posts: 7
Joined: Mon Sep 06, 2010 5:25 pm

Re: Game viewer in C++

Postby albert » Thu Sep 16, 2010 5:51 pm

Ok, I merged it together. :)

Now it is easy to extend it to show debugging information. I only need to extend the bot protocol and can show it then directly in the merged version. Will do that soon.
albert
Lieutenant-Colonel
 
Posts: 44
Joined: Sun Sep 12, 2010 9:11 pm

Re: Game viewer in C++ (also player&viewer merged together)

Postby albert » Sat Sep 18, 2010 3:49 am

Hey gerard, I have such a solution now (solved in a bit different way which was even simpler and better). Read .
albert
Lieutenant-Colonel
 
Posts: 44
Joined: Sun Sep 12, 2010 9:11 pm

Re: Game viewer in C++ (also player&viewer merged together)

Postby hexist » Mon Sep 20, 2010 12:51 am

hexist
Cadet
 
Posts: 9
Joined: Sat Feb 06, 2010 5:14 am

Re: Game viewer in C++ (also player&viewer merged together)

Postby albert » Mon Sep 20, 2010 2:41 am

Thanks. :)

I added that include.
albert
Lieutenant-Colonel
 
Posts: 44
Joined: Sun Sep 12, 2010 9:11 pm

Re: Game viewer in C++ (also player&viewer merged together)

Postby wh1teside » Mon Sep 20, 2010 1:41 pm

albert, I love the game viewer and I use it every day. My system specs render the official HTML canvas viewer unresponsive after about 20 turns, and the Java viewer isn't too pretty (and also hard on my RAM), so yours is a godsend.

Now that I've got that out of the way :) I have one tiny problem with the keyboard stepping. When I press the left arrow key, the ships all fly back one turn like they're supposed to. When I press the forward arrow key, however, the turn doesn't always increment like it's supposed to; sometimes it does and the ships smoothly animate forward, while other times it doesn't, and the ships move forward a little before snapping back into place. It happens for about half of the forward keypresses, and takes anywhere up to 4 key presses to get unstuck from the turn. This doesn't occur when the visualizer is running freely. It doesn't seem like anyone else has mentioned this, so hopefully I'm not the only person seeing this problem!

I still wanted to use your viewer to debug my bots in the meantime, so I applied a quick workaround: in the viewer.cpp HandleEvent SDL_KEYDOWN, I simply added

case SDL_KEYDOWN:
if(!pressedAnyKey) { viewer.offsetToGo %= 1; viewer.dtForAnimation = 100; viewer.withAnimation = false; }

pressedAnyKey = true;
switch(event.key.keysym.sym) {
case SDLK_LEFT: viewer.last(); break;
case SDLK_RIGHT: viewer.next(); break;
case SDLK_q: return false;
default: break; // ignore
}
break;

to bypass the smooth animation forward bug when I'm manually stepping between turns.
wh1teside
Cadet
 
Posts: 3
Joined: Mon Sep 20, 2010 1:11 pm

Re: Game viewer in C++ (also player&viewer merged together)

Postby theli_ua » Mon Sep 20, 2010 2:36 pm

well, i wrote a process.cpp implementation for native windows

i'll upload patch and solution/project files for visual studio when i'm done with viewer and example bots :-/
theli_ua
Lieutenant
 
Posts: 14
Joined: Tue Sep 14, 2010 7:45 am

Re: Game viewer in C++ (also player&viewer merged together)

Postby theli_ua » Mon Sep 20, 2010 3:36 pm

here is a patch and win32 implementation of process class and also visual studio solution and project files for playgame and showgame


note:
Process::readLine
does not handle any timeouts and also blocks
Attachments
win32patch.zip
(26.33 KiB) Downloaded 126 times
theli_ua
Lieutenant
 
Posts: 14
Joined: Tue Sep 14, 2010 7:45 am

PreviousNext

Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 2 guests

cron