[ACS] Do custom controls have to be server-side?

Discuss all aspects related to modding Zandronum here.
Post Reply
GrayFace
New User
Posts: 4
Joined: Sat Feb 22, 2025 3:19 am

[ACS] Do custom controls have to be server-side?

#1

Post by GrayFace » Sat Feb 22, 2025 3:28 am

I'm wondering how handling custom keys is best done. Say, a Dash key that gives player momentum in a direction where he's going. It calls an ACS script when pressed. It probably can't be a CLIENTSIDE ACS script, right? I'm not sure on this. But if it can't be, this then means that it's gonna be completely unresponsive, only happen after it bounces off of server. Is it maybe possible to call 2 scripts - one that would set player velocity on client side and one on server side? Or will it also be bad?

User avatar
TDRR
Forum Regular
Posts: 244
Joined: Thu Jun 28, 2018 9:13 pm
Location: Venezuela
Contact:

Re: [ACS] Do custom controls have to be server-side?

#2

Post by TDRR » Sat Feb 22, 2025 4:28 pm

I've tried multiple times to solve it but no, doing something like that doesn't give good results at all. This needs engine features to be properly fixed, and Q-Zandronum does provide action assignable scripts for this, and they work beautifully online. Basically they allow you to assign a script to a button (or none at all and have it be executed every tic), and that script has a special feature. It'll get called during prediction, and one parameter will let you know when that's the case. You can use this to basically do nearly any kind of custom movement and make it feel buttery smooth online.

AFAIK there's no real trick for this on vanilla Zandronum.
When I consider Your heavens, the work of Your fingers, The moon and the stars, which You have ordained; What is man that You take thought of him, And the son of man that You care for him? (Psalms 8:3-4, NASB)
My Discord tag is @tdrr, and it's my preferred contact method. I also check PMs here from time to time.
I also have a Discord server for my projects.

GrayFace
New User
Posts: 4
Joined: Sat Feb 22, 2025 3:19 am

Re: [ACS] Do custom controls have to be server-side?

#3

Post by GrayFace » Sat Feb 22, 2025 6:43 pm

TDRR wrote:
Sat Feb 22, 2025 4:28 pm
I've tried multiple times to solve it but no, doing something like that doesn't give good results at all. This needs engine features to be properly fixed, and Q-Zandronum does provide action assignable scripts for this, and they work beautifully online. Basically they allow you to assign a script to a button (or none at all and have it be executed every tic), and that script has a special feature. It'll get called during prediction, and one parameter will let you know when that's the case. You can use this to basically do nearly any kind of custom movement and make it feel buttery smooth online.

AFAIK there's no real trick for this on vanilla Zandronum.
Great! Can you link to info on it or give a code sample?

User avatar
TDRR
Forum Regular
Posts: 244
Joined: Thu Jun 28, 2018 9:13 pm
Location: Venezuela
Contact:

Re: [ACS] Do custom controls have to be server-side?

#4

Post by TDRR » Sun Feb 23, 2025 8:33 pm

GrayFace wrote:
Sat Feb 22, 2025 6:43 pm
Great! Can you link to info on it or give a code sample?
https://github.com/IgeNiaI/Q-Zandronum/ ... CS-scripts
When I consider Your heavens, the work of Your fingers, The moon and the stars, which You have ordained; What is man that You take thought of him, And the son of man that You care for him? (Psalms 8:3-4, NASB)
My Discord tag is @tdrr, and it's my preferred contact method. I also check PMs here from time to time.
I also have a Discord server for my projects.

User avatar
Ænima
Addicted to Zandronum
Posts: 3575
Joined: Tue Jun 05, 2012 6:12 pm

Re: [ACS] Do custom controls have to be server-side?

#5

Post by Ænima » Sun Feb 23, 2025 9:28 pm

Can you have a clientside script that reads the player's input, then use RequestScriptPuke to call a NET serverside script that does the actual movements?

Should be less delayed than having everything serverside but may still be slow for laggy players.
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
TDRR
Forum Regular
Posts: 244
Joined: Thu Jun 28, 2018 9:13 pm
Location: Venezuela
Contact:

Re: [ACS] Do custom controls have to be server-side?

#6

Post by TDRR » Sun Feb 23, 2025 10:56 pm

Pretty decent idea, though yes it kinda comes at the cost of making things a LOT worse for high ping players (especially if they have packet loss).
When I consider Your heavens, the work of Your fingers, The moon and the stars, which You have ordained; What is man that You take thought of him, And the son of man that You care for him? (Psalms 8:3-4, NASB)
My Discord tag is @tdrr, and it's my preferred contact method. I also check PMs here from time to time.
I also have a Discord server for my projects.

GrayFace
New User
Posts: 4
Joined: Sat Feb 22, 2025 3:19 am

Re: [ACS] Do custom controls have to be server-side?

#7

Post by GrayFace » Tue Feb 25, 2025 5:59 pm

Thanks! Looks like the only way to do it is to occupy the BT_USER1, BT_USER2 and such for each new key.
Ænima wrote:
Sun Feb 23, 2025 9:28 pm
Can you have a clientside script that reads the player's input, then use RequestScriptPuke to call a NET serverside script that does the actual movements?

Should be less delayed than having everything serverside but may still be slow for laggy players.
Shouldn't the server have input at the same time it gets the Dash key anyway? I don't get how will help on low ping or hurt on high ping.
Just for more clarity, what I have is

Code: Select all

	addmenukey "Dash" Dash
	alias Dash "pukename PBC_SideDodgeKey"
PBC_SideDodgeKey then calls GiveInventory("DoSideDodge", 1), then an ENTER scripts sees it, calls GetPlayerInput to find the direction of the dash and performs the dash.

User avatar
Ænima
Addicted to Zandronum
Posts: 3575
Joined: Tue Jun 05, 2012 6:12 pm

Re: [ACS] Do custom controls have to be server-side?

#8

Post by Ænima » Tue Feb 25, 2025 6:53 pm

My bad, I assumed that by “dash key”, you meant that you were checking to see if a player doubletapped a WASD key (via GetPlayerInput) and then altered their movement based on that, like how some fighting games treat “dash” keys.

In that case, I don’t really know how to improve it. Unless it’s a clientside script, there will always be a delay while the player waits for the server to get the puke command.
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

GrayFace
New User
Posts: 4
Joined: Sat Feb 22, 2025 3:19 am

Re: [ACS] Do custom controls have to be server-side?

#9

Post by GrayFace » Thu Feb 27, 2025 6:09 am

Ænima wrote:
Tue Feb 25, 2025 6:53 pm
My bad, I assumed that by “dash key”, you meant that you were checking to see if a player doubletapped a WASD key (via GetPlayerInput) and then altered their movement based on that, like how some fighting games treat “dash” keys.
I do that as well, in that ENTER script in case someone prefers it, although the dash key is far superior.
How would your proposal work for WASD? I don't know any details of how this all works, so I don't see a difference, to me it looks like this:
1. Nothing CLIENTSIDE: Client sends input to server, ACS script on server checks it and performs dash, dash is sent to client. Overall, ping-sized delay.
2. CLIENTSIDE ACS checks input, sends command to server. Server receives it and performs dash, dash is sent to client. Overall, also ping-sized delay.

Post Reply