-- [ Picked text/plain from multipart/alternative ] Is there anything that would mess that up? I tried calling UpdatePhysicsShadowToCurrentPosition(), which calls UpdateVPhysicsPosition( GetAbsOrigin(), vec3_origin, gpGlobals->frametime );
but it didn't fix the problem. The blue box shown in the above linked screenshots remained stuck under the lift. The blue box is drawn at the location IPhysicsObject::GetPosition(), while the other is drawn at the players GetAbsOrigin(). It would seem that the calling of UpdateVPhysicsPosition( GetAbsOrigin(), vec3_origin, gpGlobals->frametime ); above would bring this physics object in sync with the entity, but it doesn't seem to. Is there a specific time that function should be called? I tried calling it right after the processing of the bots user command in CPlayerInfo::RunPlayerMove( CBotCmd *ucmd ) so far. I'm tempted to call m_pParent->VPhysicsGetObject()->SetPosition( GetAbsOrigin(), vec3_angle, true ); in there as well, but I don't want to cause any additional problems. Any ideas? J On 8/22/06, Jay Stelly <[EMAIL PROTECTED]> wrote: > > It's safe to call UpdateVPhysicsPosition() directly. It's setting a > target for the player's physics controller in the next frame of physics > simulation. > > Jay > > > > -----Original Message----- > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] On Behalf Of > > Jeremy Swigart > > Sent: Tuesday, August 22, 2006 8:35 AM > > To: hlcoders@list.valvesoftware.com > > Subject: Re: [hlcoders] Physics becoming out of sync > > > > -- > > [ Picked text/plain from multipart/alternative ] Thanks the > > help. Are you having the same problem with your bots or just > > going out of your way to be helpful? Either way I appreciate > > it. On further investigation, it appears the problem is due > > to the bots user commands going through a different code > > path. AFAIK, we're supposed to be calling > > > > RunPlayerMove(&cmd); and PostClientMessagesSent(); on the bot > > controller for the bot. This works fine and all, but it > > bypasses the codepath that the players usercommand takes, > > which is CBasePlayer::ProcessUsercmds > > > > Since CBasePlayer::ProcessUsercmds doesn't get called for bots, > > AllocCommandContext() doesn't get called for bots, and > > therefor why int command_context_count = > > GetCommandContextCount(); is always 0 for bots(in > > CBasePlayer::PhysicsSimulate), and its within that loop that > > UpdateVPhysicsPosition is called. > > > > Are there any special considerations to > > UpdateVPhysicsPosition being called? > > Or can I safely call it every frame at the end of the bot > > block in CPlayerInfo::RunPlayerMove. Think, first I'll see > > what happens if I call ProcessUsercmds on the bot player > > directly. Calling UpdateVPhysics on my own feels like a dirty > > hack. I'm hesitant about doing stuff like just calling the > > function directly. IMO that's masking the symptoms of a > > potentially bigger problem. > > > > It looks like this is another problem that needs addressing > > if Valve gets around to fixing the broken bot support, as > > that is the only way to feed user commands from server plugins. > > > > On 8/22/06, Paul Peloski <[EMAIL PROTECTED]> wrote: > > > > > > -- > > > [ Picked text/plain from multipart/alternative ] Okay, > > seems like the > > > problem is in CBasePlayer::PhysicsSimulate, where the > > > UpdateVPhysicsPosition is not being called for bots. > > > > > > PhysicsSimulate is the main place where > > UpdateVPhysicsPosition is called. > > > There's also a wrapper for UpdateVPhysicsPosition called > > > UpdatePhsyicsShadowToCurrentPosition that is called sometimes, for > > > example when being pushed by your lift! > > > > > > So basically what's happening is that PhysicsSimulate is > > not updating > > > physics shadow for every game frame, but some touch events > > are calling > > > a function that moves the shadow into place. Whenever the shadow > > > moves, it wakes up, but when its idle for too long (because > > > PhysicsSimulate isnt updating it) it falls asleep. > > > > > > One way to fix this would be to override PhysicsSimulate in > > the bot's > > > entity class and make sure that UpdateVPhsyicsPosition is > > called (just > > > hack up the PhysicsSimulate from CBasePlayer so that it > > calls it under > > > the right circumstances for your bots instead of actual players) > > > > > > I hope this helps. Fortress Forever is looking terrific these days, > > > best of luck to you guys. > > > > > > Regards, > > > > > > Paul > > > -- > > > > > > _______________________________________________ > > > To unsubscribe, edit your list preferences, or view the > > list archives, > > > please visit: > > > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > > > > > > -- > > > > _______________________________________________ > > To unsubscribe, edit your list preferences, or view the list > > archives, please visit: > > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > > > > > _______________________________________________ > To unsubscribe, edit your list preferences, or view the list archives, > please visit: > http://list.valvesoftware.com/mailman/listinfo/hlcoders > > -- _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders