#Touched vs Raycast
1 messages · Page 2 of 1
reason 2 is not cause of that, it's just the frequency at how fast the engine event loop runs, but there's no :wait so makes no sense
suphi moment
you tell me
well if thats the case then only delay is reason 2
would you like me to make you a demo of reason 2?
no
physics engine works at faster rate
parts that are falling still don't always trigger .touched
reason 2 is because the physics engine runs at 240hz and scripts at 60hz
Buddy what i say
so there can be 3 extra physics steps before your script will get the touch event
so techincally is its more accurate but inaccurate?
and in them 3 extra steps the part might of moved somewhere else
its not more accurate
just think of it as inaccurate
i never said its more accurate
raycasts are more accurate
but touch is accurate enough
theres game called reaper 2 in roblox that has techinically a bug where u can hit the players from the side while u shouldnt be able to, seems like this was caused by touched!!!!
hmm yes
with enough practice* (u should only be able to hit them from the back)
this just ended up as a part of the game that u learn to do
dot product of what?
difference vector projected onto the look vector
its accurate but not more accurate
changing your entire argument
touch is 99% accurate raycast is 100%
99% 💀
read my old messages iv said the same thing over and over
so have I
don't try to pull that card on me
then you claimed it's accurate
also it's about reliablity first off
not accuracy, poor word
the only reason I came here was because I was told you were spreading information on .Touched being the best method to do detection with and it being better than raycast
yes I already shut you down on that
you claimed that other collision methods were just as bad btw
@raw oasis
idk how your going to randomly switch up and say raycast is more reliable
this was your claim
you're basically saying it also falls to the same consequence of the physics engine problem
🤡
touch is fastest
touch is fastest touch is 99% accurate
idk man, we would just call you an microoptimizer
not even 99%
like 50%
or less
if raycast was secure then i would recommend raycasting
but because there both have the same amount of security i pick touch
pretty much everyone here are beginners
they would become victim to this
they would be victims if they pick raycasting
because they wont be able to see the flaws
No cause you yourself and ici were first thinking about only checking hitbox.position
i dont check any position
ya cause you don't care about security 🤡
or even realiblity
you care about speed, doesn't matter how fast your game is if it doesn't even run fine in the first place LMAO
i only pick speed if there is no better option
and raycasting is only better at accuracy
you pretty much lost your argument, everyone will just see my messages and they'll know the better method
but touch is accurate enough
i dont care what others think im just trying to help you
You're the one who's the beginner here 🙄
I've enlightened you
remember, you're the person here who would use body movers for every bullet
if anyone competent who comes through here will know who the credible person here was loool
Discord: https://discord.gg/bEn49K5JUt
Patreon: https://www.patreon.com/Suphi
Donate: https://www.roblox.com/games/7532473490
ApplyImpulse: https://create.roblox.com/docs/reference/engine/classes/BasePart#ApplyImpulse
0:00:00 - Intro
0:00:33 - Create Project
0:01:29 - Script
0:08:18 - Projectile Duration
0:14:24 - Target Velocity
0:17:40 - Outro
will leave dis here for people to see then
since you aren't humilated
by your bad practices
apply impulse is physics?
if you have any questions, ask @fleet sun. Leaving the server cause no point in me being here, specially if there's people who are brainwashed by you
sorry you feel that way we are not here to win anything we just want to help others
oh he left thats unfortunate anywho this has been the most helpful thread for me 🙏
I believe that touch and raycast are both insecure (as they both relay on positions of parts that is set by the network owner)
I believe that if you already have a part in the game connecting a touch event to that part is pretty much free (in aspects of performance)
I believe that raycasting is 100% accurate but touch is also very accurate at detecting touches but not 100%
currently i instance in a part for each time i want to detect a hit is that a good idea or do i have to switch to spatial query?
you bring a part in just for 1 frame to check touch then remove it?
no 1 frame*
so if you change that to spatial query you would run that every frame till the animation ends
i dont need that i only need to check once the animation is over so touched is better?
um
would that not be the same as bringing in a part for 1 frame after the animation ends
its a wack animation
well yeah
so wack must happen after the animation not whilst animation
so if you want to check just 1 frame it would be faster to use spatial query
OH?
but if you want to check multiple frames then touch would be better
mannnn i gotta switch back to this
actually it might linger for like .2 seconds or so
forgot how i have it setup
anywho so touched for if it lingers and spatial for a frame?
also the problem with spatial query any parts that move quickly past the query will not get detected
but roblox touch will detect fast moving parts
because the part moves so quickly by the next frame the part is now on the other side of the query
because the part moves at 240hz
but you can only spatial query at 60hz
so in short
if you only checking for 1 frame use spatial query
but if your checking for multiple frame use touch
please make a video on this
about what exactly? the benefits of touch?
no just going through all kinds of hit detection with their pros and cons
ok
stuff like physics runs at 240z and script running at 60hz i feel like no one talks about it
yer i was going to talk about that in a video
so whilst touch detects it others wont
yes yes do do
it effects more things other then touch
ive never seen anyone talk about these things
and most people look for resources on hit detection
you mainly need to know that all hit detection can be exploited
and only touch runs are 240hz
now i know
i knew the 240hz thing but i thought that was a good thing not a bad thing lol
and touch does have some aspects where it is more accurate then raycast and spatial query
yes its good
but from the video he send you can see it being inaccurate
i think everything has its own use case?
do you mean the delay
so when i say accurate i mean in detecting the touch
im not talking about how long it takes for the touch to be reported
so a raycast can miss a touch if a part moves in front of it to quickly
but a touch event might not miss that touch event
if u take a look at this video at :01 you can see while the mouse enters the white space the other part does not, but it prints "Object"
its hard to tell because the frame rate is very slow
- how would u fix this 2. is this caused by differing frame rates?
also the part might be in the part but the screen might not of updated
ok yeah thats what i figured frm what ive gathered so far
so for the fastest response whoever has network ownership
should be the one who detects the touch
so if player1 owns the part then the touchevent should be on player1
i see
while true do
task.wait(3)
local part = Instance.new("Part")
part.CustomPhysicalProperties = PhysicalProperties.new(0.7, 0.3, 0, 1, 100)
part.Position = Vector3.new(math.random(-100, 100), 100, math.random(-100, 100))
part.Parent = workspace
local explosion = Instance.new("Explosion")
part.Touched:Connect(function()
part.Anchored = true
explosion.Position = part.Position
explosion.Parent = workspace
end)
game.Debris:AddItem(part, 60)
end
put this localscript in replicatedfirst
okay
explodes on touch
do you see a delay?
no
so when the touch happens if fires touch event in the next frame
why* does it fire it in the next frame?
AH I SEE
so to synchronize it do u just have to delay it by 2 frames?
much confused
one you cant delay the physics
if you did a task wait then it would happen on the next green bar
then you would be even more out of sync
your scripts run in the green parts
you cant there can always be upto 3 more physics steps before the script runs
but that delay is very small
there can be a maximum of 0.0222222222222222 seconds delay between the physics and scripts
the bomb demo i sent you will have a max of 0.0222222222222222 seconds delay
between the physics engine detecting the touch and the touch event firing
do u remember this? https://discord.com/channels/909926338801061961/1084872156506234930
i thought this was bc the touched ran at 240hz while
who knows 🤷
yeah
well the physics engine keep moving the part in them 3 frames
because its not anchored yet
the script has not run yet
is there no way to fix that?
in my bomb demo
i set PhysicalProperties.new(0.7, 0.3, 0, 1, 100)
this stops the part from bouncing
i have no idea what that does
oh i see
this stops the part from bouncing
oh this is really handy lol never knew this existed
oh so it would fire how many ever times it bounces*?
then the slow script comes along and anchors the part
but by the time the script comes the part is no longer touching the floor
its now bounced upto the sky
so the part is anchored in the sky
AH I SEEEE
but this does not make touch inaccurate
the touch is detected just fine
its the fact that the event fires late that its delayed
u must make a video on this
i will
ive read through a lot of dev forum posts but ive never heard of this
so basically touched runs too fast
with the amount of information ive garnered today i feel my brain expanding
its a little like fps and monitors hz
lets say you gpu is running a game at 240 fps
and your monitor is updating at 60 hz
oh this brings me to another thing
so if i was to have an fps unlocker
does that mean it'll replicate for me in synchrony?
bc roblox is locked at 60 hz
yes a fps unlocker should reduce the delay
ill have to test that and add it to the video
im guessing the fps unlocker keeps the physics rate the same
and just changes the scripts/render rate
maybe
ill have to test it
anyway im going to go now
but ill put making a touch video on the top of my list
Thank you for the series, I felt like I just watched an entire movie
This is the second season my friend
I was here for the first season as well 😭
What
I believe Touched depend on physic (240 hz)
there's lot
but if you're dissatisfied with the Touched result then use raycast (60 hz [because script run on 60hz])
or be a ultimate sigma ligma and use both 😎
sigma rule 69: a sigma doesn’t follow any rules
ima resort to using spatial query
on a heartbeat none the less
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Hopefully I'll have a video soon talking about this topic
One message removed from a suspended account.
Idk why 4thAxis disparages others, really he just came off as insulted that Suphi would make tutorial vids and also disagree with him. As if he is the authority on which approach is ultimately the best and we aren't just all having a conversation
I think it's okay to disagree on which approach is superior, but to act like there is a difference in experience between 4th and Suphi and all that just cuz they had different ideas on what would be optimal. It's just rude and he came off like a tool. I'd have to say that Suphi handled the criticism pretty well though because if I were him I'd have said we don't need toxic retarded assholes in this discord and I'd have removed him myself, evidently though he just joined literally to talk a bunch of shit and then bail 💀
i like free speech so im happy with anyone speaking to me anyway they like
I mean that's well and good unless someone is demeaning your abilities
One message removed from a suspended account.
But I understand you have confidence in yourself 💯
One message removed from a suspended account.
One message removed from a suspended account.
its ok i don't mind if people want to demean my abilities or cus and put me down
Alriiight but I'll chime in when it happens 😈
im just upset that they was not open to learn why raycasting is just as flawed as touch
It does suck but he didn't come here to learn anything to begin with to be fair
i would not judge if someone knows better by the years they claim to script a good way to know is to look at the evidence
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
that is evidence that i know how to script but not evidence that a specific claim i make is true
so you can use that to assume that what i say is true but it wont be 100% confirmation until you run the tests your self
or if i make a specific video on the subject showing you the evidence for that claim
unless i fake the video to trick you
One message removed from a suspended account.
cos maybe im just sus like that
One message removed from a suspended account.
4th says " No idea why he’s trying to instigate specially without knowing any context. I gave a general warning about taking whatever suphi says with a small grain of salt. It’s not about what’s optimal, it’s about what works. Anyone can make tutorials over the basics. The stuff I corrected him on where encouraged practices and common standards in the Roblox industry" @somber zealot @steel kelp
he also says "I don’t have anything against people who are wrong or aren’t knowledgeable, that’s completely fine. Suphi though just claims to have made up experience and some authority. He’s encouraging stuff like making bullets with body movers for example with .Touched. If you don’t understand the problem with this, you should try it and see what happens. Rubber-banding, performance, and inaccuracy hell"
One message removed from a suspended account.
"made up experience" my whole problem with what 4th said was that he's totally dismissive of other people's experiences just cuz they have a difference of opinion lmao
I never encourage body movers for bullets but i do say use a vectorforce for rockets or if there still new to scripting i might say use align position for rockets
@fringe meteor
I can't figure out where I was going with last message lmao I just think it's a bad look to come into someone else's discord and tell them their experience is made up
Maybe he has never made a game that has mechanics that are focused around projectiles
What are projectiles im new
The problem isn't about not knowing knowledge about projectiles
@steel kelp
Oh I see what you're saying
claims to have made up experience
i didn't read that right
Apparently I missed something
other stuff like
or not knowing what sanity checks are
You can't really get far in game dev without knowing that stuff
he may just not focus on lingo
anyone can claim when they started scripting, more so about their practical backgrounds
it's not like he doesn't sanity check stuff that is common sense to sanity check
What r projectiles??
im not sure why you think raycasting is able to have more sanity checks over touch
the main problem just is with .Touched as a hitbox method
eh kinda
bullets go pretty fast traditionally
like that you apply a force to
really just stuff that has a drop arc like physics based
if you don't believe my word for how inaccurate hit was, or my experience. Take other people's experience for it
https://devforum.roblox.com/t/how-to-deal-with-inconsistent-touched-events/1936344
https://devforum.roblox.com/t/touched-not-accurate-at-all/1595030
https://devforum.roblox.com/t/touched-event-firing-too-early/294747
https://devforum.roblox.com/t/touched-event-firing-too-early/294747/7
https://devforum.roblox.com/t/inconsistencies-in-damage-over-time-while-touching-a-part/1983508
I want to create a system where players run through gates and get awarded with coins etc. I am currently using CollectionService as I have 500 gates. In my game players travel at high walk speeds at over 10k+. When a speed of about 2k or over is reached the touched event on the level gates sometimes doesn’t register. This is my script: local ...
Ok so I’ve been having this godawful issue in my game for the past couple of days, and I still have no Idea how to fix it. Basically, what my script is, is that when the cannonball is touched, spawn an explosion at the position at the cannonball. For some reason, it’s getting the position of where the cannonball was like a quarter of a second ag...
Hello there, I am having an issue where my projectiles kinda seem like they are firing their touched event too early. So I have projectiles flying from around 400 studs (Y-Axis Specifically) to 0-10 studs, this is done with the roblox physics engine with the part being un-anchored. I made it so that when the projectile hits the baseplate part ca...
This is a problem with roblox replication. Instead of using a .Touched event, I’d do something like: local connection connection = game:GetService"RunService".Heartbeat:Connect(function() local ray = Ray.new(part.Position, Vector3.new(0, -1, 0) * 3) local hitPart, hitPos = workspace:FindPartOnRay(ray) if hitPart and hitPart.CanColli...
Hello everyone, im trying to create a script that damages the player over time while they are in contact with a part. Simple enough. This particular script checks for a hitbox that is spawned and welded to the player when they enter the game, double checks to be sure we are not already ticking damage on them, then begins a while true loop that...
it's about factoring in the gravity component vector and also applying a directional vector
blah blah
really you should just learn it in physics 1
or go watch a super basic trajectory tutorial
no i didnt
did it work @steel kelp
Bro I love one punch
Nah y'all don't intimidate me you should invite me to your discord tho
Blue guy crackheadery
Stop editting videos to fake DMs... its not funny or cool m8.
yes
4thaxis when suphi kaner claims touched > raycast
hmmm
I heard 4thAxis made the fastest camera module written for Roblox
You better back down, mate.
Fast-Camera-Systems Probably the most optimized and fastest Camera you’ll find written for the Roblox engine. Pretty easy to use. Might write up an article explaining the math (if I’m not lazy)… Get The Module Here! Github rbxm FastCameraSystem.rbxm (13.5 KB) Model Fast-Camera-System - Roblox Camera Modes Over-The-Shoulder Top-Do...
There was this kid that said he optimized it but tbh... I think hes a faker or something
How are these guys going to claim i'm "retarded" if I also did the same thing and " look at the evidence"
pro
Really my problem is with toxicity in general
where's the toxicity
Kill yourself
I don't think retarded is the right word since anyone capable of engaging with programming as a topic is obviously not retarded
All I'm saying someone is pretending to be knowledgeable and all that is really reductive
I was diagnosed with minor retardation but I can program kinda
I have 67 IQ
yeah right
Iz alright, maybe suphi will gain experience one day
🙏
You seem really egotistical
Plenty of the topics he's discussed are practical
m8
me?
like what
@fringe meteor *
Yo
i don't watch his youtubes or anything
but teaching how to use like, if statements or whatever is stuff anyone can do with general programming knowledge
I dont think you need to have made a game to have experience in game development.
knowing theory is one thing
Plenty of people are capable of gaining experience by building frameworks and libraries to assist game developers on Roblox.
He's got very good beginner tutorials on how to setup roblox physics projectiles, setting up a lobby interface, his infinite scripter plugin is also pretty dope
It uses parallel luau to do fast chunk loading
how to setup roblox physics projectile
Probably cool to mess around for beginners
One message removed from a suspended account.
but that's not really applied in real games tho, if you have an FPS game for example
One message removed from a suspended account.
I think Suphi is capable of understanding why your approach is superior, I think his hangup is with Touched being as spoofable as raycasting
i recently changed my mind
i now think touch is more secure then raycasting
i already told him that he'll have to deal with 100+ more debates from programmers on why touched sucks lol
raycasting can only be as secure as touch if you have it delayed like fastcast
also nvm, I thought shinji asked about games in Roblox
delayed?
suphi really needs to make a video on touched based projectiles is what I'm gathering from this
how about he makes an FPS game using touched on bullets instead
im not a FPS kind of guy im a RPG guy
What if we just made two games then
An FPS with touched
An FPS with raycast
Compare the gameplay
That would be the end all way to settle this silly little debate
One message removed from a suspended account.
Simplest way would be to make one game that can switch between the two systems in a single server
im both, rpg doesn't have crazy flying fast objects. But that inaccuracy will be there still
One message removed from a suspended account.
raycast can have the same gameplay as touch
touch would be more accurate then raycasting but a player would not feel the difference
yes seems like we should deprecate raycasts honestly
Fr muzan
Are you retard
One message removed from a suspended account.
almost
just need to make the thumbnail
🗿
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
😛
One message removed from a suspended account.
still datastore
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
1 more datastore after this video
ping me for the drop 🔥
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
not daily but maybe 2 times a week
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
whos asimo?
One message removed from a suspended account.
oh cool what did he say?
One message removed from a suspended account.
He said raycasting is better than touched
ok
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
mainly debugging in the datastore module
and like how to show a indicator to the client when the datastore is having connection problems
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
here is a demo that shows how touch is more accurate then rays
You can change the projectiles height to effect the test
at some heights the projectile will be in sync with the ray and the ray will detect it but there are some heights where they wont be in sync and the ray wont be able to detect it
some height the ray fails to detect are 80/200/600/800
some heights where touch will fail to detect are 500/1400
but you will see that the falling part needs to be going a around 4x faster before touch starts to fail vs rays and this is because touch runs at 240hz and rays can only run at 60hz so the ray is missing positions the falling part has entered
if we imagen this is the ball falling down
the ray will only be able to detect the ball when its red but touch will be able to detect the ball when its red or green
so for instance when you set the height to 100 the ray will start to work this is because the red part happens to fall in the ray as it passes but if you set the height to 80 the red part is no longer inside the ray and it will fail to detect
One message removed from a suspended account.
One message removed from a suspended account.
😭
what will I ever do to educate this man
I don't know how to ever get through your head. I think starting over would be nice? Maybe writing you a concise full essay might help you understand? Before I settle this argument once and for all. Let me first explain my own background:
- I am not here to prove superiority over you, I couldn't care less who you are. Whatever preferences get suppressed by project requirements e.g following a specific style of doing something.
- I also would normally just ignore people like you, but clearly that's just wrong to allow you to give people bad advice as someone who publically teaches people.
- I don't think any of us should even mention any professional background to prove authority over someone, that's just stupid. I believe in logic and proof.
- Formal/lengthy arguments are also stupid, I just tell people stuff in simple words so no one needs knowledge to understand what I'm saying.
we need to also understand common goals and ideologies:
- We both have pretty big influence over people, we all genuinely want to preach good advice. You should admit when you are wrong and start adovcating for the latter.
Common preliminary information we should all understand:
- "the same is true with ray casts if your moving the origin or the ray to quickly you will have gaps", I've explained this before, you just make the length of the ray equal to the actual distance they move, very simple.
- Sanity checking: is when you are basically checking on the server if something hasn't been spoofed, that's the general definition.
- Replication lag: Basically network latency from high-ping. The average ping is like 60-90.
- Replication/network rate: Roblox's networking internally is really janky, it's where all latency in Roblox games actually comes from. We DO NOT have 60hz networking yet exactly. Some 20-40hz bullcrap.
Property Value
ClientPhysicsSendRate 20
DataGCRate 20
DataSendRate 30
NetworkOwnerRate 10
PhysicsSendRate 20
ReceiveRate 60
TouchSendRate 10
-- Remotes are also sent at 20hz
(https://devforum.roblox.com/t/are-there-any-replication-methods-that-are-faster-than-the-standard-20-hz-remotes/168634/8)
(https://devforum.roblox.com/t/20-hz-runservice-event/641090)
- How fast does Physics engine actually calcalute, Physics aren't always 240hz! Fixed-stepped 240hz for physics is actually tolling on performance. Most games on Roblox now use adaptive timestepping which is 2.5x more faster with performance! That means that stuff parts can be moving at 60 hz instead of 240hz because those calcalutions are very simple.
Then fire the remote once with the start and end of the bullet, and interpolate it on every client. No need to fire that often.
Currently on Roblox, it’s too hard to set up a 20Hz game loop on the server side. IIRC, remote functions and events / replication happens 20 times a second, whereas Heartbeat is fired 30 times a second (roughly): Since I don’t want to be using more CPU time than necessary, I want to update my game objects on the server at 20Hz rather than 3...
- Adaptive timestepping:
- Roblox's distributed Physics System: "Roblox uses a distributed physics system in which clients have custody over the physical simulation of objects in their control, typically the player's character and unanchored objects near that character. Additionally, through the use of third party software, exploiters can run arbitrary Lua code on the client to manipulate their client's data model and decompile and view code running on it."
Now that we actually have background knowledge, it should be clear what's wrong with your test. People aren't using .touched because it's faster (no idea how you even benchmarked this LOL), it's cause again .Touched isn't reliable at all to begin with since it doesn't always fire. This was extremely more notorious in the old days (Roblox had poor geometry numerical robustness and instability), it's still a problem now because of the fact that Roblox uses a distributive physics engine. That's not going to go well with your physics based hitboxes lol because the physics engine is always fighting over which player gets network ownership. That causes issues like this:
https://gyazo.com/918c404f5e6bb39c859e53c57f8e62da.mp4 (see the sudden jerk from 166-167, red outline means it's server owned or by another player, green is client ownership)
If you want to know what would happen in a real game with that little test you sent, watch what happens when you set incoming lag replication in studio to a very small modest ~0.2:
Notice the desync:
https://gyazo.com/232e20f7a020d8680e590d9674956e0e.mp4
This is what happens over time with just 2 clients fighting for physics ownership:
https://gyazo.com/e39fbca5e6d6830bda9a344f8718e8b8.mp4 (~0.2 replication lag still)
Player 2 is clearly missing .touched triggers lol
Lol good luck deciding to lock ownership to server, nice way to kill physics smoothness for everyone
Roblox even warns you not to
lets see how your little physics based fps game goes
this is why people raycast and do microstepping/swept collision on stuff like falling parts for example
I also don't still understand what you mean by .touched being secure? I've already told you, what you going to do if I just setnetworkowner of the part and run away with the hitbox lol
Also idk where you're going with client only projectile physics LOL
Here's a tl;dr:
.Touched:
- Inaccurate, doesn't trigger, replication lag will cause you problems.
- Suphi claims its the fastest, but this bafoon doesn't even know how to benchmark it even properly
- It's inherently insecure, synaspe have built-in "firetouchinterest" to exploit .touched so you need to be careful with how you set up your networking model. You can alternatively, setnetworkownership of the .touched part and just remove it
- Unstable
- 100s of posts and articles on .Touched malicious
- Discourged by every professional programmer you'll meet.
- Harder to do latency compensation for .Touched based hitboxes, can't extrude/extrapolate/offset forward
Why raycast better: - You can raycast as often as you want. Raycast's benefit is that it's very controllable, physics is not, stuff just bounces sometimes
- Accurate and precise.
- Roblox even added shapecasts if you want specific type of shapes.
- flexability
- maintainability
- no inherent physics bugs
- Professional and encourged standard for hitbox/collision detection
I'd say that was a pretty convincing wall of text
@raw oasis may have trouble arguing his way outta this one..... 
I can't figure out how to verify in the RSC discord not to be tangential I just can't seem to get it to offer me the option
One message removed from a suspended account.
One message removed from a suspended account.
This is not the problem of touch but the problem of replication
That's why I would have the client spawn the projectile and have the client tell the server what the projectile hit or I would have the network owner locked to the shooter and the shooter would be handling touch in a localscript
So network ownership is not a problem and how quickly the part replicates is not a problem because the shooter is the one who will be detecting the touch not the server and not the other clients
It's true that recently Roblox turned on adaptive timestepping by default and this will make physics run between 60 120 and 240 Hz but for fast moving parts Roblox should be running at 240 Hz I personally have not tested to see how well Roblox detects fast moving parts like projectiles but I would assume all projectiles should be running at 240hz even with adaptive timestepping enabled
But setting adaptive timestepping to fixed for FPS games might be a good idea
So tldr
-
Touch is more accurate
-
Touch has better performance
-
Physics based projectiles are more secure (can be done with touch or raycast but easier to do with touch)
And the way it works is
-
the shooter has network ownership of the projectile
-
the shooter tells the server what the projectile hit
And when it comes to professional background iv never tried to use my past to prove anything I'm not running around here trying to prove anything about my self I'm just here to try and help people
I'm perfectly happy saying that I don't work as a programmer/scripter and that I worked as a dustbin man and that programming and scripting is just my hobby
and i have no problem saying that I started Roblox around 2019 where many people in this discord have been using Roblox longer then me
and i have no problem changing my mind when I'm wrong for instance someone told me something about GetPartsInPart that i had incorrect information about and i changed my mind when i tested that they was correct
So network ownership is not a problem and how quickly the part replicates is not a problem because the shooter is the one who will be detecting the touch not the server and not the other clients
"d how quickly the part replicates is not a problem" you are never supposed to replicate the client-spawned bullet loool
you can replicate more then 1 bullet when the player enters the game
and make the client reuse the same replicated bullets
" and that programming and scripting is just my hobby", which is why you'll have scripters come along with professional backgrounds to come correct you, that's what a community is lol
?
can you describe how you would handle your fps networking then
well if you can prove what you say is correct id be happy to change my mind
i did lol
that is your belief
the belief and standard of thousands of other developers, sure
so if you're spawning bullets on your client, how exactly are you replicating them then
""d how quickly the part replicates is not a problem""
why are you saying this then
just like how many years you have been scripting or how many developers belive in it does not change if a fact is true or false
every fact has to stand on its own feet
cool, let's believe in someone claiming there's aliens
so there is 2 options 1 the server spawns the bullet and sets the network owner to the client or the client spawns the bullet and its not replicated but can be replicated using remotes
the latter is the standard and the former wouldn't work properly with your .touched idea
yer because if every developer believed that aliens are true you would believe it
not all people
well no one thinks there ignorant every one thinks there own belief is true or they would not believe in them
but if 1000 people believe in the same thing this does not prove what they believe is true
yeah we also call that dulesionalism
^
so if facts nor authority persuade you, you are clearly just ignorant or something else
i belive touch is better then ray you belive ray is better then touch
okay, but why are you dodging questions though
if you can prove to me ray is better ill change my mind
^
what question i might of missed it
i cant then, your mind is unchangable
u don't believe in proved facts
or authority
¯_(ツ)_/¯
those are the people i cant help
.Touched is fine for beginners, but they'll encounter problems later on
well i believe i can prove that touch is better then rays
they are later encourged to switch to professional methods anyways
ok you can believe in what you want
don't know why you won't logically explain your processes for approaching hit detection for practical scenarios
and i dont mind you believing what you want
when it just comes down to beliefs, no one would care to believe in what you believe if you have no credability in the first place
its simple
the client owns parts
the client moves the parts
the client detects when the part hits another part
the client sends a remote event to the server telling it that they hit a part
im not here trying to make people believe in me if they choose to believe in me or not thats there choice
if people ask for help ill try and help them
then why are you talking about .touched vs raycast
someone asked what is better and i told them my belief
cool, where's your built-in collision filtering
with the introduction of :Once() connections, we need this more than ever… OnTouch = parent.Hitbox.Touched:Once(function(hit) if not hit:IsDescendantOf(script.Car.Value) then Touching(hit) else Touching() end end) say for example this is in a car’s hitbox, and the problem is it would collide once with the car’s tires and never run ag...
now its down to them to choose if they accept what i say or not
seems like they ignored this guy
but um, how exactly do you intend to hit trigger for other physics owned stuff
i dont have built in collision filtering im not sure whats your point
It's common to add whitelist/blacklist for collision filtering
when the bullet hits something before the client sends the event to the server it would first make sure its a valid target but true touch does not have filtering but i don't see why we need it in this case
so you don't trigger .touched on your own character
with raycast, you don't need to worry about that
i would have touched on the bullet
yeah? So what, you'll spawn it offsetted 2 studs forward?
and each client has touched on there own bullet
ok but how do you make it so you don't trigger .touched on your own player
or the gun it comes out of then
that's what I'm refering to when I say collision filtering
inside the touch event you check who it touched and if its a valid target you send a remote event to the server
if its not a valid target you dont send the event
"g but i don't see why we need it in this case "
yes that's why you need it
raycast has it all built-in
and spatial params or any other method, but we're talking about raycasting here
One message removed from a suspended account.
you said you use .touched cause of performance right? Seems countradictary here
the difference it's done internally on the C++ side
each client has touch for there own bullet
not in Lua-land
the server wont receive the touch event
that doesn't solve your collision filtering problem though
you can only solve it through doing checks
making sure you didn't fire .touched off of the local player character's children
btw you did understand why your .touched benchmark was flawed right?
well you were talking about connecting anyways. Connecting to a listener is the same for everything lol
if you have a game with 100 bullets traveling per frame on server with touch, that would actually be more expensive
than raycasting
yes but this might only trigger at most once when the bullet is first places
you understand the .touched collision process right?
what benchmark the one i did at the top of the post?
it's not about how many times you trigger, it's about a blacklist collision filtering
if we ignore the part and isolate the touch detection then touch is faster then doing a raycast
ok, how would you benchmark that
i never but touch still won even when i never isolated it
i can isolate the physics
but not the parts
if you give me some time i can send you a project with the benchmark
i don't want you to waste your time, can you explain how you would benchmark it so I can make sure yk how to do it
ok so if you have 1000 parts and they all have touch events
then all 1000 parts are detecting touch correct?
?
are they or are they not all detecting touch?
internally roblox is detecting touch for all 1000 parts
then you would simply do 1000 raycasts
how would you know that lol
and then use the microprofiller to see what used more cpu time
do you not see what you just said
and then use the microprofiller to see what used more cpu time
and this is not even a fare test for touch
"internally roblox is detecting touch for all 1000 parts" vs raycasting once or continously for swept/stepped
According to you that Roblox is always detecting and listening for collision on a part, Roblox has to do convex hull x convex hull collision
vs raycasting which is just ray x convex hull collision
the algrothim is way cheaper for raycast detection
what ever Roblox is doing does not matter the result speaks for it self
roblox can do 4 touch checks quicker then you can do 1 raycast
and thats what my benchamark shows
ya man, measure the time it takes to connect to a signal. Not like that's the same for connecting to any signal
how are you even benchmarking loooooool
im not measuring anything
im useing cpu time
i have 1000 parts updating at 240hz
and i have 1000 rays
i check to see what one uses more cpu time
you can't actually benchmark that, you realize it's impossible from Lua right? The only way to come close is doing your own physics math tests by calcaluting the time it takes for a part to collide with another part, then measuring how far off the time it took to fire the .touched. But this all depends on Roblox's event loop too
i can benchmark it and i did
measuring cpu or benchmarking time
measuring Roblox's engine stuff is really inaccurate
i dont believe this
ok i'll give you an example
actually nvm, you were the bafoon who wrote those tests in the first place 😭
😛
the microprofiller is a good way to benchmark things that happen behind the scenes
and it directly corelates to frame rate
Roblox always has stuff running in the background. The only way is to just campare a large amount of entities to something
but i don't think you even understand the point lol
yes you have to do lots to see the effect in the microprofiler
you should go measure 100 bullets being shot and moved by the physics engine every frame on the server with .touched and with your body movers vs just cframming a bullet + raycasting along the trajectory step
look at stats
i mesured 20000 parts in my benchmark
that are anchored?
why are you randomly measuring 20k parts
20k parts welded to a falling part
you realize they would share the same assembly
yes
so why are you welding
thats how i isolate the physics from the touch
im trying to mesure touch detection on its own
but i mesured both with physics and without physics
touch won in both cases if i remember correctly
how are you also raycasting
i don't know why you aren't thinking practically lol
idk how we derailed to performance, we were supposed to be talking about how you would try to handle your own collision detection in your own application
i found the results
20000 parts welded to a moving part running at 240hz this would mean 80000 at 60hz
4000 parts moving to physics running at 240hz this would mean 16000 at 60hz
9000 GetPartBoundsInBox with a size of 32,32,32 running at 60hz
9000 GetPartBoundsInRadius with a radius of 32 running at 60hz
5000 rays that are 64 studs long running at 60hz
if we isolate the physics then 20000 parts is around the same as 5000 raycasts
if we dont isolate the physics then touch is around 4000 parts vs 5000 raycasts
but this is at 240hz
if we use Adaptive timestepping and the part is moving at 60hz then performances will get better for touch
why are you ignoring what I said
i don't understand how saying random numbers is going to influence anyone
what did you say?
80k would be the amount of parts we should be able to support if the part is running at 60hz
what are you saying
but 20k if the part is running at 240hz
what are you supporting? What?
so 5000 rays is the baseline
lets say 5000 rays use 1 second of cpu time
now i will keep adding parts until the parts also use 1 second of cpu time
and 20000 parts running at 240hz is the same as 5000 rays running at 60hz
they both use 1 second of cpu time (well it might not be 1 second i cant remember the value i used as the baseline when testing but its normally just before i start losing frames)
yes its not 100% accurate because CPU time will fluctuate a little based on other things happening in the background but its good enough to tell us what one is faster then the other
if your just doing 1 raycast without any visual effect then raycast will be faster
but if we look at the raw speed of touch and raycasting touch is faster
I see many cases where people use a part and then a ray on top and in this case simply attaching a touch event to that part would be faster then using a separate ray
Current Version: V.4.01 Stable (09/21/2021) Upgrading from 3.xx to 4.0 Please note that V4 is not backwards compatible with V3. There are a few API changes that were introduced in V4 to better suit modern code etiquette. Here are the changes you need to know if you want to make your code compliant with V4: Raycast Hitbox 4.01: For all your m...
here is a example of what happens when people think raycasting is better then touch
because people have the incorrect information that touch is not good they will go to extreme solutions like Raycast Hitbox
but the problems users have with touch is not touch they are having problems with replication but they blame touch when its not touches fault
i still don't understand your performance concerns when you realized you're going to have to use a table and loop through or call descandents or IsAs for whitelisting on collision filtering for touched 💀
how big are even your rays lol
you aren't really giving much context
yeah so they're having inherent problems with the .touched solution 🤔
they're using it for accuracy, i've already told you about microstepping/swept hitboxes
i've also already told you to do custom collision math if you wanted more performance
you're misleading beginners
you can use attributes or tags or folders to see if the part you hit is the correct instance
but because this is dont on the client side
and each client
only does there own bullet
nice, so you got to organize characters into a folder or a table
or query tags
lol
my second demo shows that touch is more accurate then rays
where?
why don't you use it in a game then
i told you before to go post your stuff on the forums
why not make a .touched hitbox lol
i have a projectile video planed for the future
if you think .touched collision has gotten more accurate, then make some hit module that can be attached onto anything, like melee, projectiles, etc
in any form
and use .touched internally
gonna be pretty interesting to see people clone hitbox .touched parts or instance them in and set their properties
nice performance and extra labor
coolio #1091203163173945354 message
go do it, see what people tell u then
ill be using touch in my games
your free to use touch or rays in your game
but i have not been convinced that rays are more accurate or are faster then touch
I think touch was always accurate but i think others blame replication problems with touch given touch a bad reputation
no it wasn't always accurate
I talked to someone who's way more skilled and experienced than I am
the reason was
its been accurate since i started using roblox in 2019
framerate issues with fast moving objects, Humanoids used to "float" causing rounding errors with their feet not touching, and it being up to the physics side of Roblox, which used to not always be in sync with what visually happened on the clients (it is way better now)
basically geometrical robustness issues
not sure what this is saying about touch
the reason why it was inaccurate
what is the reason?
did u not read
" Humanoids used to "float" causing rounding errors with their feet not touching"
yes i read it 10 times i did not see the reason
In mathematics, specifically in computational geometry, geometric nonrobustness is a problem wherein branching decisions in computational geometry algorithms are based on approximate numerical computations, leading to various forms of unreliability including ill-formed output and software failure through crashing or infinite loops.
For instance,...
sounds like a problem with the humanoid
i think the person was just referring to just geometric robustness issues though
but not in games where the character is the focus
i agree with you
not really any good open source alternatives out there yet exactly tho
hopefully Roblox's new physics controller makes them better
Past Updates... v0.1 Our first step in Humanoid Componentization (more info coming soon) begins with a new physics controller. We’ve rebuilt it from the ground up using the same internal objects and constraints that make up the rest of our physics engine. This should provide a more robust and physically accurate controller, open up more customi...
i bet the new controller uses touch where there old humanoids use rays to detect the ground
such a troll
😛
does hip height work in the new controller
hip height is technically adjusting the length of the ray
for my custom humanoids I'm just going to have a pill/capsule shaped mesh for the root and it will be 100% physics based using vectorforce and ill simply let the pill mesh rub along the floor and dynamically adjust the friction so they don't slide around when they don't want to move
most people use capsule colliders
and custom collision/physics for performance speed ups, not sure if it's worth it at all now
ill not use custom ill use Roblox's collision and physics
Ill even enable adaptive timestepping and it should be fine at 60hz
i think when 1 part touches another part roblox will change both to 240hz so that would cause the capsule to always be at 240hz while rubbing along the floor
i have not played around with adaptive timestepping that much so i dont know how well roblox handles it
I wonder how long has this been going on
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
collision groups are more for collision control, it would be a janky way to filter what should trigger for .touched
One message removed from a suspended account.
Would really not be a great solution
Collision groups aren't intended to be used that way
or I guess technically they are since the TouchesUseCollisionGroups property exists in the first place. I just think setting collision groups on parts is a less attractive solution than using a raycast whitelist
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
what
touched relies on the part being there no?
isnt the projectile purely supposed to be visual
and rays do the detection and position the projectile correctly
i just feel like physics way would lead to bad hit detection, physics glitching etc
even considering your arguments suphi
for larger objects, i likely to use touched
This was 9 months ago