#help me learn
1 messages · Page 1 of 1 (latest)
davnced scripting is literally just mastering the use of modules
and knowing everything about types
thats it
rrally
i take advanced as tweenservice and such
they're defo not advanced
intermediate on Roblox is at best buffer bit-packing and compression
to be honest, nothing really qualifies as "advanced" on roblox
rollback netcode 
and the full prediction pattern 
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
predict knockback on an npc like a zombie.
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
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
the prediction pattern leaves very little to ambiguity. if you don't know which one the prediction pattern goes for, that sounds like a skill issue ngl
the point of prediction is to sync client and server to the same gamestate. by definition for context of an npc, it is server owned for what other purpose would prediction serve?
serversided npcs are not simple, that is my point. you cannot predict hp changes without making a prediction pattern, and if you're doing just the hp my point is why stop at hp, why not just do the full pattern?
the prediction pattern is only chaotic during misprediction, that's both an upside and a downside, but that's the trade-off the prediction pattern makes.
"the prediction pattern" is unfortunately a very ambiguous name to give whatever it is you're trying to point out, so it's less of a skill issue and more of a language barrier
it is very clear to me you don't understand the problem that prediction is supposed to solve. but that's okay! you didn't know design patterns which qualify as "advanced" actually exist and apply to roblox. it's not about the destination, it's the journey, amirite? 
it honestly sounds to me like you're making something more complicated than it has to be and crowning it "advanced"
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;
has its fair share of problems
i understand how it sounds. but you are mistaken. the prediction pattern is extremely useful and important, and understandably, as you seem to misunderstand it, a real pain in the arse: https://developer.valvesoftware.com/wiki/Prediction
- event that changes health, sends from server to client health correction
- 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
roblox introduces a problem with ordering if you try to perform the action on both client and server
i'm not really sure when you would need to perform something like that one both
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 💯
it needs to happen a lot, particularly with server owned entities. it applies between players too, but one client to the server is the simplest situation to work with
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.
so uh... yeah
i hope you learned something today
things that are "advanced" do in fact qualify and exist in roblox... but tl;dr, skill issue bruh 
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
hp change prediction 
yeah, not really
issue:
issue #2:
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 
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
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
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
you are most certainly familuar with this problem, just perhaps not the language of it. sounds like you prioritize the server authority, which is completely understandable, in fact TSB has no prediction at all and relies on having low latency. if it had full prediction, and did it well, it would be quite possibly 2 to 3x bigger than it is now, if not more
but also that's a tricky thing to predict right, because you're correct on that it does depend on what is being predicted
i generally don't care as much for individual player movement, so i'll usually allow some desync between players
player vs player in close quarters fast paced combat subject to latency and prediction is one helluva prediction problem
yea at low latencies it doesn't matter tooooo much, almost unnoticeable under 50ms, 100 tops. above 100 it becomes unbearably infuriating
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
a perfect example is rampant reborn pvp on roblox, cool game but the moment you hit like 150+ ping, you're GOING to be hit from 90 meters away
point is, advanced things exist, yes even in roblox. learn something every day 
yes that is very fun at 300ms ping
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 
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
i have made a few audio engines in my time... not even remotely as advanced as what the prediction pattern demands
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 ⭐