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: [email protected] > 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

