#Client-side instant response vs server confirmation

1 messages · Page 1 of 1 (latest)

jaunty elm
#

Probably option B right?

last gazelle
#

depends on ur game

#

there isnt really a right answer

jaunty elm
#

Which option is best A, B or a hybrid approach? My game is a parry based combat game where low ping is probably required anyway.

last gazelle
#

ideally client prediction is better but there are tradeoffs

jaunty elm
#

wdym

#

regardless of animation playing wont it still feel wonky if aerial attack gives a boost only after server has confirmed it is allowed so it wont match the animation

last gazelle
#

making smooth and responsive netcode is hard and if you really dont know what you are doing id say it's generally better to make your attacks server authoritative

jaunty elm
#

i already tried both approaches but i didnt see much difference in the "responsive" one

#

probably just cuz of my low ping tho

last gazelle
#

if you do client predicted attacks (so animtion instant feedback)

#

you might get descynced hits on the client

jaunty elm
#

yeah

last gazelle
#

so you view your attack finish and then the damage is delayed

#

because you don't get instant feedback

#

you also need to sync all your combat state, like stun, cds, etc and that is additional effort

#

since you need to predict the activation conditions

jaunty elm
#

its just a pushover

#

yeah

#

alr thanks

last gazelle
#

but if your attacks get activated on server, you are gonna want to add some

#

input buffering

#

if you don't, you may get somewhat long delays between attacks if high ping

#

if you request an attack from server and need to wait for a response, your interval between attacks will be the same as your ping

#

also i'd recommend client hitboxes on m1s

jaunty elm
#

asdasdhahsdah

#

everythings annoying

last gazelle
#

yeah making combat that feels good is pretty hard i'd say

jaunty elm
last gazelle
#

also if you are doing client hitboxes you're prolly gonna want a hybrid approach, so if you dont receive a hit during the duration of the attack, just perform one on the server

jaunty elm
#

hm?

last gazelle
#

and id also recommend using a custom character replicator like bettereplication or chrono since you get a bit less latency on player position (due to roblox interpolation / repliction intervals)

last gazelle
# jaunty elm hm?

if you are doing client hitboxes and a player is high ping, they may hit the player on their client after the attack is timed out

#

on the server

#

if this happens just perform the hit on the server

jaunty elm
#

oh sorry

#

yeah i alr handled taht

#

max range check on server using timestamps

grim wingBOT
#

studio** You are now Level 5! **studio

jaunty elm
#

anyways thanks for ur help

#

ill go with option b

rugged briar
#

just optimize

#

option b is the only option

#

if you need to you can use multithreading (coroutines, task.spawn, task.delay) for some parts of it

#

though you probably dont need to