Player movement informations script

Maps, modifications, add-ons, projects, and other releases for Zandronum. Also includes announcers.
Post Reply
Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

Player movement informations script

#1

Post by Klofkac » Sun Jan 06, 2013 8:50 pm

This is basically a script which displays several informations about player's movement angle (relative to angle looking) and speed.

I created this script in order to check how I am moving with my gamepad and how to tilt analog stick to properly straferun.
But after I stopped playing, I decided I could share it to others.


On the left, text informations show:
  • Player's looking angle
  • Player's speed angle
  • Player's relative angle between look and speed
  • Player's real speed
  • Player's speed on Turbo 100
  • Messages when the relative angle is very similar to forward\backward straferun\sr50 angle
  • Very aproximate announcer of player speed defined as normal speed, straferun speed and SR50 speed
All angles are in degrees.

On the right there is a simple visual information about player's speed (up to 15) and angle relative to current player's looking angle.

The script structure is made for vanilla doomguy with no actor edits and no additive aircontrol (ever noticed you go faster from jumping while running?).


Download: Script bundled in large box map (map01)

Screenshots:
[spoiler]
Image
Normal keyboard forward
Image
Straferunning
Image
Using a gamepad to move while using turbo 20
[/spoiler]
Last edited by Klofkac on Sun Jan 06, 2013 10:02 pm, edited 1 time in total.
π•‚π•π• π•—π•œπ•’π•”

one_Two
Addicted to Zandronum
Posts: 1753
Joined: Thu Jun 07, 2012 4:47 pm

RE: Player movement informations script

#2

Post by one_Two » Sun Jan 06, 2013 9:00 pm

Impressive work, reminds me of the hud displays you could get in Quake defrag. It wouldn't detect the speed properly when I manually changed the turbo though, should it have?

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

RE: Player movement informations script

#3

Post by Klofkac » Sun Jan 06, 2013 9:09 pm

The visual graph and the speed type announcer are based on counts assuming turbo is 100 (so it could show you eg. if you are straferunning while using turbo 1), but the fixed divisions and multiplies can make the number not precise (often it is just not so relevant thousandths and lower digits) but otherwise it should be properly showing on any turbo.
Last edited by Klofkac on Sun Jan 06, 2013 9:12 pm, edited 1 time in total.
π•‚π•π• π•—π•œπ•’π•”

one_Two
Addicted to Zandronum
Posts: 1753
Joined: Thu Jun 07, 2012 4:47 pm

RE: Player movement informations script

#4

Post by one_Two » Sun Jan 06, 2013 9:21 pm

Klofkac wrote: The visual graph and the speed type announcer are based on counts assuming turbo is 100 (so it could show you eg. if you are straferunning while using turbo 1), but the fixed divisions and multiplies can make the number not precise (often it is just not so relevant thousandths and lower digits) but otherwise it should be properly showing on any turbo.
Oh right gotcha, and what is it measured in, map units per second?

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

RE: Player movement informations script

#5

Post by Klofkac » Sun Jan 06, 2013 9:36 pm

one_Two wrote: What is it measured in, map units per second?
The speed is measured in map units per tick (1/35th of second).
π•‚π•π• π•—π•œπ•’π•”

one_Two
Addicted to Zandronum
Posts: 1753
Joined: Thu Jun 07, 2012 4:47 pm

RE: Player movement informations script

#6

Post by one_Two » Sun Jan 06, 2013 9:57 pm

I know you said it only works with vanilla but this would be pretty cool in jumpmaze.

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

RE: Player movement informations script

#7

Post by Klofkac » Sun Jan 06, 2013 10:01 pm

one_Two wrote: I know you said it only works with vanilla but this would be pretty cool in jumpmaze.
Jumpmaze is using vanilla player actor, so it can be used. Hovewer, the jumping in it will confuse the speed "meter" a lot, because of the skulltag's additive air control you gain speed while jumping.

EDIT: I'm going to upload a wad that has this script as library to be used with PWADs.
Last edited by Klofkac on Sun Jan 06, 2013 10:09 pm, edited 1 time in total.
π•‚π•π• π•—π•œπ•’π•”

User avatar
Γ†nima
Addicted to Zandronum
Posts: 3578
Joined: Tue Jun 05, 2012 6:12 pm

RE: Player movement informations script

#8

Post by Γ†nima » Sun Jan 06, 2013 11:21 pm

This is great for debugging purposes! Funny how you posted this several hours after I finished setting up my PS3 controller for use with Zandronum.
Reinforcements: midgame Survival joining/respawning
Doom64: Unabsolved: Doom64 + Diablo II
ZandroSkins: a pack made by our community
AeniPuffs: 3D blood and bullet puff effects, free to use for your own mods
Squad Radio: a WASD-based radio chat menu, add your own custom sounds!
Mercenaries (on hold)
Image

User avatar
Zeberpal
Forum Regular
Posts: 476
Joined: Mon Jun 04, 2012 6:55 am

RE: Player movement informations script

#9

Post by Zeberpal » Thu Jan 10, 2013 6:43 pm

