making player not accelerate/decelerate when moving

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.

making player not accelerate/decelerate when moving

Postby vAethor » Tue Aug 29, 2017 6:21 pm

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.
vAethor
 
Joined: 10 May 2017

Re: making player not accelerate/decelerate when moving

Postby Nevander » Tue Aug 29, 2017 6:39 pm

Unless I am misremembering, the Wolfenstein 3D TC was able to do this. I'd check that out and see how to reproduce it.
Nevander
Self-Banned User
 
Joined: 06 Jan 2014

Re: making player not accelerate/decelerate when moving

Postby vAethor » Tue Aug 29, 2017 6:59 pm

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..
vAethor
 
Joined: 10 May 2017

Re: making player not accelerate/decelerate when moving

Postby Caligari87 » Tue Aug 29, 2017 7:01 pm

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-)
User avatar
Caligari87
User Accounts Assistant
 
Joined: 26 Feb 2004
Discord: Caligari87#3089
Github ID: caligari87

Re: making player not accelerate/decelerate when moving

Postby vAethor » Tue Aug 29, 2017 7:07 pm

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?
vAethor
 
Joined: 10 May 2017

Re: making player not accelerate/decelerate when moving

Postby AFADoomer » Tue Aug 29, 2017 7:09 pm

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.
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: making player not accelerate/decelerate when moving

Postby Caligari87 » Tue Aug 29, 2017 7:09 pm

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-)
User avatar
Caligari87
User Accounts Assistant
 
Joined: 26 Feb 2004
Discord: Caligari87#3089
Github ID: caligari87

Re: making player not accelerate/decelerate when moving

Postby vAethor » Tue Aug 29, 2017 7:11 pm

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.
Last edited by vAethor on Tue Aug 29, 2017 7:12 pm, edited 1 time in total.
vAethor
 
Joined: 10 May 2017

Re: making player not accelerate/decelerate when moving

Postby AFADoomer » Tue Aug 29, 2017 7:12 pm

Agreed... Using Nash's package is far easier than coding it for yourself.
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: making player not accelerate/decelerate when moving

Postby vAethor » Tue Aug 29, 2017 7:13 pm

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!
vAethor
 
Joined: 10 May 2017

Re: making player not accelerate/decelerate when moving

Postby AFADoomer » Tue Aug 29, 2017 7:20 pm

Does it not have a 'source' folder or something like that?

The ACS would look like this, or similar:
Code: Select allExpand view
Script "MovementLoop" ENTER
{
   While (TRUE)
   {
      SetActorVelocity(0, 0, 0, 0, 0, 1);
      SetActorProperty(0, APROP_Speed, 8.0);
   }
}
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: making player not accelerate/decelerate when moving

Postby vAethor » Tue Aug 29, 2017 7:23 pm

AFADoomer wrote:Does it not have a 'source' folder or something like that?

The ACS would look like this, or similar:
Code: Select allExpand view
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.
vAethor
 
Joined: 10 May 2017

Re: making player not accelerate/decelerate when moving

Postby AFADoomer » Tue Aug 29, 2017 7:25 pm

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.
User avatar
AFADoomer
 
Joined: 15 Jul 2003

Re: making player not accelerate/decelerate when moving

Postby Nash » Tue Aug 29, 2017 7:30 pm

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.
User avatar
Nash
AKA Nash Muhandes! Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: making player not accelerate/decelerate when moving

Postby vAethor » Tue Aug 29, 2017 7:34 pm

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?
vAethor
 
Joined: 10 May 2017

Next

Return to Editing (Archive)

Who is online

Users browsing this forum: No registered users and 0 guests