Using the SphereCharacterController as a starting point, I modified things a bit to work with my game. All worked out well. Then, I separated the code into Client and Server project. That is when this error appeared. I create a square that is added to the space, along with the SphereCharacterController. When I collide with the box, it works out well. But when I jump while against the box, the Space.Update() throws the ArgumentOutOfRangeException with "Specified argument was out of the range of valid values. Parameter name: index". Both the client and the server will crash (if I turn on the client side prediction) at the exact same time. All the jumping code has not been modified in the SphereCharacterController. What makes this weird is that it works perfectly in the non-networked version, and all the same code is basically used.
Here is the exception details
Code: Select all
System.ArgumentOutOfRangeException was unhandled
Message=Specified argument was out of the range of valid values.
Parameter name: index
Source=BEPUphysics
ParamName=index
StackTrace:
at BEPUphysics.DataStructures.RawList`1.RemoveAt(Int32 index)
at BEPUphysics.CollisionTests.Manifolds.BoxSphereContactManifold.Remove(Int32 index)
at BEPUphysics.CollisionTests.Manifolds.BoxSphereContactManifold.Update(Single dt)
at BEPUphysics.NarrowPhaseSystems.Pairs.StandardPairHandler.UpdateCollision(Single dt)
at BEPUphysics.NarrowPhaseSystems.NarrowPhase.UpdateBroadPhaseOverlap(Int32 i)
at BEPUphysics.NarrowPhaseSystems.NarrowPhase.UpdateSingleThreaded()
at BEPUphysics.MultithreadedProcessingStage.Update()
at BEPUphysics.Space.DoTimeStep()
at BEPUphysics.Space.Update()
at GravitonServer.Levels.Level.Update() in C:\Gravity\GravitonServer\GravitonServer\GravitonServer\Levels\Level.cs:line 109
at GravitonServer.GameServer.Update() in C:\Gravity\GravitonServer\GravitonServer\GravitonServer\GameServer.cs:line 204
at GravitonServer.Game1.Update(GameTime gameTime) in C:\Gravity\GravitonServer\GravitonServer\GravitonServer\Game1.cs:line 107
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
at Microsoft.Xna.Framework.Game.Run()
at GravitonServer.Program.Main(String[] args) in C:\Gravity\GravitonServer\GravitonServer\GravitonServer\Program.cs:line 29
InnerException: