#Input handling issue

1 messages Β· Page 1 of 1 (latest)

vivid grail
#

Welp, im having an issue with my input handler

#

code ^^

#

im aware of the fact that i have the attack attribute ( skilldebounce ) to be set to true for the attack duration - 0.1, but still i think it should not be happening

vivid grail
# vivid grail

(yes i did use ai to figure out where the fuck the problem is... no success tho) 🏳️

marble willow
marble willow
#

is this client

#

are you doing these client

#

😭

vivid grail
#

yeah

#

its an input handler

#

which

#

sucks

#

cuz ofc i had to use ai to try to fix the issue

#

which it didnt

#

@marble willow

marble willow
#

why are you doing debounce in input handler

#

is my question

vivid grail
marble willow
#

do you have rollback

#

when client predicts wrong

vivid grail
#

nope

marble willow
#

then how did you make this client sided

#

you need to rollback the ability

#

or the action

#

if client predicts wrong

#

like what happens if I activate an ability when server saw me as stunned

vivid grail
#

look, on the client i set ClientAction

#

on server is SkillDebounce

marble willow
#

aside from that

#

whats the issue

vivid grail
#

they do an additional check

marble willow
#

they check for cooldown

#

that's what I meant

vivid grail
#

you can parry

#

mid holding m1

#

if you spam F

#

i dont want to add blocking cd

marble willow
#

yeah I can see

#

but your code literally allows it

vivid grail
#

nor adding fake delay to make blocking just not show up

vivid grail
marble willow
#

yeah when you do

#

you can parry

#

simple

#

nothing looks out of ordinary here

vivid grail
#
    --// Main Task Thread
    Tasks = task.spawn(function()

        Packets.ReplicateRemote:Fire(
            {Skill = "Punch", Function = "Effects"},
            "M1",
            character,
            module.Combo[character]
        )

        --task.delay(Prehit - Sync, function()
        --    module.PreHit(player, character)
        --end)

        task.delay(Hitreg - Sync, function()
            module.Hit(player, character)
        end)

        task.delay(
            AnimManager:GetLength(character, Animation) - 0.07- Sync,
            function()
                module.End(player, character)
                stunConnection:Disconnect()
            end
        )
    end)

    --// Combo Reset Timer
    task.spawn(function()
        local oldCombo = module.Combo[character]
        task.wait(module.ResetCD)

        if oldCombo == module.Combo[character] then
            module.Combo[character] = 0
        end
    end)

    --// Auto Reset at 5
    if module.Combo[character] == 5 then
        module.Combo[character] = 0
        return
    end

thats a snippet of the punch code

#

( m1 )

marble willow
vivid grail
#

i like threads

marble willow
#

start using animation events what the hell

vivid grail
#

i do use them

#

but not in all cases

#

cuz

#

let me explain

#

what i do is

#

i play anim on client

#

and send 1 event to the server

#

to start the skill on server ( with server checks )

#

and what it does, is get the time to each animation event

#

of a specific animation

#

and i use delays to match the client animation

#

i do this so i wont have to send a ton of events

#

while keeping it synced

#

if an exploiter starts the skill

#

it will only play the animation

#

and nothing else is going to continue

#

which means it wont affect anyone else

marble willow
#

that is cooked

#

how are you getting animation marker time positions

vivid grail
#

that i actually coded 80% of it

#

which im proud of

#

🫑

marble willow
#

πŸ’”

#

how

#

are you using clipprovider

vivid grail
#

but i removed it for a certein reason i dont even remember

marble willow
#

you know that your game can fail fully

#

if the service goes down

#

happened to me once

vivid grail
marble willow
#

outage lasted 6 hours

vivid grail
#

i never have any issue

marble willow
#

there's a chance

vivid grail
#

had*

marble willow
#

there's a chance

vivid grail
#

what could happen?

#

the only thing that isnt failsafe is when you dont init the system

#

and then ofcourse it break

#

breaks*

#

my grammer sucks today

marble willow
#

KeyframeSequenceProvider can be down

#

and when it is

#

your whole game fails

#

Im not even joking

vivid grail
marble willow
#

yup

vivid grail
#

tf is roblox doing

marble willow
#

happened to me once

vivid grail
#

giving a feature

