Player class that won't slide on slopes

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
ZZYZX
 
 
Posts: 1383
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine

Player class that won't slide on slopes

Post by ZZYZX »

bleeding edge zscript research center proudly presents to you this script :D

http://www.mediafire.com/file/yqwd453t5 ... Player.pk3
Example map provided.

This tries to fix two issues:
1) player's movement is directly connected to velocity and as such the player will slide passively while not moving.
2) player's hitbox makes the view noticeably jump when walking on steep slopes, thus breaking smooth slope terrain.

Instead, introduced two new issues :D
1) transition through steep ledges is not smooth anymore.
2) steep ledges are actually broken (see the 40px dropoff on the example map - you can lag while walking on top, or try to run into the wall and your view will be stomped into the floor).

Both are due to the fact that the real hitbox of the player is 2px wide while processing movement. idk, might even fix eventually, still thinking about it. But help is welcome.
The whole code is pretty fucked up. I don't understand how half of it works. 3am programming.
Last edited by ZZYZX on Fri Jul 21, 2017 6:03 pm, edited 2 times in total.
User avatar
Major Cooke
Posts: 8144
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Player class that won't slide on slopes

Post by Major Cooke »

On top of that, it doesn't respect NOGRAVITY oddly enough... I have a player actor which is using +FLOORHUGGER and +NOGRAVITY in the hopes it would actually ignore the sliding stuff, but no. It doesn't.
User avatar
ZZYZX
 
 
Posts: 1383
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine

Re: Player class that won't slide on slopes

Post by ZZYZX »

Fixed:
- player could not pick up items
- player would fall into pits where he normally should stand on (radius wise); slopes still work?
- walking into a wall/slope was causing weird effects on the camera
- MaxStepHeight issues (I believe)

Not fixed: instant camera jump when moving on stairs.
User avatar
Nash
 
 
Posts: 17394
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Player class that won't slide on slopes

Post by Nash »

In my game, I modified ORIG_FRICTION constant in the engine to make non-slidey player movement, which is the easiest fix without mucking with scripting (since it's a standalone game anyway), but then, I quickly discovered movement on slopes becomes worse because it makes the players slide very fast, especially when you're standing on the lines between triangles.

I'll have to check this out, thanks for putting this together.
User avatar
ZZYZX
 
 
Posts: 1383
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine

Re: Player class that won't slide on slopes

Post by ZZYZX »

If you disable friction entirely, it'll break other actors and additionally break sliding when the player is not moving (i.e. propelled by something else). I just tried to make it so that the player only slides when the move is not caused by the player itself.
User avatar
Nash
 
 
Posts: 17394
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Player class that won't slide on slopes

Post by Nash »

I didn't disable it entirely... I changed the value from (0xE800/65536.) to (0xAE00/65536.) :D It feels just "right" for my gameplay so w/e I guess =P
User avatar
ZZYZX
 
 
Posts: 1383
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine

Re: Player class that won't slide on slopes

Post by ZZYZX »

Updated >_>
Fixed weird issue where it would get stuck on MAP02 if trying to step up between sectors (e.g. if moving forward at this angle: http://i.imgur.com/Zo1zGpA.png).
Not going to fix the camera jumping issue, not sure if it's possible to fix easily. Probably some magic with ViewHeight might help, but from my experience doing anything to ViewHeight results in broken behavior.

Return to “Editing (Archive)”