#help me learn

1 messages · Page 1 of 1 (latest)

kindred sorrel
#

alright so i know basics i just need to learn the advanced scripting dont recomend brawl dev because he bored me

buoyant arch
#

davnced scripting is literally just mastering the use of modules

#

and knowing everything about types

#

thats it

#

rrally

kindred sorrel
buoyant arch
#

they're defo not advanced

fluid prism
#

intermediate on Roblox is at best buffer bit-packing and compression

#

to be honest, nothing really qualifies as "advanced" on roblox

trail escarp
#

and the full prediction pattern hehe

fluid prism
#

I have never needed "rollback", nor do I want to do something on a client that would be misleading

#

If something changes in the server state, then that one thing is simply replicated exactly, if needed, or a part of it is

#

prediction is different for everything, so that really depends on which thing you trying to predict

trail escarp
#

can't be done with existing tools, you need to make the full prediction pattern to do it

#

predicting hp changes also has its fair share of problems

fluid prism
#

change in health is usually a very simple, linear pattern. desync can grow but it can be good enough to simply send a snapshot value to be offset by latency from the server whenever the value changes. as far as NPCs are concerned, there are many different strategies to handle those, so idk which one you're going for there

#

If the NPC is client-specific, then obviously there isn't really anything that you need to worry about. The client owns the NPC and the only thing the server can do is verify if, for example, the commands (basic move direction, for example) from the client's NPC are acceptable

#

serversided npcs are simple enough that the reverse is possible, except clients probably don't need to sanitize it and culling should be implemented

#

for strictly chaotic physics, though, you might honestly be better off with either replicating the exact forces while taking into consideration other collidable objects and the timing of it all (good luck lmfao) or relying on the server's simulation entirely and using the exact CFrame or position for individual objects

trail escarp
trail escarp
trail escarp
trail escarp
fluid prism
trail escarp
fluid prism
#

it honestly sounds to me like you're making something more complicated than it has to be and crowning it "advanced"

trail escarp
# fluid prism "the prediction pattern" is unfortunately a very ambiguous name to give whatever...

naw see it's not ambiguous. again, that's okay! you're still learning! ⭐ see, the problem with prediction hp changes is if you change the hp on the client and then change hp again, it is possible for the server to register the first hp change and send it back to the client before or after (this is the problem) the second hp change event occurs. that's what i mean by even the simplest prediction problem is very, for lack of better words;

trail escarp
trail escarp
fluid prism
#
  1. event that changes health, sends from server to client health correction
  2. client continues doing what it does every frame if need be, with the correction

there is no problem with ordering, since that can be guaranteed by remote events queuing

trail escarp
fluid prism
#

i'm not really sure when you would need to perform something like that one both

trail escarp
#

gold star ⭐ the prediction problem is an issue with ordering of events, when the client predicts an event vs when it receives server authority notify of same event 💯

trail escarp
#

player to server is the easiest. player to player is the real problem this is trying to solve

#

as it stands, player to server in roblox has no prediction. there exists attempts by roblox, but there is nothing official or formally announced about it: AuroraService (Unannounced) https://robloxapi.github.io/ref/class/AuroraService.html this has all the api functionality I expect from a prediction service, issue is, it's either unrelease or deprecated or idk what's going on with it. in the meantime, whatever is going on with aurora service, you need to make your own in the meantime.

trail escarp
trail escarp
fluid prism
#

you say it needs to happen, but i genuinely can't think of a situation where ordering is an issue

#

i'm gonna leave this one up to eternity

fluid prism
#

yeah, not really

trail escarp
#

you can't even faux apply physics to server owned objects on a client, therefore you need to do the full prediction pattern. auroraserver has the api functions you would need to make this possible, but as i said idk what's going on with it. news about it is appreciate if you have any.

#

in the mean time... advanced-qualified code in roblox is the only way salute

fluid prism
#

let's see if we're talking about the same thing, and let's say we have a projectile