marble willow
#

I had to scrap the entire system

vivid grail
#

bruh

#

/:

#

we getting to stone age

marble willow
#

the outage lasted hours

#

the game was down

#

I couldnt use any skills

#

deadass

vivid grail
#

yeah i get it

marble willow
#

it's crazy

#

roblox should have a feature to preload this shit

#

and publish it with the game itself

#

like wtf is clipproviderservice

#

or keyframesequenceprovider

vivid grail
#

dang

#

so my whole system

#

is just cooked

marble willow
#

I mean

vivid grail
#

and

marble willow
#

there's a chance

vivid grail
#

i have to retry to make the same game

marble willow
#

a very slim one

vivid grail
#

for the 12th time

marble willow
#

I would say

#

just keep going with this

#

and then make a preload system

#

like run a script to preload them as attributes

#

or smt like that

#

so you dont need to trash the entire game

#

only this part

vivid grail
#

how tf am i supposed to do that when im struggling to

#

make a working m1 and block system

#

😭

marble willow
#

😭

#

it's really simple gng

#

I did that

marble willow
#

after the outage was over

marble willow
#

you're already guilty of this

sick drift
#

Just give him cooldown manager

sick drift
#

I use cooldown manager

marble willow
#

good good

#

oh

#

the one I sent you

#

ye ye

#
--!strict

export type CooldownManager = {
    Cooldowns: {[string]: {Duration: number, Start: number}},
    Destroyed: boolean,

    SetCooldown: (self: CooldownManager, name: string, duration: number) -> (),
    IsOnCooldown: (self: CooldownManager, name: string) -> boolean,
    ResetCooldown: (self: CooldownManager, name: string) -> (),
    ClearCooldowns: (self: CooldownManager) -> (),
    Destroy: (self: CooldownManager) -> (),
}

local CooldownManager = {}

function CooldownManager.new(): CooldownManager
    local self: CooldownManager = {} :: any
    self.Destroyed = false
    self.Cooldowns = {}

    self.SetCooldown = function(self: CooldownManager, name: string, duration: number)
        assert(not self.Destroyed, "CooldownManager already destroyed.")
        assert(duration >= 0, "Cooldown can't be negative.")
        self.Cooldowns[name] = {Duration = duration, Start = os.clock()}
    end

    self.IsOnCooldown = function(self: CooldownManager, name: string): boolean
        assert(not self.Destroyed, "CooldownManager already destroyed.")
        local cd = self.Cooldowns[name]
        if not cd then return false end
        local delta = os.clock() - cd.Start
        if delta >= cd.Duration then
            self.Cooldowns[name] = nil
            return false
        end
        return true
    end

    self.ResetCooldown = function(self: CooldownManager, name: string)
        assert(not self.Destroyed, "CooldownManager already destroyed.")
        if not self.Cooldowns[name] then return end
        self.Cooldowns[name].Start = os.clock()
    end

    self.ClearCooldowns = function(self: CooldownManager)
        assert(not self.Destroyed, "CooldownManager already destroyed.")
        self.Cooldowns = {}
    end

    self.Destroy = function(self: CooldownManager)
        self:ClearCooldowns()
        self.Destroyed = true
    end

    return self
end

return CooldownManager
vivid grail
#

ehm

marble willow
#

ts

marble willow
#

he's talking about smt else

#

he had an integrated system for cooldowns that went through the input pipeline

#

it was pretty weird

#

so I suggested keep it simple

sick drift
#

it was abstracted… which u apparently love for animations

#

but HATE for inputs

marble willow
#

no

#

I abstract inputs too

#

just not that way

sick drift
#

im still not like hundred percent satisfied with where im binding my inputs but it works

vivid grail
#

ay

#

chill

#

im here to cry about how cooked im

#

and not to hear

#

how cooked YOU are

sick drift
vivid grail
#

😭

marble willow
#

why yall are crying about how cooked it is

#

😭

#

cooked race

marble willow
#

look I do cooked shit too we all do mistakes

#

important is not repeating 😭

vivid grail
#

im suffering from severe deep fryness that cant be fixed Sad

#

bro

#

its my

#

idk

#

12th attempt

#

of doing the same typa game

#

and i scrapped

#

every single. ONE!

