Inside3D!
     

Problem with DP's MOVETYPE_WALK :(

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  
Author Message
Wazat



Joined: 15 Oct 2004
Posts: 732
Location: Middle 'o the desert, USA

PostPosted: Wed Jan 19, 2005 12:23 am    Post subject: Problem with DP's MOVETYPE_WALK :( Reply with quote

I've noticed a problem with DP's MOVETYPE_WALK on non-clients feature. Actually, it took me ages and AGES of agonizing bug testing to figure out what it was, but I finally located what it is.

It turns out that the engine movement code for MOVETYPE_WALK doesn't seem to care about when you set origins. The bug cropped up for me when I tried to make a non-client respawn, and it kept on appearing either where it died, or at the same spawnpoint over and over again. Many hours later I realized it was linked to the entity's MOVETYPE_WALK. I was able to set origin fine when the entity was MOVETYPE_TOSS, but with WALK I couldn't even accurately set the origin, even when I set it a thousand or so times a second (the entity would spawn in the spot then begin to droop down below the location because of gravity, instead of constantly returning to that spot). So I'm guessing that some engine-side origin variable isn't getting set.

Thankfully I have come up with a hacky fix: set the entity's movetype to TOSS for 0.5 seconds when he respawns, then set it back to WALK afterwords. That way another movetype takes control long enough to get the offending variable reset before WALK takes over again.

However, please fix the bug soon. It's a rather ungainly fix, and MOVETYPE_WALK on non-players is going to be important in this mod. Smile
_________________
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Back to top
View user's profile Send private message MSN Messenger
Tei



Joined: 25 Oct 2004
Posts: 195

PostPosted: Wed Jan 19, 2005 12:47 am    Post subject: Re: Problem with DP's MOVETYPE_WALK :( Reply with quote

looks like the position its reset, so the code ignore the change and continue the movement...

I have to check that.

what engine?
Back to top
View user's profile Send private message
Wazat



Joined: 15 Oct 2004
Posts: 732
Location: Middle 'o the desert, USA

PostPosted: Wed Jan 19, 2005 12:54 am    Post subject: Reply with quote

Darkplaces
_________________
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Back to top
View user's profile Send private message MSN Messenger
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Wed Jan 19, 2005 10:08 am    Post subject: Reply with quote

I showed this thread to LordHavoc, and he said he's unsure what causes it, but he has a better workaround. Do this:

Code:
self.oldorigin = self.origin;


AFTER setorigin. It resets because it thinks it's in solid.
_________________
Look out for Twigboy
Back to top
View user's profile Send private message Visit poster's website
Wazat



Joined: 15 Oct 2004
Posts: 732
Location: Middle 'o the desert, USA

PostPosted: Wed Jan 19, 2005 5:07 pm    Post subject: Reply with quote

Okay, that makes sense. Just to be sure, I'll redirect the setorigin function to call setorigin_real and then update .oldorigin if the entity's movetype is WALK (as typed below, more or less). That should cover all the bases and keep me from forgetting a spot.

Thanks, Urre and LordHavoc!

Code:

void(entity e,  float org) setorigin =
{
     setorigin_real(e, org);
     if(e.movetype == MOVETYPE_WALK)
         e.oldorigin = e.origin;
};

_________________
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group