Page 1 of 2

fix for spawnjumps?

Posted: Tue Nov 28, 2017 4:25 pm
by OwYeaW
yo, i would like to know if theres a solid fix for the "spawnjump bug"

the "spawnjump bug" is a bug in the original UT
like it says: "spawn jump"; the player automatically jumps when spawning
even if the playerstart is high in the air, the player can still get a spawnjump

i got it partially fixed by doing this:

Code: Select all

function ModifyPlayer(Pawn Other)
{
	Other.SetPhysics(PHYS_FALLING);
it fixes the "spawnjump bug", but it has its downside:
players should be able to hold walk while spawning, and float in the air (same as when you enter a teleport with walk, and if the destination teleport is high in the air, you will float at its destination)
but because of the PHYS_FALLING, a player cant float in the air anymore

so, are there better ways to fix the "spawnjump bug"?

Re: fix for spawnjumps?

Posted: Tue Nov 28, 2017 8:57 pm
by ShaiHulud
I used the same, but it doesn't always work anyway. I've noticed that it never seems to occur on the btnet servers with the "instant respawn" feature. I've no idea why this should be so, but you can duplicate the effect by setting godmode on, and then suiciding. Perhaps an exploration of the relevant script (god/suicide) would give a clue.

Though having said that, I remember going on an ultimately fruitless search for this myself some time ago. But I was less familiar with the script library at the time.

Re: fix for spawnjumps?

Posted: Wed Nov 29, 2017 1:02 am
by papercoffee
The "spawnjump bug"?
What is this?

Re: fix for spawnjumps?

Posted: Wed Nov 29, 2017 1:40 am
by ShaiHulud
It's something you generally don't think about in any other game type, but it's of interest to BT players.

Essentially: on occasion, upon respawning - particularly if you die immediately after jumping or falling - your character will restart in the air (a small distance above the ground), even though the associated PlayerStart is at ground level.
Why is this significant? Because it takes a finite amount of time to fall, and to be able to begin moving forward. That sounds trivial, but when you're contesting for a map record where the difference in capture times might come down to a few hundredths of a second, this matter.

You can "cure" it by jumping in the air and suiciding - which has the effect of preventing a "spawnjump" on the next restart. But when you're making dozens or even hundreds of attempts at a record, this can become quite tedious. So anything that would prevent that "air spawn" would be welcome.

Re: fix for spawnjumps?

Posted: Wed Nov 29, 2017 3:41 am
by JackGriffin
Sounds like it's spawning with the wrong physics state, meaning it's not being properly reset on the restart. Shouldn't be hard to fix, just run down the attributes in the respawn protocol and see what's missing. It might be that you'll need to log the states in case the actual part that's missing is in the engine that we can't see. You can still fix it with uscript though.

Re: fix for spawnjumps?

Posted: Wed Nov 29, 2017 3:59 am
by ShaiHulud
I agree Jack. The solution proved surprisingly elusive the last time that I attempted this. But then I'm sure I missed some of the relevant properties.

One slightly hacky approach that might come to mind is a trace-to-ground, and then moving the player directly to floor level. Unfortunately this won't do because, as OwYeaw mentions, quite a few BT maps have mid-air PlayerStarts, and incorporate the initial fall as a component of the map experience.

Re: fix for spawnjumps?

Posted: Wed Nov 29, 2017 4:35 am
by JackGriffin
Times like this I really miss wormbo posting. He'd know this without having to look it up.

It might not be a bad idea to do a full flowchart of a spawning/respawning playerpawn if this is something anyone here would like to undertake. It may be something as simple as the physics is being applied too quickly and might need to be moved forward a couple of ticks to allow proper initialization. It's hard to tell without logging things out and comparing them to the spawn code.

Ah fuck...now I'm interested. I'm off next week for vacation. If no one picks this up remind me and I'll do it. I'll make a proper visual display of the algorithm.

Edit: just did a super quick look at RestartPlayer base in Info class. It assigns everything except resetting physics. It appears that physics could be preserved as Phys_Falling if the player dieded without landing and immediately respawned. Should be an easy fix, just scrub off the physics.

Re: fix for spawnjumps?

Posted: Wed Nov 29, 2017 6:47 am
by sektor2111
I wanna see a "smart" fix with physics falling when you spawn in water - it will be really gorgeous...

Re: fix for spawnjumps?

Posted: Wed Nov 29, 2017 11:57 am
by nogardilaref
I never heard or have noticed this happening ever, until it was mentioned in this topic.
Although I don't play BT much, and when I do it is already a challenge for me to finish any map at all, let alone beat records, although I understand why this might be a problem there.

As Jack said it's probably something not reset properly in terms of physics, either the state or even the Velocity, so the player keeps "jumping" or "falling" on an immediate respawn.
So one thing which comes to mind is to simply reset the player Velocity to vect(0,0,0) on respawn. Perhaps there are other variables here at play which I am not remembering about, but this might do the trick.

@ShaiHulud: you mentioned doing a trace to the ground, with the problem being mid-air spawns.
I am not sure if that would work at all if it's a physics problem at play here, but you wouldn't have any problem with mid-air spawns provided that you limited the trace to the actual player collision height (the actual CollisionHeight value, not the full one from top to bottom).
If the trace failed, you would leave it as it is, if not, you would do your magic and place the player where the player is meant to be.

Re: fix for spawnjumps?

Posted: Wed Nov 29, 2017 7:03 pm
by RocketJedi
this is a huge problem with bunnytrack so a mod was created called AntiSpawnJump should be on your favorite ut download site

Re: fix for spawnjumps?

Posted: Wed Nov 29, 2017 8:23 pm
by OwYeaW
Qwerty wrote:this is a huge problem with bunnytrack so a mod was created called AntiSpawnJump should be on your favorite ut download site
this antispawnjump mutator is not working correctly, as i explained in my first post in this thread.

the player's physics shouldnt be set to falling because that prevents the player from hanging in the air with walk ( + what Sektor mentioned)

Re: fix for spawnjumps?

Posted: Wed Nov 29, 2017 9:22 pm
by RocketJedi
OwYeaW wrote:
Qwerty wrote:this is a huge problem with bunnytrack so a mod was created called AntiSpawnJump should be on your favorite ut download site
this antispawnjump mutator is not working correctly, as i explained in my first post in this thread.

the player's physics shouldnt be set to falling because that prevents the player from hanging in the air with walk ( + what Sektor mentioned)
my bad should have read the prior posts. We have a VM version if you want to try that one? IDK if it addresses what you mentioned or not.

Re: fix for spawnjumps?

Posted: Wed Nov 29, 2017 11:41 pm
by OwYeaW
Qwerty wrote:
OwYeaW wrote:
Qwerty wrote:this is a huge problem with bunnytrack so a mod was created called AntiSpawnJump should be on your favorite ut download site
this antispawnjump mutator is not working correctly, as i explained in my first post in this thread.

the player's physics shouldnt be set to falling because that prevents the player from hanging in the air with walk ( + what Sektor mentioned)
my bad should have read the prior posts. We have a VM version if you want to try that one? IDK if it addresses what you mentioned or not.
alright no problemo, i didnt exactly mentioned that mutator, but this mutator contains the line i was talking about:

Code: Select all

function ModifyPlayer(Pawn Other)
{
   Other.SetPhysics(PHYS_FALLING);
so yea i would like to see the VM version, maybe it has improved code?

Re: fix for spawnjumps?

Posted: Thu Nov 30, 2017 1:02 am
by sektor2111
OwYeaW wrote: ...

Code: Select all

function ModifyPlayer(Pawn Other)
{
   if (!Other.Region.Zone.bWaterZone) //NEVER FALL in water unless you want to get stuck
         Other.SetPhysics(PHYS_FALLING);
   Super.ModifyPlayer(Other);
}
nogardilaref mentioned that in this engine physics are flawed. Let me see, flaws are properly done by coders, RocketX3 is relevant at this point. Jump from rocket in water and see what's going on... it's a BAD CODE there not really such a bad engine. Engine is a bit borked but not in such a Level of degradation, poor engine is trying to execute what coder was saying...

Re: fix for spawnjumps?

Posted: Thu Nov 30, 2017 1:39 am
by OwYeaW
sektor2111 wrote:

Code: Select all

function ModifyPlayer(Pawn Other)
{
   if (!Other.Region.Zone.bWaterZone) //NEVER FALL in water unless you want to get stuck
         Other.SetPhysics(PHYS_FALLING);
   Super.ModifyPlayer(Other);
}
alright, thats an improvement for the partial "spawnjump" fix, thanks

now i would like to see if theres a fix that doesnt change a player's physics to falling
so that the player still has the ability to hold walk at its spawnpoint, so the player can float in air (and even has the choice to jump out of a spawn manually)