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.
vAethor
Posts: 93
Joined: Wed May 10, 2017 4:10 pm

making player not accelerate/decelerate when moving

Post 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.
Nevander
Posts: 2254
Joined: Mon Jan 06, 2014 11:32 pm

Re: making player not accelerate/decelerate when moving

Post by Nevander »

Unless I am misremembering, the [wiki=Wolfenstein_3D_TC]Wolfenstein 3D TC[/wiki] was able to do this. I'd check that out and see how to reproduce it.
vAethor
Posts: 93
Joined: Wed May 10, 2017 4:10 pm

Re: making player not accelerate/decelerate when moving

Post 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..
User avatar
Caligari87
Admin
Posts: 6229
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: making player not accelerate/decelerate when moving

Post 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-)
vAethor
Posts: 93
Joined: Wed May 10, 2017 4:10 pm

Re: making player not accelerate/decelerate when moving

Post 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?
User avatar
AFADoomer
Posts: 1341
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: making player not accelerate/decelerate when moving

Post 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.
User avatar
Caligari87
Admin
Posts: 6229
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: making player not accelerate/decelerate when moving

Post 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-)
vAethor
Posts: 93
Joined: Wed May 10, 2017 4:10 pm

Re: making player not accelerate/decelerate when moving

Post 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.
Last edited by vAethor on Tue Aug 29, 2017 7:12 pm, edited 1 time in total.
User avatar
AFADoomer
Posts: 1341
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: making player not accelerate/decelerate when moving

Post by AFADoomer »

Agreed... Using Nash's package is far easier than coding it for yourself.
vAethor
Posts: 93
Joined: Wed May 10, 2017 4:10 pm

Re: making player not accelerate/decelerate when moving

Post 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!
User avatar
AFADoomer
Posts: 1341
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: making player not accelerate/decelerate when moving

Post 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);
	}
}
vAethor
Posts: 93
Joined: Wed May 10, 2017 4:10 pm

Re: making player not accelerate/decelerate when moving

Post 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.
User avatar
AFADoomer
Posts: 1341
Joined: Tue Jul 15, 2003 4:18 pm
Contact:

Re: making player not accelerate/decelerate when moving

Post 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.
User avatar
Nash
 
 
Posts: 17487
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: making player not accelerate/decelerate when moving

Post 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.
vAethor
Posts: 93
Joined: Wed May 10, 2017 4:10 pm

Re: making player not accelerate/decelerate when moving

Post 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?
Locked

Return to “Editing (Archive)”