IndexOutOfRangeException, no idea why

Topics: Developer Forum
Jul 3, 2012 at 12:32 PM

_tree.Query(_queryCallback, ref fatAABB); IndexOutOfRangeException

in DynamicTreeBroadPhase.cs line 197

 

What does this mean?

Jul 4, 2012 at 4:39 AM
Edited Jul 4, 2012 at 5:15 AM

I guess I should explain what I'm doing.

 

I'm making a multiplayer game based around physics, and the physics simulations are entirely serverside. It's synched to the client seamlessly and whatnot. That isn't the problem, though. Somewhere, I dont know where, in my code I've obviously screwed up because I seem to get these indexOutOfRange errors. It isn't consistent, however, and it seems to happen randomly. My guess is that somewhere my code is interacting with farseer in a way that it interrupts it, but I have no idea where to start looking.

 

Below is a picture of what it looks like when it happens and where.

http://i47.tinypic.com/2j3mluh.png

 

I also often get Assertion Failed errors somewhere in DynamicTree.cs and DynamicTreeBroadPhase.cs, but I can't seem to reproduce those, because they happen randomly.

 

Note: I just realized the errors only occur when I'm creating bodies. It doesnt matter how many, it happens randomly.

Is there a time and place I should be creating bodies?

Jul 4, 2012 at 5:30 PM

Maybe your server and client are going out of sync ,also is there a specific body on which the exception occurs?

Jul 4, 2012 at 10:25 PM

I don't think that's the case, because the indexOutOfRange error happens on the server when the body is created, before anything is sent to the client.

As far as I can tell, there isn't a specific body.