#pls help me with this rabbit hole of hitboxes and cooldowns

1 messages · Page 1 of 1 (latest)

willow cedar
#

Ive gone on youtube, documentations but i can't seem to find the perfect solution to configure hitboxes. Hence, this is my last resort

I am currently doing my hitboxes and cooldowns on the server, but i just wanted to make sure that what im doing is correct b4 continuing.

My current system is structured like this

Client fires client modules based on its input
Inside of the client module:
local code runs and 2 remote events fire (cooldown and hitbox)

i made a local debounce and a server boolean to check whether its okay to start the attack (made a local debounce cuz the player can start the attack again before the server switches the boolean)

Then the cooldown event fires back and switches the local debounce

Hitbox is created on the server via the remote event and damage stuff is after the hitbox detection phase

Problem 1:
Hitbox done on the server has a lot of delay for high ping players. I've seen some other people saying do your hitboxes on the client and double check it with the server to verify???
Also some people suggest doing client predictions and server reconcilation which i've no idea of how to implement this system.
I mean like what do those combat games use, client or server.

Problem 2:
I think cooldowns should be done on the server, but Im not really sure.

It would be nice if someone could send me a system to maybe analyze and learn, i have a hard time understanding purely on words.
Pls help me 🥲

gaunt cloak
#

send script

willow cedar
#

my system is organized so theres like a bunch of modules, im just gonna send the main ones

gaunt cloak
#

mine just requires 2 scripts dude

#

and a remote

willow cedar
#

dam

#

do u still want me to send it over

#

its quite long

#

i just need the concept and framework on how u guys do it

gaunt cloak
#

im ngl

#

i just did

#
UIS.InputBegan:Connect(function(input, GPE)
  if not UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then return end
  blahblahremote:FireServer()
end```
#

theres more to it but im too lazy to type it

#

then server side

#
local M1DB={}
remote.OnServerEvent:Connect(function(player)
    if M1DB[player] then return end

    M1DB[player]=true
end)```
#

also more to it but im too lazy

#

also made hitbox in server using getpartsinbounds

willow cedar
#

oh

#

then its kinda the same iguess

willow cedar
gaunt cloak
#

bc i do server sided m1 counts n stuff

willow cedar
#

but like what if there is like ui stuff

gaunt cloak
#

such as what

willow cedar
#

uh

#

maybe a cooldown bar?

#

then i guess thats in another script

#

idk

gaunt cloak
#

i alr added mobile buttons for m1s and dashes just gotta figure out how to properly make dashes

#

a cooldown bar

#

hmm

#

id just do simple math n stuff

#

for it

willow cedar
#

what i did last time was make a value object on the server, and have the script update the ui based on it

gaunt cloak
#

i did this

gaunt cloak
#

rlly hard to make it based off of character direction (its just based off of where the mobile joystick direction goes and pc)

#

(server sided btw)

willow cedar
#

ive made one b4

#

i mean if u do it like this, doesnt the dash feel a bit stiff