#

i thought this system was pretty decent 😭

marble willow
#

trust combat is hard to get right

#

especially client combat

#

client combat is harder

vivid grail
#

yeah

#

ik

#

i did a fully server one

#

but

#

its

#

ewhhhhhhhh

#

like

#

it didnt feel responsive

#

thats why i want to play the animation on client

#

and then let the server sync with the client ( after fact checking that its possible to use the skill or smth )

marble willow
#

deepwoken is server combat

#

deadass

#

so is jjs

vivid grail
#

but it sucks

#

in terms of responsiveness

#

if u are above 100 ping

marble willow
#

what about jjs?

vivid grail
#

or even 100 ping

#

you are fried

vivid grail
marble willow
#

I know a few games

#

that did client combat

#

but the problem is

#

that feels bad too 😭

#

because now the updates are delayed

#

instead of inputs

#

your hits get constantly rolledback

#

there's no perfect solution

#

there's decisions

#

each to their own

vivid grail
#

man

#

idk

#

like

#

this whole time

#

ive been in the developing community

#

ive never succeeded to make a single viable combat system

#

and its been 4 years

#

since i started touching scripting

marble willow
#

client combat is hard

#

I still dk how to go about it

#

and I made 2 combats so far

vivid grail
#

):

sick drift
#

Give up give up give up

abstract jetty
#

wha thappened is it a race condition

vivid grail
#

idk

#

if i should even continue to work on it

abstract jetty
#

keep it up ur doing great

vivid grail
#

is there a point

#

to continue working of a broken system?

marble willow
abstract jetty
vivid grail
#

like i do have a semi reliable base framework

marble willow
#

how are you gon fix it

#

then

abstract jetty
#

do i give up

#

no

abstract jetty
abstract jetty
#

make a system where anytime a state is set an ongoing state is disabled

vivid grail
#

i guess

#

but wouldnt it ruin fluidity

#

cuz my system is attribute based

#

idk what to do

#

like

abstract jetty
vivid grail
#

I HAVE ABSOLUTLY NO IDEA

abstract jetty
#

dont overthingk it

abstract jetty
#

when m1 no block

#

when block no m1

#

just do that

#

simples

#

do u want my state handler

marble willow
#

😭

#

I thought you were already doing that

#

why do states exist then

#

just run the code

#

and let everyone fight over

#

for the race condition

vivid grail
abstract jetty
#
--Services
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")

--Classes
local StateHandler = {} :: Global.statehandler

--Functions
local function UnsetCurrent(statehandler: Global.statehandler, ...)
    if statehandler.CurrentState then 
        if statehandler[statehandler.CurrentState].onUnset then statehandler[statehandler.CurrentState].onUnset(...) end
        statehandler.CurrentState = nil    
    end
end


--Class
local function <states>newStateHandler(states: {{Name: string, onSet: () -> (), onUnset: () -> ()}})
    local meta = table.clone(StateHandler)
    meta.__index = meta
    meta.CurrentState = nil
    meta.Changed = Global.Event()
    
    local self = Global.Metatable(meta)
    for _, state in states do 
        self[state.Name] = {onSet = state.onSet, onUnset = state.onUnset}
    end
    
    return self
end :: ({{Name: string, onSet: () -> (), onUnset: () -> ()}}) -> Global.statehandler)

function StateHandler:Set(state, ...)
    if self.CurrentState == state then return end 
    if state == nil then 
        UnsetCurrent(self, ...)
        self.Changed:Fire(nil) 
        return 
    elseif not self[state] then 
        return 
    end
    
    UnsetCurrent(self, ...)
    self.CurrentState = state
    if self[state].onSet then self[state].onSet(...) end
    self.Changed:Fire(state)
    warn("Set state to: ", state)
end
return newStateHandler
#

ok there i think its fine for everyboy and not just global now

abstract jetty
#

oops there

vivid grail
#

i think atp ill rework the whole system

#

the only thing that works great for me

#

and actually re-useable

abstract jetty
vivid grail
#

is the client to server module communication

abstract jetty
#

if u want change that

vivid grail
#

i dont like oop and typechecking

#

ill be honest

abstract jetty
#

do u like it bc it scares u or bc u think u'll save 1 second accumilatvly before the universae ends