Does that mean, that you can theoretically make something like Slenderman out of this?
Image ImageImage

User avatar
Combinebobnt
Retired Staff / Community Team Member
Posts: 1905
Joined: Mon Jun 04, 2012 3:37 am
Location: Earth
Contact:

RE: Player movement informations script

#10

Post by Combinebobnt » Thu Jan 10, 2013 11:22 pm

Thank you for making this, as I managed to get data on all the various speeds with a few edits to your code.
(btw jumping speeds have no aircontrol in; so it makes you go much faster)
Spoiler: The Data (Open)

Code: Select all


{FORMAT HELP}
-=Method=-
	Speed: <mapunits per tick (1/35 of a second)> (<mapunits per second>)
		β€’ Don't forget that these speed values are when you are going at the MAXIMUM velocity.
		β€’ Values are recorded to the highest decimal place given.
		β€’ Jumping speeds sway up and down as you move and jump. The speed value for a jumping modifier is the HIGHEST number.
	Average Speed: <mapunits per tick (1/35 of a second)> (<mapunits per second>)
		β€’ This is only applied to jumping. This is the average speed you move at while doing this method.
		β€’ This value is rounded to the FIRST decimal place.
-Modifier-
	(Same as above)
	
---

A few notes:
	The script to take the speed has a delay of 1 and thus the value of the 'highest speed attained' counter will usually be 0.015 lower than the true speed.
	Measures for speeds will be precisely accurate. HOWEVER, for the jump method, this will affect the measurement 'Speed', as the speed sways up and down, making the 'highest speed attained' counter the only source for a measurement. 
	Keep this 0.015 negation, on jumping, in mind.
	
	Oh yea no wallrunning data for now. Sorry.

{END FORMAT HELP}


-=Walking Forward=-
	Speed: 7.55209 (264.32315)
-While Jumping-
	Speed: 13.8275 (483.9625)
	Average Speed: 12.2 (427)
-While Crouching-
	Speed: 3.77605 (132.16175)

-=Walking Sideways=-
	Speed: 7.24989 (253.74615)
-While Jumping-
	Speed: 13.2736 (464.576)
	Average Speed: 11.7 (409.5)
-While Crouching-
	Speed: 3.625 (126.875)

-=Running Forward=-
	Speed: 15.1037 (528.6295)
-While Jumping-
	Speed: 27.6535 (967.8725)
	Average Speed: 24.4 (854)
-While Crouching-
	Speed: 7.55217 (264.32595)

-=Running Sideways=-
	Speed: 12.0831 (422.9085)
-While Jumping-
	Speed: 22.1237 (774.3295)
	Average Speed: 19.5 (682.5)
-While Crouching-
	Speed: 6.04167 (211.45845)

-=SR40=-
	Speed: 19.3351 (676.7285)
-While Jumping-
	Speed: 35.4019 (1239.0665)
	Average Speed: 31.3 (1095.5)
-While Crouching-
	Speed: 9.66739 (338.35863)

-=SR50=-
	Speed: 21.3517 (747.3095)
-While Jumping-
	Speed: 39.093 (1368.255)
	Average Speed: 34.2 (1197.0)
-While Crouching-
	Speed: 10.6757 (373.6495)
Gametics (1/35 of a second) is right. Not maptics.
Last edited by Combinebobnt on Tue Jan 15, 2013 9:48 pm, edited 1 time in total.

Klofkac
Forum Regular
Posts: 481
Joined: Sat Jun 09, 2012 1:31 pm
Location: Ask Grandvoid servers

RE: Player movement informations script

#11

Post by Klofkac » Tue Jan 15, 2013 11:25 am

Thank you for feedback.

Actually, the destination results just seem impossible, but they are real.
Make a huge room with an dormant cacodemon midair with TID 1 and add this script

Code: Select all

#include "zcommon.acs"

script 1 open
{
ChangeCamera(1,1,0);
int x = GetActorX(1);
SetActorVelocity(1,19.3351,0,0,0,0);
Delay(35);
log(s:"The destination travelled in a second with speed 19.3351 (SR40): ",f:GetActorX(1)-x);
}
The player can really move incredibly fast in maps.
Last edited by Klofkac on Tue Jan 15, 2013 11:30 am, edited 1 time in total.
π•‚π•π• π•—π•œπ•’π•”

User avatar
Combinebobnt
Retired Staff / Community Team Member
Posts: 1905
Joined: Mon Jun 04, 2012 3:37 am
Location: Earth
Contact:

RE: Player movement informations script

#12

Post by Combinebobnt » Tue Jan 15, 2013 9:46 pm

Alright I did more testing and yes it is in 1/35th. I guess I thought it was in 1/8th because the numbers seemed too big to believe back then, but when I ran the test just looking at 1024x1024 tiled squares, I did achieve 1300~ speed with sr50 jumping. Doom player physics are just that wacky fast.

Basically, I was right the first time and I'm a derp. (I'll do wallrunning speeds eventually when I feel like it)
Last edited by Combinebobnt on Tue Jan 15, 2013 9:48 pm, edited 1 time in total.

Post Reply