[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/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 Sat Oct 20, 2018 3:13 am Advanced search

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

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

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

Postby albert » Mon Sep 13, 2010 6:32 pm

Now, after I implemented the game engine in C++ (see ), I redid the same thing for the viewer.

For several reasons:
* The Java viewer is *incredibly* slow, it takes several seconds to load at all.
* It is also not live. It gets the full playback string at the end and loads it only at once.
* I can need it for debugging of my bot (to show additional stuff -- so I must be able to extend the viewer).

So, despite that this viewer is in C++ now (which makes it *much* faster, it just loads instantly), here some further details about it:
* It uses SDL for graphics.
* It handles the data live. I.e. when the engine has completed the first round, you already see that.

The viewer is still a bit simple. You can use Left-/Right-key to go to the previous/next game state.

There is the standalone viewer which behaves just like ShowGame.jar and there is a merged version where you have the player and the viewer in one single binary. This is not only simpler but also a bit faster.

Source code:
http://github.com/albertz/planet_wars-cpp
Last edited by albert on Thu Sep 16, 2010 5:50 pm, edited 1 time in total.
albert
Lieutenant-Colonel
 
Posts: 44
Joined: Sun Sep 12, 2010 9:11 pm

Re: Game viewer in C++

Postby Evgenius » Tue Sep 14, 2010 11:14 am

This is awesome! I wandered how to debug the games. I'll definitely try your viewer when I get back from work.
Evgenius
Major
 
Posts: 37
Joined: Fri Sep 10, 2010 10:16 am
Location: Minsk, Belarus

Re: Game viewer in C++

Postby Evgenius » Wed Sep 15, 2010 9:17 pm

Unfortunately I can't build it under Cygwin. First of all, your makefile doesn't seem to work under Windows. Second, I'm getting linker errors about some SDL functions missing despite the fact that all SDL libs are included...
Evgenius
Major
 
Posts: 37
Joined: Fri Sep 10, 2010 10:16 am
Location: Minsk, Belarus

Re: Game viewer in C++

Postby albert » Wed Sep 15, 2010 9:30 pm

I have no idea about Cygwin. But for the viewer, you should not need it.

What SDL functions are missing? You may need to link against SDLmain.
albert
Lieutenant-Colonel
 
Posts: 44
Joined: Sun Sep 12, 2010 9:11 pm

Re: Game viewer in C++

Postby DanielVonFange » Thu Sep 16, 2010 12:58 am

Awesome, albert. Do you want to post a screenshot?
DanielVonFange
Brigadier-General
 
Posts: 149
Joined: Wed Sep 08, 2010 1:15 pm

Re: Game viewer in C++

Postby Evgenius » Thu Sep 16, 2010 7:00 am

Evgenius
Major
 
Posts: 37
Joined: Fri Sep 10, 2010 10:16 am
Location: Minsk, Belarus

Re: Game viewer in C++

Postby pie_nz » Thu Sep 16, 2010 10:27 am

Attachments
visualizer.png
visualizer.png (13.25 KiB) Viewed 4612 times
pie_nz
Cadet
 
Posts: 4
Joined: Mon Sep 13, 2010 12:09 pm

Re: Game viewer in C++

Postby albert » Thu Sep 16, 2010 10:30 am

albert
Lieutenant-Colonel
 
Posts: 44
Joined: Sun Sep 12, 2010 9:11 pm

Re: Game viewer in C++

Postby DanielVonFange » Thu Sep 16, 2010 11:59 am

Thanks! Looks cool.
DanielVonFange
Brigadier-General
 
Posts: 149
Joined: Wed Sep 08, 2010 1:15 pm

Re: Game viewer in C++

Postby albert » Thu Sep 16, 2010 1:28 pm

I added the turn numbers and other stats and made some general improvements.
albert
Lieutenant-Colonel
 
Posts: 44
Joined: Sun Sep 12, 2010 9:11 pm

Next

Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 1 guest

cron