vivid grail
#

that makes me regret my existance

abstract jetty
#

to make it t owhere when 1 thing is set

#

another thing is unset

#

so u can only hv 1 thing set a time

#

thats ur problem u can use whatever solutio u nwat

marble willow
#

no metatables

#

still OOP

#

but partial OOP

vivid grail
#

as long as i dont have 3 thousend self constants 😭

abstract jetty
#

self looks sexy

#

it makes u feel like ur doing somethig serious

marble willow
#

also

#

I need to update cleaner

#

and state machine

#

I added functions to cleaner

abstract jetty
#

is cleanr like janitor

marble willow
#

yeah but non invasive

#

and no blackbox

abstract jetty
#

a long time ago u said janitor sucks and id rather just have a destroy in my object

marble willow
#

you know what you clean

marble willow
#

I just do that in batch

abstract jetty
#

dang my memory so good

abstract jetty
marble willow
#

which is what Im against

#

like everything gets tangled up

#
  • janitor auto searches stuff
abstract jetty
#

wth is partially clean...

marble willow
#

what I did is ajust a bucket

abstract jetty
#

this is what i do

marble willow
vivid grail
marble willow
abstract jetty
#

i just do Global.Utility:DisconectAll and Global.Utility:DestroyThreads when i need

marble willow
#

but you missed smt

#

need to check if thread is suspended

abstract jetty
#

oh wait a min

marble willow
#
  • kinda stupid checking if connection exists
#

doesn't make sense

#

this works

abstract jetty
#

i do that in the server but not in the client for some reason

marble willow
#

I just got tired of making .Threads .Connections .Instances

#

everytime

#

and I made a bucket for them

marble willow
abstract jetty
#

what happen

marble willow
#

this is correct

#

thread cleaning

abstract jetty
#

wait why

#

wahts the difference

#

u can only clancel suspended threads?

marble willow
#

yep

abstract jetty
#

oh crap

marble willow
#

you shouldn't use coroutine.cancel

vivid grail
#

yo

#

ici

marble willow
#

that is cooked

vivid grail
#

a question

abstract jetty
#

or cause an error

marble willow
abstract jetty
#

if u do somn

marble willow
#

bro that errors is telling you smt important

vivid grail
#

im going to have a holiday from the 3rd of april to the 13th of april

marble willow
#

that is really bad news 😭

vivid grail
#

how about

#

you help me start over

vivid grail
#

and improve

abstract jetty
vivid grail
#

cuz

#

maybe someone can guide me

#

in how to make a good combat system

abstract jetty
abstract jetty
abstract jetty
abstract jetty
marble willow
#

it can't be

#

cuz suspended

#

running thread is always running state

abstract jetty
#

if i did while true do or osmn and i store it inside of it wouldn it be in a running state

vivid grail
marble willow
#

gng

#

Im sorry

vivid grail
abstract jetty
vivid grail
#

as long as its good

#

maybe

marble willow
#

bro

vivid grail
#

if i made a server sided combat

marble willow
#

running thread can't be suspended

vivid grail
#

will help me in some way

#

its better than running into the same wall

#

every time

abstract jetty
#

ty ty ty

marble willow
#

np np

#

you can use cleaner honestly

#

I started using it

#

so much easier

abstract jetty
#

why its like 2 lines

#

why are we here btw 😭

marble willow
#

😭

abstract jetty
#

ur game isnt fully broken its just this part that doesnt work

#

if u get cut u put bandaid not cut of limb

#

jus take some time off go get white monster or somn and come back

vivid grail
#

i dont drink energy drinks

abstract jetty
#

thats the problem

vivid grail
#

@abstract jetty i have an example

#

why i didnt go with a single state machine

#

cuz

#

for example you are blocking

#

you need to keep track of posture.

#

and how can you access posture if not thru a global data place

abstract jetty
#

for exmaple u'd have Players -> Player -> Charcter

#

in my game i have the same thing

marble willow
abstract jetty
#

Global -> Players -> Player -> Character

marble willow
#

of the state machine

abstract jetty
#

tahts how i handle my states

#

sinek has a global state machine tho

#

so u could use his instead

marble willow
#

by letting users define a context

#

it's a generic type

#

