Less Slippery - but not on ice?

Requests go in THIS forum!

Less Slippery - but not on ice?

Postby Enjay » Sun Oct 10, 2021 6:41 pm

This is not a request for someone to make this - because I'm sure it would be quite an undertaking, but simply a request to find out if anyone knows of a mod that already does this.

I really like NashMove, and ZMovement is cool too but both of these have a problem with slippery/icy floors and with conveyors (etc) that carry the player.

On icy floors, the player moves more slowly than they should and there is no real hint of "slipperyness" like the player being unable to stop quickly etc. In fact, with some settings, walking on ice slows the player as if he is walking through thick sludge.

Conveyors also cause a problem - they tend to carry the player far too slowly with these mods loaded. So you can see the floor scrolling along nice and quickly while the player is moving at a much slower rate. It gets really weird of there are other things on the conveyor being carried at full speed.

So, does anyone know of a mod that gives NashMove-like rapid stopping on normal floors but still allows icy floors to seem icy and conveyors carry the player at the intended rate?

Thanks.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Less Slippery - but not on ice?

Postby Jarewill » Sun Oct 10, 2021 11:58 pm

Some time ago I actually edited NashMove to not apply on ice/low-friction sectors.
I'm sure I wanted to post about it on the forum thread, but I guess I simply forgot to do it.
Anyhow, this is the edited code:
Spoiler:

This should work with friction, though keep in mind that NashMove actually increases the player's speed twofold, so if the player walks from a normal surface to a slippery one, they will become really fast.
It probably doesn't fix the conveyor issue, so I'll see what I can do later.
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Less Slippery - but not on ice?

Postby Enjay » Mon Oct 11, 2021 3:46 am

That certainly does work with friction - and I'm sliding around so much on the icy floors now that I barely notice how much faster I am on them (though, yes, if I am running for a long distance I do build up a lot of speed - Doomguy: speed skating champion 2021).

I wonder if it would be possible to add a second check... or however it would work, so that if low friction floor conditions are encountered, the speed doubling is reverted. I've looked at the code and made a few attempts but everything that I have done has completely nullified your fix for low friction. In fact, it often seems to make ice even less slippy than it was before.

You are correct that it doesn't change things as far as conveyors are concerned.

In case it is of any use, I'm attaching a simple map that I have been using to test this. It's nothing fancy, just a plain room with a slippy area and a conveyor but it might help.
You do not have the required permissions to view the files attached to this post.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Less Slippery - but not on ice?

Postby Enjay » Mon Oct 11, 2021 4:02 am

Actually, I think I just got the speed check sorted. I *think* this is all that's needed:
Code: Select allExpand view
   if (bIsOnFloor() && Owner.GetFriction()>0.91) //if friction is above 0.91, set speed to 1.0
   {
      Owner.A_SetSpeed(1.0);
   }

I don't seem to need the viewbob section in there as well - I don't see much difference with or without it.


Foget the above. This is simpler and better.
Code: Select allExpand view
   else
   {
      Owner.A_SetSpeed(1.0);
   }