server tells client to make a projectile with a velocity, both server and client simulate projectile

when projectile hits something, it is supposed to bounce, but the client's happens first and that somehow irreversibly changes something such that when the server's notification of this event, things break

#

if this isn't what you're trying to say, such that there is a race condition, i am completely lost

trail escarp
# fluid prism let's see if we're talking about the same thing, and let's say we have a project...

you're 90% there. the race condition happens when the projectile is being aimed at the local player 💯 the server will have registered the projectile hitting a wall, but in between that time and when the projectile would have actually hit, the player moved into the path of the projectile. does the projectile stay on the wall, or deal damage to the player? - prediction is assuming the player receives damage, because that is what occurred on that player's screen. there are lots of ways to phrase this problem and put into context, and this is one of many ways.

#

the way i was phrasing earlier with the hp problem is I shoot an arrow (and then a second one) that on my screen, both hits a server-owned NPC, but the server is several frames ahead for that npc and several frames behind for my character+input, and the npc was moving so it didn't actually get hit by the time the server knows about the input, so some time warping is needed plus not sending the hp change twice such that it does not interfere with a second hp change that happened in between the first hit. it gets a bit tricky to describe but i think you're getting the idea

#

https://developer.valvesoftware.com/wiki/Prediction

Prediction is the notion of the client predicting the effects of the local player's actions without waiting for the server to confirm them.

In the vast majority of cases the client's prediction is confirmed by the server and it continues happily as if there was no latency. If there is a mis-match, which is rare if the prediction code is written correctly, then the client goes back and re-simulates all of the commands it ran with bad data. Depending on the severity of the error this can cause a noticeable hitch in the player's position and state, and possibly the state of the world too.

#

without prediction you have input delay. you press W and you have to wait for the server to both receive that input, and send back an acknowledgement of input.

#

50ms is almost unnoticeable, but at 300ms ... bruh if you've played games on 300ms latency you would understand why i care so much about having good prediction 💀

#

and often roblox will put you on 300ms servers... 💀 your users may be mobile further increasing latency... it's worth it

fluid prism
#

So, this is actually a problem that I have had before and I do have a way to fix it, but I generally don't because I prioritize synchronicity across all players, which means that what one player sees at a particular timestamp is as close as it can be to what other players see, at the cost of some individual issues when latency is introduced

#

but I understand why you would want it

trail escarp
trail escarp
fluid prism
trail escarp
#

player vs player in close quarters fast paced combat subject to latency and prediction is one helluva prediction problem

trail escarp
#

the technique to solve for the +100ms, that is the full prediction pattern i'm talking about, is rather advanced compared to most things you would typically find on roblox

fluid prism
trail escarp
#

point is, advanced things exist, yes even in roblox. learn something every day fingerguns

trail escarp
#

prediction where you can, y'know? 🙏 so i'm starting with clients to server npcs, it's the easiest as it gets. maybe a player can hit you at 90 meters away, but a server owned npc can be more accurate than that 🙏

#

...prediction is how you make it more accurate deepsigh

fluid prism
#

understandable, anyways i personally would categorize it as less of an advanced thing and more of a tedious thing that requires care

"advanced" to me is more of a separation of the algorithms and data structures that you might get from traditional problems from the heavy-lifting hardware and system level development

#

like, making an audio engine is advanced

#

in any case, language

#

good talk

trail escarp
#

extreme separation of algorithms and data structures. in essence, you're partially interpolating the gamestate, most of it is positions and forces, but can include properties like health and animation frames (e.g it would need to interpolate animation frames to decide if your arm was in the way of a bullet raycast on a particular rolled-back frame).

#

rollback netcode is an early/lower-complexity version of the full prediction pattern :p

#

absolutely agree that prediction is indeed extremely tedious 💀

#

anyway, hope you learned something ⭐

kindred sorrel
#

erm

#

sure

buoyant arch
#

holy argument

#

oh also vulner gg on getting GUI 1

kindred sorrel
#

Ty