so it becomes whatever you pass in

#

that context will hold your data

vivid grail
#

so context: Blocking, Data = {Posture = num}

marble willow
#

I have OnEnter OnUpdate and OnExit per state

marble willow
vivid grail
#

something like this?^^

#

like

#

you have a state

marble willow
#

context is literally an value you want

vivid grail
#

and the state has context

marble willow
#

but it is shared across all states

#

and passed in each call

vivid grail
#

i dont understand

marble willow
#

I have a main combat handler that I pass into my states

#

I have all the combat state there

#

and combat functions

#

it looks like this


OnEnter = function(stateMachine, combatHandler)
  print(combatHandler.Posture)
end
#

there is StateCache which is cleaned up on transition

#

and there is Cache

#

which is persistent

vivid grail
#

i dont

#

like

marble willow
#

even across states

vivid grail
#

i dont see how i can implement it

#

@marble willow can you help me make a combat system from ground up?

marble willow
#

I mean ey bro Im literally giving you exactly how I do it

marble willow
#

πŸ˜”

#

unfortunately

vivid grail
#

man

marble willow
#

I barely have time for my self

vivid grail
#

i have a holiday from the 3rd of april till the 13th

#

i just dont want to waste it

#

like i want to make something actually good

vivid grail
abstract jetty
marble willow
#

If you ask me any question about server combat

#

I can answer

abstract jetty
vivid grail
#

but

#

none are intrested

#

in coding ands tuff

abstract jetty
marble willow
#

ye sur

vivid grail
#

and asking random people to work with me on a game

abstract jetty
vivid grail
#

never works out

#

cuz i tried it

abstract jetty
#

Ull figure it out one day beo but u gotta be willing to fail and fail

vivid grail
#

thats why asking for help 😭

abstract jetty
#

only 1 at a time

marble willow
vivid grail
#

that the skilldebounce ( aka being inside the m1 )

#

is 0.1 less then the full attack animation

#

making it so if you perfect spam block while holding m1

#

u can sneak in a parry

#

@abstract jetty /block

abstract jetty
#

why

#

u have to make it to where at the beginning of the punch

#

u set state to punching

#

and then if they try to block its not blocking anymore

#

u can set states regardless of animation

#

dealing damage doesnt have to be tied to state

vivid grail
#

i want the punch animations to flow into eachother smoother

abstract jetty
vivid grail
#

if i can do another m1

#

after the first m1 animation

#

ah

#

so

#

i basicly make it so it will animation merge

#

the previous m1

#

with the new one

#

make it feel smoother\

abstract jetty
#

oh

#

u can have a queue system with priority or somn if u want

#

wait what i dont understand

vivid grail
#

@abstract jetty

marble willow
#

or tbf

#

if you are in m1

#

you shouldn't do anything at all

#

it doesn't make sense

vivid grail
#

like

#

its not supposed

#

to allow block/parry

#

to happen

#

@marble willow

marble willow
#

then you have a bug bro 😭

#

check the code that does parry

#

and see if it's checking against m1

#

or any state at all

vivid grail
#

its because i set the skilldebounce ( in action state )

marble willow
#

Im not getting

vivid grail
#

for the lenght of the attack - 0.1

#

meaning that in that 0.1

#

you can sneak

#

a parry

marble willow
#

why then

#

why not do it for the duration of the attack

#
  • why are your inputs controlling state transition rules
vivid grail
#

i dont set states on client

marble willow
vivid grail
#

unless client action

vivid grail
#

but

#

the stuff

#

is on server

#

like i said

#

i time

#

the server actions to the animations event

marble willow
#

I still don't get it you are allowing 0.1 second window

#

and mad that the window exists

#

at the same time

vivid grail
#

let me explain

#

i made that window

#

to allow animation merging between m1s

#

so they transition smoothly

marble willow
#

well sounds like that's the thing that needs to be fixed

#

sounds like the root issue

vivid grail
#

then how can i make the animations transition better?

marble willow
#

I really don't get it gng

#

do you understand there's animation

#

and the actual m1 state

vivid grail
marble willow
#

the actual state can be smaller than the animation duration

#

what you do is

#

when they do smt like block when the m1 satate is over

#

you stop the m1 anim

vivid grail
#