Why better? Because I noticed in a map that has air control and allows the player to spend a long time in the air (low gravity) that the player could end up moving very fast through the air (not sure why because I thought that the bIsOnFloor would catch it but it didn't seem to). Anyway, the above seems to fix both low friction sectors and the air speed issue that I noticed.

Is the above enough?

No idea how to address the conveyors though.

I have also noticed that the speed multiplier of 2 gives the player a walking/running speed that is a bit slower than the Doomguy default. Setting the speed multiplier to 2.3 instead of 2 gets a player speed that is closer to the original Doom speed. It's not perfect because I'm only measuring it quite crudely (timing how long it takes to run the length of a long corridor). Perhaps 2.3 is a tiny bit too fast? I'll tweak and test it some more. [edit]Actually, without having the actual maths behind what's going on, 2.3 does seem pretty good.[/edit]
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Less Slippery - but not on ice?

Postby Jarewill » Mon Oct 11, 2021 2:17 pm

Oh, I forgot NashMove permanently changes the player's speed.
Yes, resetting it back to 1.0 like that should fix the speed issue.

As for the conveyors, I haven't been able to find any way to detect scrolling sectors in ZScript. :shrug:
Maybe someone else knows a way.
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Less Slippery - but not on ice?

Postby Enjay » Mon Oct 11, 2021 3:04 pm

OK, well I really appreciate you looking and the help that you gave.

At the moment, I'm going with values which are a somewhat toned-down version of NashMove. I still get the floor "stickiness" but not quite as much. It's pretty much half-way between NashMove and Doom. It feels about right to me. I've obviously adjusted the speed accordingly too.

Doing the above means that the effect on conveyors is still there, but less noticeable. If someone can find a way to detect scrolling floors, that would be great but, if it can't be done, I can live with how things are at my compromised settings. Conveyors and scrolling floors are not a huge component in most Doom maps.


If I ever needed to do something map specific myself when making a map, I could probably set things up to take the Z_NashMove actor away when the player steps on a conveyor and give it back when they step off. By sheer coincidence, I was looking at something else to check if an actor exists today. So I could even do a quick check of "Does the Z_NashMove actor class exist?" before taking/giving it and then it wouldn't matter if a player had NashMove loaded or not, my conveyors would work and so would the script.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Less Slippery - but not on ice?

Postby Enjay » Mon Oct 11, 2021 5:26 pm

While I have an "Enjay learns about NashMove and ZScript" thread open, can anyone enlighten me why the the ZScript for NashMove has a check to see if the player is in pain and only applies the NashMove friction effect if the player is not in pain?

I had assumed that it was to allow monster attacks to knock the player around but I have tried with the pain check in and with it commented out. There is a bit of difference without the check, but the player still gets shoved around by enemy attacks to a certain extent - almost as much as normal in my estimation.

However, I did sometimes notice that, while under attack, I could suddenly move quite a bit quicker when the check was still in place and I assume it's because NashMove has increased my player speed but not applied the friction because my player is in its pain state.

So, I was thinking - for my purposes at least - I would try things with the pain check removed for a while and see how that works out but if it is in there for some essential reason, then it would obviously be better to not remove it.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Less Slippery - but not on ice?

Postby Enjay » Mon Oct 11, 2021 7:40 pm

Hmm... after checking a few maps, it seems that conveyors and other scrolling floors (e.g. rivers and the like) are more common than I thought.

If there is a zscript way to identify scrolling floors, then it would indeed be useful here.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Less Slippery - but not on ice?

Postby Enjay » Tue Oct 12, 2021 4:10 am

@Jarewill, can I ask, why did you go with <=0.91 as the friction value to check for? I assume this means "91% of normal friction". Was it just that it seemed like a good number? Would 0.99 work just as well or do some sectors/situations naturally have lower than 1.0 friction (and therefore 0.91 seems "safe")?

[edit]Hmmm... I've semi-answered my own question. Any value greater than 0.91 has little (or perhaps no) effect. I don't know why though.
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland

Re: Less Slippery - but not on ice?

Postby Jarewill » Tue Oct 12, 2021 10:43 am

I got that number from searching for a way to detect low friction sectors in ZScript.
As far as I know, the default friction for sectors in GZDoom is around 0.91, that's why I check for that number.
Friction higher than 0.91 would mean the player is standing on a slippery floor.

As for why higher friction value results in lower friction, there's this wiki page that explains it.
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: Less Slippery - but not on ice?

Postby Enjay » Tue Oct 12, 2021 11:05 am

Ah, that makes sense. Thank you. I'd just assumed that 100% was default. I'd vaguely remembered about the higher value=lower friction but I was actually going the wrong direction with my numbers when testing out new values. Turns out your value is bang on the money anyway. Thanks again. :)
User avatar
Enjay
Everyone is a moon, and has a dark side which he never shows to anybody. Twain
 
 
 
Joined: 15 Jul 2003
Location: Scotland


Return to Requests

Who is online

Users browsing this forum: No registered users and 0 guests