Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (602)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (649)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [Kryonet] Getting indexOutOfBounds on Client.Update line 297  (Read 1627 times)
0 Members and 1 Guest are viewing this topic.
Offline The Boat

Junior Newbie

« Posted 2013-04-01 15:51:54 »

Hi guys,

I am working on a small client/server game using java and the Kryonet library.

I am recieving and sending packets just fine, but up to a limit it seems, but I am having a real hard time debugging this, as Eclipse really doesn't give me anything to go by.

This is the print out from the debug window:

When I look up the Client class on the google code page all I see is a closing bracket at line 297, so I am not really sure what to make of it.

If any of you have any idea about where I should start looking, it will be greatly appreciated Smiley

Offline Slyntax

Junior Devvie

Medals: 3

« Reply #1 - Posted 2013-04-01 16:02:46 »

Window -> Show View -> Console

The console window will give you a trace of what's going on. Also... Why would you go on Googles code page to find line 297 instead of just looking in your code?
Offline The Boat

Junior Newbie

« Reply #2 - Posted 2013-04-01 16:07:04 »

Unfortunately there is no output in the console :/

I went to google, because this is not some code that I wrote, and Eclipse is for some reason not able to show it to me, so I went there to find it.
All I get where the code from my own classes usually is in the debug view is a: source not found. Thats why I went to google to find out what happens at line 297.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Slyntax

Junior Devvie

Medals: 3

« Reply #3 - Posted 2013-04-01 16:30:50 »

Ah, I see. The actual Client class from the Kryonet Library is throwing the error. I thought you meant that your client class was throwing the error. I apologize.

With the information given I couldn't really tell you much other than what it's already telling you. Can you post your code?
Offline The Boat

Junior Newbie

« Reply #4 - Posted 2013-04-01 16:39:57 »

I feared it would be hard to tell anything from it, I could post my code, and I would not mind, but there is a lot of it and since I dont know where the error occurs, I cant seem to see where in the code the program was before it entered the client class and crashes, so I would not know what part to post unfortunately :/

I guess I was hoping that someone else had this error and had an idea how to start debugging it. I tried to limit the packets send, but that doesn't seem to be it.

Offline Slyntax

Junior Devvie

Medals: 3

« Reply #5 - Posted 2013-04-01 17:00:29 »

Are you sure the console isn't showing anything? If you're running the Server and the Client from Eclipse the console will switch back and forth between the 2. It's possible that it's staying on the Server's console.

To show the client console just open the debug tab and double click the client process and then click back on the console tab.

It'll most likely be called '<terminated> Main [Java Application]' or something like that since it's crashing.
Offline The Boat

Junior Newbie

« Reply #6 - Posted 2013-04-01 17:23:48 »

This is what I see, when the crash happens and I press "yes" to go in to debug view:

What you see in the background is the server running as build.

In the foreground is my client running in debug.

Does any of that help?

Offline The Boat

Junior Newbie

« Reply #7 - Posted 2013-04-01 19:24:05 »

I found it !

Okay, so it turns out it actually does not have anything to do with kryonet, but it just crashes while doing some kryonet stuff in the background, or something like that.

It turns out that it was an index out of bounds in my "unresolved moves" list that I use for client side prediction. This list is one of the things that is checked up against when I recieve packets from the server, and the crash turned out to be trivial.

I ended up pinpointing it by running the game with the play button instead of the debug button, this game me a much more useful exception that lead me to find the crash reason.

Thanks for the help anyway, I love the response time on this forum

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Jesse (14 views)
2015-07-29 04:35:27

Riven (36 views)
2015-07-27 16:38:00

Riven (18 views)
2015-07-27 15:35:20

Riven (21 views)
2015-07-27 12:26:13

Riven (12 views)
2015-07-27 12:23:39

BurntPizza (30 views)
2015-07-25 00:14:37

BurntPizza (41 views)
2015-07-24 22:06:39

BurntPizza (24 views)
2015-07-24 06:06:53

NoxInc (29 views)
2015-07-22 22:16:53

NoxInc (18 views)
2015-07-22 22:13:39
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!