Page 1 of 2

making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 6:21 pm
by vAethor
I started a simple game project that tries to recreate a more basic raycasted FPS like Wolfenstein 3D or Blake Stone. I already have a couple very basic grid-based maps made and player.ViewBob set to zero, but for that last authentic touch I need to make it so when moving forward/backward and strafing, the player is either moving or completely still, no smooth gradients in velocity.

I have a fair knowledge of DECORATE but I am not finding any code after doing research, that makes this possible. I am only guessing SetActorVelocity may be what I am looking for.

Side note: My maps are in UDMF format and I'm currently using flats as placeholder wall textures since my map geometry makes better sense to have textures be 64 x 64 instead of 128 pixels tall. If this will present any sort of problem to GZDoom upfront, or if there is any better way to do it, feel free to let me know.

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 6:39 pm
by Nevander
Unless I am misremembering, the Wolfenstein 3D TC was able to do this. I'd check that out and see how to reproduce it.

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 6:59 pm
by vAethor
I downloaded it and played it, you are correct. However all the code appears to be in pk7 files (the source pk3 only has the graphics, sounds and other resources.)

I looked up how to extract and view pk7 files. I tried 7-Zip like the Doomworld thread I found suggested, it didn't work.

I guess I'm on my own with this..

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 7:01 pm
by Caligari87
Just rename the .pk7 to .pk3. Also look up NashMove on the forums here; it sort-of does what you're requesting, or at least as close as it's possible to get in the Doom engine with how player movement is handled under-the-hood.

8-)

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 7:07 pm
by vAethor
Caligari87 wrote:Just rename the .pk7 to .pk3. Also look up NashMove on the forums here; it sort-of does what you're requesting, or at least as close as it's possible to get in the Doom engine with how player movement is handled under-the-hood.

8-)


I renamed two of the PK7s to PK3 and clicked one, it just opens Slade as if I hadn't opened any file. I switched them right back to PK7.

Also I am not finding Nashmove anywhere easily on the forums, what is it?

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 7:09 pm
by AFADoomer
vAethor wrote:I downloaded it and played it, you are correct. However all the code appears to be in pk7 files (the source pk3 only has the graphics, sounds and other resources.)

I looked up how to extract and view pk7 files. I tried 7-Zip like the Doomworld thread I found suggested, it didn't work.

I guess I'm on my own with this..


The .pk7 files are just renamed from .7z

I'll see if I can put together a quick sample when I get a chance... I think this can be done more easily in ZScript now.

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 7:09 pm
by Caligari87
Here, Nashmove is the informal name but apparently harder to search by: viewtopic.php?f=105&t=35761

I think most mods that adjust player movement to be less "slippery" use this code as a base. There's probably a simpler / more comprehensive way to do it via ZScript instead of DECORATE/ACS.

8-)

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 7:11 pm
by vAethor
I did find tzkmove.pk3, and it looks like it has everything I need. REALLY slow default speed though.

I really hope tzkmove.o doesn't have any crucial details though, since it's compiled ACS and I can't read it.

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 7:12 pm
by AFADoomer
Agreed... Using Nash's package is far easier than coding it for yourself.

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 7:13 pm
by vAethor
AFADoomer wrote:Agreed... Using Nash's package is far easier than coding it for yourself.

Ugh, TZKmove IS compiled. I don't know where to go next.

Edit: I also looked everywhere for the Nashmove ACS script and found close to nothing. I am really frustrated!

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 7:20 pm
by AFADoomer
Does it not have a 'source' folder or something like that?

The ACS would look like this, or similar:

Code: Select all

Script "MovementLoop" ENTER
{
   While (TRUE)
   {
      SetActorVelocity(0, 0, 0, 0, 0, 1);
      SetActorProperty(0, APROP_Speed, 8.0);
   }
}

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 7:23 pm
by vAethor
AFADoomer wrote:Does it not have a 'source' folder or something like that?

The ACS would look like this, or similar:

Code: Select all

Script "MovementLoop" ENTER
{
   While (TRUE)
   {
      SetActorVelocity(0, 0, 0, 0, 0, 1);
      SetActorProperty(0, APROP_Speed, 8.0);
   }
}


There are 2 tzkmoves. The non-compiled one includes the compiled one (tzkmove.o) at the beginning. Being pessimistic at the moment I assumed the meat of what I needed to know was locked away in the compile, but I can give the ACS source another look.

I don't know ACS very well, but I suppose I could play around with values and see what happens, until I get it right.

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 7:25 pm
by AFADoomer
The .o is the compiled version, yes, but the .acs (or whatever) is the original uncompiled code.

The two lines of "SetActor..." code I posted above were literally copy/pasted out of the Wolf3D TC's ACS.

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 7:30 pm
by Nash
I fixed the link on NashMove, nobody told me the link wasn't working!

And yeah I should probably rewrite that thing as a drop-in ZScript mod that works like SpriteShadows.

Re: making player not accelerate/decelerate when moving

Posted: Tue Aug 29, 2017 7:34 pm
by vAethor
Alright, I'll have a look at it. Thanks Nash.

Right now I'm experiencing that embarrassing moment where you realize you don't know nearly as much about scripting as you thought you did.

Edit: I searched "Nash" on the forums and STILL can't find an easy way to access his ACS source. Can I get a link?