[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 - GameEngine/Viewer/Replay/Human/TCP in one. [updated]

It is currently Sun Jul 15, 2018 7:42 pm Advanced search

GameEngine/Viewer/Replay/Human/TCP in one. [updated]

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

Re: GameEngine/Viewer/Replay/Human/TCP in one. [updated]

Postby eburnette » Wed Oct 20, 2010 2:59 pm

Thanks for the updates. I'm getting this exception if I click too early in the graph area:

java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at deltor.AIGamePlayer.seek(AIGamePlayer.java:322)
at deltor.AIGamePlayer.seek(AIGamePlayer.java:308)
at deltor.ShipGraph$DangerMouse.setTurn(ShipGraph.java:79)
at deltor.ShipGraph$DangerMouse.mouseDragged(ShipGraph.java:72)
at java.awt.Component.processMouseMotionEvent(Unknown Source)
at javax.swing.JComponent.processMouseMotionEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)

Changing AIGamePlayer.java line 312 to:

if (turn > turnsForGame || turn < 0 || turnsForGame <= 0)

fixes it.
eburnette
Captain
 
Posts: 22
Joined: Tue Sep 14, 2010 12:57 pm

Re: GameEngine/Viewer/Replay/Human/TCP in one. [updated]

Postby delt0r » Wed Oct 20, 2010 4:13 pm

Thanks. Fix included and uploaded.
It was like that when I got here.
User avatar
delt0r
Colonel
 
Posts: 89
Joined: Sun Sep 12, 2010 8:03 am

Re: GameEngine/Viewer/Replay/Human/TCP in one. [updated]

Postby eburnette » Wed Oct 20, 2010 9:39 pm

Now on the Combat screen I'm getting this crash during playback:

Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 466, Size: 465
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at deltor.ShipGraph.paintComponent(ShipGraph.java:152)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)

And this when seeking to the end:

java.lang.IndexOutOfBoundsException: Index: 9246, Size: 9246
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at deltor.AIGamePlayer.seek(AIGamePlayer.java:319)
at deltor.AIGamePlayer.seek(AIGamePlayer.java:308)
at deltor.GameViewPanel$10.actionPerformed(GameViewPanel.java:244)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
eburnette
Captain
 
Posts: 22
Joined: Tue Sep 14, 2010 12:57 pm

Re: GameEngine/Viewer/Replay/Human/TCP in one. [updated]

Postby delt0r » Thu Oct 21, 2010 7:21 am

The first error is more or less a race condition. This is fixed, but should have been quite rare anyway. It also can be safely ignored for the most part. However i have applied a fix. So it shouldn't happen again.

I could not produce the second error even when using old save games. I have put an extra bounds check anyway that should fix the problem.

A new version is uploaded.

Thanks for the bugfixes/bugs/comments.
It was like that when I got here.
User avatar
delt0r
Colonel
 
Posts: 89
Joined: Sun Sep 12, 2010 8:03 am

Re: GameEngine/Viewer/Replay/Human/TCP in one. [updated]

Postby eburnette » Tue Oct 26, 2010 12:52 am

There's something odd about those big ship arrows. On the first move they appear in the middle of the source planet instead of just outside like they used to. Also they're a little too big. Try using the scaling factors that the javascript visualizer uses if you're not already.
eburnette
Captain
 
Posts: 22
Joined: Tue Sep 14, 2010 12:57 pm

Re: GameEngine/Viewer/Replay/Human/TCP in one. [updated]

Postby delt0r » Tue Oct 26, 2010 12:57 pm

the arrows are not perfect. I tried lots of different ways to scale. I currently use a log+constant scaling. But it was just "good enough", i didn't look up the js player so i don't know what its using. I am open to suggestions. As for "position" the position is the tip of the arrow. Big arrows will tend to have a back part behind the center of the planet.

Also for fleet position, its odd. But by design. I wanted it too match the game state accuratly. The problem with this is that fleets get a "free" turn and they have moved one turn on the turn they appear. This is the game engine design. So they appear basically one turn into their n turn trip.
It was like that when I got here.
User avatar
delt0r
Colonel
 
Posts: 89
Joined: Sun Sep 12, 2010 8:03 am

Re: GameEngine/Viewer/Replay/Human/TCP in one. [updated]

Postby Ice_Harley » Tue Oct 26, 2010 1:35 pm

Does anybody have "determinism" problem with this engine?
I mean, when i play same games with same bot on same map - i have different results.
For example, i am testing my bot against DoNothingBot (he just sends "go" every turn) on map1.
First game i win in 122 turns, having 2546 ships at the end.
Second game i win in 125 turns, having 2720 ships.
And so on... Different results each time. I didn't use random. I am playing as player 1 every time.
Ok, this can be still my bot fault, but playing on PlayGame.jar doesn't have this problem. It gives me every time same results.
Ice_Harley
Captain
 
Posts: 25
Joined: Fri Sep 17, 2010 7:14 pm

Re: GameEngine/Viewer/Replay/Human/TCP in one. [updated]

Postby Celica » Tue Oct 26, 2010 2:02 pm

Ice_Harley: Do you use random()? Or do you use sorting?
Sorting can produce different results if the key is not unique.
You can solve this by appending a unique part (i.e. planet_id).
The different results may be because JBotManager presents fleets in a different order.
Celica
Lieutenant
 
Posts: 11
Joined: Fri Sep 10, 2010 9:52 am

Re: GameEngine/Viewer/Replay/Human/TCP in one. [updated]

Postby Ice_Harley » Tue Oct 26, 2010 2:47 pm

Ice_Harley
Captain
 
Posts: 25
Joined: Fri Sep 17, 2010 7:14 pm

Re: GameEngine/Viewer/Replay/Human/TCP in one. [updated]

Postby delt0r » Tue Oct 26, 2010 9:11 pm

It was at my end. In that the fleet order could be different. This does not affect any of my bots so i didn't notice. This is now corrected, as i now use a LinkedHashMap to collapse multiple orders from the same source/destination in the same turn.

I have adjusted the sizing of the fleets a little. It turns out that my scaling method is the same. But there parameters are not directly comparable.

The new version is uploaded.
It was like that when I got here.
User avatar
delt0r
Colonel
 
Posts: 89
Joined: Sun Sep 12, 2010 8:03 am

PreviousNext

Return to Technical Issues

Who is online

Users browsing this forum: No registered users and 1 guest

cron