lemme record in a sec

#

i tested it without that window

#

and it still allowed for the same thing

#

but it was slower

#

@marble willow

abstract jetty
#

and animations have this thing u can pass into it called fadetime

#

maybe that might help u

marble willow
#

I dont get it bruh

abstract jetty
#

animations and states dont have to be tied together

marble willow
#

you have an m1 state that's active for x amount of time

#

if that block happens in that x

#

you haev a bug

#

if it happens out of that x

#

that's intended

abstract jetty
#

ye

marble willow
#

it's so simple

abstract jetty
#

yup

marble willow
#

maybe your design is broken

abstract jetty
#

well intended or not based off ur code thats what ull get

vivid grail
#

oof

#

so i will have to fully rewrite everything

abstract jetty
#

why just make state duration gbigger

vivid grail
#

due to m1s having a window in between them

abstract jetty
#

when u do animationTrack:Play(fadeTime) u can pass fade time into it

#

heres the properties u can pass

abstract jetty
vivid grail
#

the bug is still present

#

ill prolly waste another 20 hours reworking the system to work with a 1 state system

#

@marble willow so what you were recommending is that I do 1 state that changes, and this state has so called sub categories like for the state blocking we have category posture

#

And blocking is a category of action

marble willow
#

I never suggested sub states

#

ever

vivid grail
#

State and context

marble willow
#

you have Idle state

#

which goes into different states

#

like blocking

#

parry

#

m1

#

guardbreak

#

at least that's what I do

vivid grail
#

I'm too dumb

#

Can you give me a code example?

marble willow
#

Idle = {
  OnEnter = function(machine, handler)
    
  end,
  OnUpdate = function(machine, handler)
    local input = handler:ReadFromInputQueue()
    if input.Action == "M1" then
      machine:TransitionTo("M1")
    end
  end,
  OnEnd = function(machine, handler)
    
  end
}
#

@vivid grail

#

this is usually how state machines work

vivid grail
#

It does look fully client sided thi

#

Tho

abstract jetty
abstract jetty
marble willow
#

this architecture

abstract jetty
#

but yeah u can do it on either

#

the premise is having it only do one at a time

marble willow
#

this is just the state machine idea

#

you have encapsulated states

vivid grail
#

One question

abstract jetty
#

ask ask questions are good

marble willow
#

yes

vivid grail
#

Is the idea that I mentioned valid?

#

Like having a state that includes subdata

abstract jetty
#

which one

marble willow
#

dont give states data

#

states are just runners

abstract jetty
#

ok dont do that

marble willow
#

not state holders

vivid grail
#

So how am I supposed to do the posture thingy when Im blocking?

abstract jetty
#

i mean look u can have states have states if u want but in this specific case u dont need that moreover that has the same principle

abstract jetty
#

regardless of whatever the substate is

abstract jetty
#

yeah what is that btw

vivid grail
#

For example you are blocking, posture is the amount of damage you can negate with block and after it reaches 0 or the move block breaks, you get blockbroken

#

So when you are blocking you have 100 posture for example

#

When you get hit by a punch when blocking posture goes down by 20

#

And your block can basically tank 5 hits until it block breaks you

#

Meaning that I need to have in theory both posture and blocking

#

