problems in q3bsp

Discuss programming in the QuakeC language.
LordHavoc
Posts: 322
Joined: Fri Nov 05, 2004 3:12 am
Location: western Oregon, USA
Contact:

Re: problems in q3bsp

Post by LordHavoc »

self.oldorigin is used by all quake engines in case the player is stuck, it teleports them back to that location, if they aren't stuck it updates it to match their .origin, so they basically get stuck on something rather than getting embedded in it when the physics breaks, it's a better behavior.

A side effect is that if you have a info_teleport_destination or info_player_deathmatch that is slightly in solid, the teleport (or spawn in) will teleport them back to their self.origin before the event in question, because the new position is "bad".

As a rule of thumb I usually assign self.oldorigin = self.origin after teleporting or spawning a player, so that it will try to unstick them in other ways rather than sending them back to where they died or whatever.

I've posted a new darkplaces build just now which should improve collisions significantly on slopes and such.
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: problems in q3bsp

Post by Cobalt »

Interesting. With the advent of tracebox, like Spike says, can be used to verify the location is not in a solid before the player spawns there. If its ok, spawn there, set that origin as oldorigin. Also as a plan "b", I assign a .ent marking it as the players last known good spawn position

I will have to check out the new release later.....


LordHavoc wrote:self.oldorigin is used by all quake engines in case the player is stuck, it teleports them back to that location, if they aren't stuck it updates it to match their .origin, so they basically get stuck on something rather than getting embedded in it when the physics breaks, it's a better behavior.

A side effect is that if you have a info_teleport_destination or info_player_deathmatch that is slightly in solid, the teleport (or spawn in) will teleport them back to their self.origin before the event in question, because the new position is "bad".

As a rule of thumb I usually assign self.oldorigin = self.origin after teleporting or spawning a player, so that it will try to unstick them in other ways rather than sending them back to where they died or whatever.

I've posted a new darkplaces build just now which should improve collisions significantly on slopes and such.
LordHavoc
Posts: 322
Joined: Fri Nov 05, 2004 3:12 am
Location: western Oregon, USA
Contact:

Re: problems in q3bsp

Post by LordHavoc »

I was actually noting that you can assign self.origin = self.origin; after doing the setorigin when spawning the player, and it will trigger the engine's internal logic for moving the player out of small obstructions.
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Re: problems in q3bsp

Post by frag.machine »

So, self.origin = self.origin triggers the "unstuck entity" code ? Neat trick, I'll add this to my code. Thanks for the tip.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
Cobalt
Posts: 445
Joined: Wed Jun 10, 2009 2:58 am
Location: New England, USA
Contact:

Re: problems in q3bsp

Post by Cobalt »

Dont you mean:

self.oldorigin = self.origin ; // ?

Im guessing the Q3bsp tree greatly reduces or eliminates this from happening? Where the player winds up in a solid for some reason....compared to normal BSP that is.
LordHavoc wrote:I was actually noting that you can assign self.origin = self.origin; after doing the setorigin when spawning the player, and it will trigger the engine's internal logic for moving the player out of small obstructions.
LordHavoc
Posts: 322
Joined: Fri Nov 05, 2004 3:12 am
Location: western Oregon, USA
Contact:

Re: problems in q3bsp

Post by LordHavoc »

Yes I meant self.oldorigin = self.origin;

q3bsp does not improve or worsen the situation - I am referring to map bugs here, where someone put a info_player_deathmatch a little bit too close to some piece of geometry and the player spawn position is thus invalid (partially in solid), the engine can attempt to fixup this position, but it won't even try if the self.oldorigin is not in solid as well.
Post Reply