Page 1 of 1
[ACS] Do custom controls have to be server-side?
Posted: Sat Feb 22, 2025 3:28 am
by GrayFace
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?
Re: [ACS] Do custom controls have to be server-side?
Posted: Sat Feb 22, 2025 4:28 pm
by TDRR
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.
Re: [ACS] Do custom controls have to be server-side?
Posted: Sat Feb 22, 2025 6:43 pm
by GrayFace
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?
Re: [ACS] Do custom controls have to be server-side?
Posted: Sun Feb 23, 2025 8:33 pm
by TDRR
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
Re: [ACS] Do custom controls have to be server-side?
Posted: Sun Feb 23, 2025 9:28 pm
by Ænima
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.
Re: [ACS] Do custom controls have to be server-side?
Posted: Sun Feb 23, 2025 10:56 pm
by TDRR
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).
Re: [ACS] Do custom controls have to be server-side?
Posted: Tue Feb 25, 2025 5:59 pm
by GrayFace
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.
Re: [ACS] Do custom controls have to be server-side?
Posted: Tue Feb 25, 2025 6:53 pm
by Ænima
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.
Re: [ACS] Do custom controls have to be server-side?
Posted: Thu Feb 27, 2025 6:09 am
by GrayFace
Æ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.