fix for spawnjumps?

Discussions about Coding and Scripting
OwYeaW
Average
Posts: 74
Joined: Fri Jan 09, 2015 4:24 pm

fix for spawnjumps?

Post by OwYeaW » Tue Nov 28, 2017 4:25 pm

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"?

ShaiHulud
Adept
Posts: 414
Joined: Sat Dec 22, 2012 6:37 am

Re: fix for spawnjumps?

Post by ShaiHulud » Tue Nov 28, 2017 8:57 pm

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.

User avatar
papercoffee
Godlike
Posts: 9869
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.

Re: fix for spawnjumps?

Post by papercoffee » Wed Nov 29, 2017 1:02 am

The "spawnjump bug"?
What is this?

ShaiHulud
Adept
Posts: 414
Joined: Sat Dec 22, 2012 6:37 am

Re: fix for spawnjumps?

Post by ShaiHulud » Wed Nov 29, 2017 1:40 am

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.

JackGriffin
Godlike
Posts: 3765
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: fix for spawnjumps?

Post by JackGriffin » Wed Nov 29, 2017 3:41 am

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.
So long, and thanks for all the fish

ShaiHulud
Adept
Posts: 414
Joined: Sat Dec 22, 2012 6:37 am

Re: fix for spawnjumps?

Post by ShaiHulud » Wed Nov 29, 2017 3:59 am

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.

JackGriffin
Godlike
Posts: 3765
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: fix for spawnjumps?

Post by JackGriffin » Wed Nov 29, 2017 4:35 am

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.
So long, and thanks for all the fish

User avatar
sektor2111
Godlike
Posts: 5336
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: fix for spawnjumps?

Post by sektor2111 » Wed Nov 29, 2017 6:47 am

I wanna see a "smart" fix with physics falling when you spawn in water - it will be really gorgeous...

nogardilaref
Masterful
Posts: 577
Joined: Tue Jun 20, 2017 1:00 pm
Personal rank: ⚋⚊⚌☰⚞⌖⚟☰⚌⚊⚋

Re: fix for spawnjumps?

Post by nogardilaref » Wed Nov 29, 2017 11:57 am

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.

RocketJedi
Inhuman
Posts: 822
Joined: Wed Mar 12, 2008 7:14 pm
Personal rank: I.T Master
Location: New York

Re: fix for spawnjumps?

Post by RocketJedi » Wed Nov 29, 2017 7:03 pm

this is a huge problem with bunnytrack so a mod was created called AntiSpawnJump should be on your favorite ut download site
https://www.vulpinemission.com
Image ROCKET-X8 Server
Image MONSTERHUNT w/ NALI WEAPONS 3 + RX8
Image BUNNYTRACK NY
Image SNIPER DEATHMATCH
Image InstaGib + ComboGib + Jailbreak
Image ROSEBUM ROCKET-X RB

OwYeaW
Average
Posts: 74
Joined: Fri Jan 09, 2015 4:24 pm

Re: fix for spawnjumps?

Post by OwYeaW » Wed Nov 29, 2017 8:23 pm

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)

RocketJedi
Inhuman
Posts: 822
Joined: Wed Mar 12, 2008 7:14 pm
Personal rank: I.T Master
Location: New York

Re: fix for spawnjumps?

Post by RocketJedi » Wed Nov 29, 2017 9:22 pm

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.
https://www.vulpinemission.com
Image ROCKET-X8 Server
Image MONSTERHUNT w/ NALI WEAPONS 3 + RX8
Image BUNNYTRACK NY
Image SNIPER DEATHMATCH
Image InstaGib + ComboGib + Jailbreak
Image ROSEBUM ROCKET-X RB

OwYeaW
Average
Posts: 74
Joined: Fri Jan 09, 2015 4:24 pm

Re: fix for spawnjumps?

Post by OwYeaW » Wed Nov 29, 2017 11:41 pm

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?

User avatar
sektor2111
Godlike
Posts: 5336
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: fix for spawnjumps?

Post by sektor2111 » Thu Nov 30, 2017 1:02 am

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...

OwYeaW
Average
Posts: 74
Joined: Fri Jan 09, 2015 4:24 pm

Re: fix for spawnjumps?

Post by OwYeaW » Thu Nov 30, 2017 1:39 am

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)