Because posture keeps existing when you are not blocking ( for example when it's regenerating)

#

Actually...

#

What I can do is make a character class

#

That has walkspeed posture and other stuff

#

And then just do the checks when you enter the state

#

For example when you enter blocking state

#

And you get hit

#

It reduces the posture

#

Is it valid? @marble willow

marble willow
#

bro

#

dont overcomplicate pls

#

really

#

there are better ways

#

just do that in the damage callback as a side effect

vivid grail
#

Yeah

#

Like

#

I was imagining a class for characters

#

That

#

Stores random data

marble willow
#

have you heard of priority based numeric values

vivid grail
#

Like walkspeed speed boosts

#

And posture just as an example

vivid grail
marble willow
#

or both?

marble willow
#

the priority handler always uses the highest priority active number

vivid grail
marble willow
#

but for combat specific shit I would just store them in the combat handler

#

still storing walkspeed directly

#

not a good idea

#

@vivid grail

#

like this

#

this is basically a priority system with lifetime per entitiy

vivid grail
#

i dont understand....

#

so like

#

stun has priority over speedboost

marble willow
#

do you get it?

#

I have a module for it

#

it's open source

#

but I haven't shared anywhere

#

Idk where to drop

#

maybe this is the time 😭

vivid grail
#

give me a full state handler

marble willow
#

😭

#

you already have a state machine

#

also

#

mind you

#

I had to build these from scratch

#

cuz there was nothing like this online

#

😭

#

gives me PTSD

#

my utility write era

vivid grail
#

i feel you

#

i gave up on my utility writing era

#

i left the arc

marble willow
#

dw twin

#

I wrote everything you need for a combat system

#

I gotchu 🌹

#

need to drop SinekUtil

vivid grail
#

real

#

sinekhandler

#

WOULD BE FIRE!

marble willow
#

Istg Ill drop SinekUtil someday

#

I jsut need more modules

#

Im missing a few pieces

#

@vivid grail

vivid grail
vivid grail
#

cuz i see you got a lot of luau files

marble willow
marble willow
vivid grail
#

hmmm

#

never got a luau file

#

from roblox

marble willow
#

try it rn

vivid grail
#

like

marble willow
#

I didnt write cleaner in rojo

vivid grail
#

where do i get a script

#

as a luau file

marble willow
#

just make a module script

#

right click

#

export

vivid grail
#

oh

#

ye

#

it always did that

#

if

#

ah alr

#

i thought u meant something else

marble willow
#

ye no

#

do it

#

it should do .luau rn

#

if you have latest studio

vivid grail
#

ye ik

#

that it turns it into luau

#

i did it recently

#

didnt it always do that

marble willow
#

no

#

it used to be lua

#

by default

#

you can see all the scripts that have .lua

#

those are from roblox

white karma
vivid grail
marble willow
#

the sinek files

marble willow
#

nah but fr dont be fooled

#

half of these are trash and duplicates

#

I have old code there

vivid grail
#

@marble willow one question, about the priority list

#

do you have a list of all the states

#

and then set priority to them so for example the attacking state cant overide the stunned state

marble willow
#

That is already xoded into the logic

#

Through state machine

#

Onlt 1 state can be active at all times

vivid grail
#

yeah

#

but its like

#

if state A has lower priority then state B

#

then when state B is active

#

State A cant overwrite it

marble willow
#

So you set the actual value on .ValueChanged

#

Like hum.WalkSpeed

vivid grail
#

i dont really get it

#

also

#

do i keep the statehandler module

#

that you created in server only?

#

@marble willow

marble willow
#

Cuz state machine has 3callbacks

vivid grail
#

im asking cuz if i keep it server only

#

i cant made additional checks on client'

#

so it wont send unneccesary events

marble willow
#

I would do the state on both client and server to keep things consistent

marble willow
vivid grail
#

btw

#

can i use an attribute

marble willow
#

Basically rollback

vivid grail
#

as th replicator?

#

cuz

#

attributes replicate

#

so you have like a State attribute

marble willow
#

Yeah you can

#

Just know that attributes replicate to anybody

marble willow
#

But I guess thats a good thing in in your case?

vivid grail
#

is it a problem

#

i mean i do have to do checks from player to player

marble willow
vivid grail
marble willow
vivid grail
#

like

marble willow
#

Im talking abt every frame

vivid grail
#

ah

#

then its not that often

#

if you compare it

marble willow
#

Yeah shouldnt be that often

#

For example to replicate energy dont use attributes

#

Youre gonna get lag spiked

vivid grail
#

ill replicate

#

starting to

#

regen

#

and starting to go down

#

and make it do its own math

#

something like it right?

marble willow
#

So prediction

marble willow
#

Or just a regular remote even

vivid grail
#

im planning on using packet

marble willow
#

Yeah thats what I do

vivid grail
#

about the animation system that im using

#

do you think its going to be an issue in the future?

marble willow
#

I just saw :LoadAnimation

vivid grail
#

the one with that gets the time to an event

#

i had it cuz i played the anim on client

#

going to start moving my whole system after i fully figure out the state handler

marble willow
#

Hmmm

vivid grail
#

gonna take a lot of nerves and tume

#

but

#

i gotta go thru the reworking arc once again

vivid grail
#

@marble willow , so do i jjust use simple animation events?

#

like

#

without the timing thingy

marble willow
#

And if you have a dash that needs to start and end at points

#

Gl cuz usually hard coding per anim is the way to do

#

πŸ’€πŸ’€

vivid grail
#

bowliiin

#

punch script is done

#

i like how easy i made my skill framework

#

now i have to do it for the rest of the skills,

#

and transfer them to the new statemanager

#

fahhhhhhhhhhhhh

#

what about body velocities

#

do i move them to the server too

#

it will save the hurdle of keeping it on client and firing an event to get it

#

eeeeeeeeeeeewwwwwwwwwwwwwwwwh

#

im already starting to feel that server sided animation delay

#

😭

#

im playing with 0.07 replication delay

#

and it feels awful

marble willow
#

Keep body mover client

vivid grail
#

ok

vivid grail
#

sinek

#

why does

#

everything

#

feel

#

so delayed

#

when i do it fully on the server

vivid grail
#

yk what

#

ill keep my own system

#

ill just rework the state machine

#

cuz whe playtesting with others i didnt have any bad expirience with desync and animations breaking

#

so yh

#

and it was smooth as hell

sick drift
#

server authority is ur only true solution

#

but it isnt necessary

vivid grail
#

what im going to do

#

is make the state handler allow for 1 state at a time

sick drift
#

thats how state machines usually work

vivid grail
#

cuz i used simpel attributes b4

marble willow
#

what were you expecting

#

are you playing from mars

vivid grail
#

ima keep my system

marble willow
#

whats your ping

vivid grail
#

ill just

marble willow
#

no genuinely whats your ping

vivid grail
#

when i play with 0.07 network replication delay

#

it feels horrid

marble willow
#

you got too used to instant

#

also

#

that is 140ms

#

delay

vivid grail
#

isnt it 70 ping?

#

0.07 ms delay?

#

cuz when i tested with my system at 0.1 second replication delay

marble willow
#

no

#

that's 1 way

vivid grail
#

it feels smooth af

marble willow
#

0.07 seconds for each 1 way trip

vivid grail
#

but i fire once

marble willow
#

a roundtrip is 2 1 way trip

vivid grail
#

and server does it alll

marble willow
#

server tells you to do smt

#

1 round trip

#

140ms

#

if you put 0.035 that's 70ms

marble willow
#

you need real world staistics

#

to see how many times it rollsback

marble willow
#

or goes out of sync

vivid grail
#

accurate ingame

#

when i playtested

marble willow
#

have you tested with testers

vivid grail
#

for an hour

#

like

#

with guys from this server

marble willow
#

Idk if you are getting the actual problem with client sided combat

vivid grail
#

i get it

#

but its not fully client sided

marble willow
#

I know

vivid grail
#

its a hybrid system

marble willow
#

but like if I press parry

vivid grail
#

where i just play the animation on client and thats all

marble willow
#

how is the other client know I parried

#

Im gonna miss all the time

vivid grail
#

to make the check

marble willow
#

yeah but on my client I parried instantly

#

and it should've went through but it didnt

#

the smoothness is not the question

#

,it's a tradeoff

#

about lying to players with visuals

#

or showing actually what's happening

#

and there's no netcode that can erase the delay

vivid grail
#

you dont get instand visuals tho

marble willow
#

there's stuff that hides it well

vivid grail
#

visuals go after the server check

#

its just the animation playing

marble willow
#

yeah

vivid grail
#

which isnt instant

marble willow
#

that's what Im saying

#

it felt like you parried

#

but you didn't

#

client combat can be good

#

but most parry based games don't do it for a reason

vivid grail
#

ok

#

my game has perfect blocking

#

and not parrieng

#

parrying

#

thats the best way i can explain it

#

since you cannot have both comboes and parrying

marble willow
#

yeah

#

if so

vivid grail
#

i decided to go with perfect blocking instead of parrying

marble willow
#

then client approach is still valid Id say

vivid grail
#

i got a class

#

brb in 30 min

vivid grail
#

back

#

so

#

im not planning on making a full on parry based game

#

it will have parrying as form of countering readable actions

#

such as doing a heavy attack from out of no where