#Touched vs Raycast

1 messages · Page 2 of 1

fringe meteor
#

heres proof

#

in the demo, it's all in server, no client

raw oasis
#

did you set the parts network owner to nil?

#

and move it on the server side?

fringe meteor
#

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

fringe meteor
fringe meteor
raw oasis
#

well if thats the case then only delay is reason 2

#

would you like me to make you a demo of reason 2?

fringe meteor
#

no

#

physics engine works at faster rate

#

parts that are falling still don't always trigger .touched

raw oasis
#

reason 2 is because the physics engine runs at 240hz and scripts at 60hz

fringe meteor
#

Buddy what i say

raw oasis
#

so there can be 3 extra physics steps before your script will get the touch event

fringe meteor
#

sure

#

but what's the logic in you knowing it's inaccurate yourself

boreal shore
fringe meteor
#

yet you would recommend it to people

#

then claim it's not inaccurate again

#

LOL

raw oasis
#

and in them 3 extra steps the part might of moved somewhere else

fringe meteor
#

just think of it as inaccurate

raw oasis
#

i never said its more accurate

#

raycasts are more accurate

#

but touch is accurate enough

boreal shore
#

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!!!!

fringe meteor
boreal shore
boreal shore
fringe meteor
#

yeah probably cause the programmers were lazy

#

and don't check the dot product

boreal shore
fringe meteor
#

difference vector projected onto the look vector

raw oasis
fringe meteor
#

changing your entire argument

raw oasis
#

touch is 99% accurate raycast is 100%

fringe meteor
#

99% 💀

raw oasis
fringe meteor
#

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

raw oasis
fringe meteor
#

yes I already shut you down on that

#

you claimed that other collision methods were just as bad btw

#

@raw oasis

raw oasis
fringe meteor
#

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

#

🤡

raw oasis
#

touch is fastest

fringe meteor
#

LOL

#

rejected everything, and now sticking to saying touch is faster

raw oasis
#

touch is fastest touch is 99% accurate

fringe meteor
#

idk man, we would just call you an microoptimizer

#

not even 99%

#

like 50%

#

or less

raw oasis
#

if raycast was secure then i would recommend raycasting

fringe meteor
#

they are

#

i already told you the inherent security flaw in .touched

raw oasis
#

but because there both have the same amount of security i pick touch

fringe meteor
#

pretty much everyone here are beginners

fringe meteor
raw oasis
#

they would be victims if they pick raycasting

#

because they wont be able to see the flaws

fringe meteor
#

No cause you yourself and ici were first thinking about only checking hitbox.position

raw oasis
#

i dont check any position

fringe meteor
#

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

raw oasis
#

i only pick speed if there is no better option

#

and raycasting is only better at accuracy

fringe meteor
#

you pretty much lost your argument, everyone will just see my messages and they'll know the better method

raw oasis
#

but touch is accurate enough

raw oasis
fringe meteor
#

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

raw oasis
#

i would not use body movers

#

i would use apply impulse

fringe meteor
#

yes

raw oasis
fringe meteor
#

will leave dis here for people to see then

#

since you aren't humilated

#

by your bad practices

raw oasis
#

apply impulse is physics?

fringe meteor
#

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

raw oasis
boreal shore
#

oh he left thats unfortunate anywho this has been the most helpful thread for me 🙏

raw oasis
#

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%

boreal shore
raw oasis
boreal shore
#

no 1 frame*

raw oasis
#

so if you change that to spatial query you would run that every frame till the animation ends

boreal shore
#

i dont need that i only need to check once the animation is over so touched is better?

raw oasis
#

um

#

would that not be the same as bringing in a part for 1 frame after the animation ends

boreal shore
#

its a wack animation

boreal shore
raw oasis
#

so if you want to check just 1 frame it would be faster to use spatial query

boreal shore
#

OH?

raw oasis
#

but if you want to check multiple frames then touch would be better

boreal shore
#

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?

raw oasis
#

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

boreal shore
#

this is very confusing lol

#

everything has its own flaws

raw oasis
#

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

raw oasis
boreal shore
raw oasis
#

ok

boreal shore
#

stuff like physics runs at 240z and script running at 60hz i feel like no one talks about it

raw oasis
#

yer i was going to talk about that in a video

boreal shore
#

so whilst touch detects it others wont

boreal shore
raw oasis
#

it effects more things other then touch

boreal shore
#

ive never seen anyone talk about these things

#

and most people look for resources on hit detection

raw oasis
#

you mainly need to know that all hit detection can be exploited

#

and only touch runs are 240hz

boreal shore
#

now i know

#

i knew the 240hz thing but i thought that was a good thing not a bad thing lol

raw oasis
#

and touch does have some aspects where it is more accurate then raycast and spatial query

#

yes its good

boreal shore
#

but from the video he send you can see it being inaccurate

#

i think everything has its own use case?

raw oasis
boreal shore
#

also how would u fix that?

raw oasis
#

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

boreal shore
#

ohhh okay

#

how would u fix that issue

raw oasis
#

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

boreal shore
#

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"

raw oasis
#

its hard to tell because the frame rate is very slow

boreal shore
raw oasis
#

also the part might be in the part but the screen might not of updated

boreal shore
raw oasis
#

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

boreal shore
#

i see

raw oasis
# boreal shore 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

boreal shore
#

okay

raw oasis
#

here is the same code

boreal shore
#

explodes on touch

raw oasis
#

do you see a delay?

boreal shore
#

no

raw oasis
#

so when the touch happens if fires touch event in the next frame

boreal shore
raw oasis
boreal shore
#

AH I SEE

raw oasis
boreal shore
#

so to synchronize it do u just have to delay it by 2 frames?

boreal shore
#

much confused

raw oasis
#

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

boreal shore
#

oh thats horrible

#

so how do u fix it?

#

do u simply not?

raw oasis
#

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

boreal shore
#

oh?

#

theres is more delay in the video he send

raw oasis
#

between the physics engine detecting the touch and the touch event firing

raw oasis
#

yes

#

has it been fixed?

boreal shore
#

i thought this was bc the touched ran at 240hz while

boreal shore
raw oasis
#

so

#

see how there are 3 more physics frames

#

before the touch event

boreal shore
#

yeah

raw oasis
#

well the physics engine keep moving the part in them 3 frames

#

because its not anchored yet

#

the script has not run yet

boreal shore
#

is there no way to fix that?

raw oasis
#

in my bomb demo

#

i set PhysicalProperties.new(0.7, 0.3, 0, 1, 100)

#

this stops the part from bouncing

boreal shore
#

i have no idea what that does

raw oasis
#

i set elasticity to 0 and elasticityWeight to 100

boreal shore
#

oh i see

raw oasis
#

this stops the part from bouncing

boreal shore
#

oh this is really handy lol never knew this existed

raw oasis
#

so remember the 3 frames

#

normally the part will bounce in the next 3 frames

boreal shore
#

oh so it would fire how many ever times it bounces*?

raw oasis
#

then the slow script comes along and anchors the part

boreal shore
#

ahhhh

#

oh ok

raw oasis
#

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

boreal shore
#

AH I SEEEE

raw oasis
#

but this does not make touch inaccurate

#

the touch is detected just fine

#

its the fact that the event fires late that its delayed

boreal shore
#

u must make a video on this

raw oasis
#

i will

boreal shore
#

ive read through a lot of dev forum posts but ive never heard of this

#

so basically touched runs too fast

raw oasis
#

yes

#

so fast that the script cant keep up

boreal shore
#

with the amount of information ive garnered today i feel my brain expanding

raw oasis
#

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

boreal shore
#

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

raw oasis
#

yes a fps unlocker should reduce the delay

boreal shore
#

oh i see

#

oh no wonder those tryhards beat me

raw oasis
#

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

boreal shore
#

maybe

raw oasis
#

ill have to test it

#

anyway im going to go now

#

but ill put making a touch video on the top of my list

lyric rover
#

Thank you for the series, I felt like I just watched an entire movie

ionic fable
#

I was here for the first season as well 😭

fleet sun
#

What

fast solstice
#

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])

south quarry
#

or be a ultimate sigma ligma and use both 😎

#

sigma rule 69: a sigma doesn’t follow any rules

fleet sun
#

ima resort to using spatial query

fleet sun
#

on a heartbeat none the less

somber zealot
#

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.

raw oasis
#

Hopefully I'll have a video soon talking about this topic

somber zealot
#

One message removed from a suspended account.

steel kelp
# somber zealot 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 💀

raw oasis
#

i like free speech so im happy with anyone speaking to me anyway they like

steel kelp
#

I mean that's well and good unless someone is demeaning your abilities

somber zealot
#

One message removed from a suspended account.

steel kelp
#

But I understand you have confidence in yourself 💯

somber zealot
#

One message removed from a suspended account.

#

One message removed from a suspended account.

raw oasis
#

its ok i don't mind if people want to demean my abilities or cus and put me down

steel kelp
#

Alriiight but I'll chime in when it happens 😈

raw oasis
#

im just upset that they was not open to learn why raycasting is just as flawed as touch

steel kelp
#

It does suck but he didn't come here to learn anything to begin with to be fair

raw oasis
somber zealot
#

One message removed from a suspended account.

#

One message removed from a suspended account.

raw oasis
#

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

somber zealot
#

One message removed from a suspended account.

somber zealot
#

One message removed from a suspended account.

fleet sun
#

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"

somber zealot
#

One message removed from a suspended account.

steel kelp
#

"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

raw oasis
#

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

fleet sun
#

@fringe meteor

steel kelp
#

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

fringe meteor
#

I never said that, suphi basically did

#

tell them their experience is made up

shadow hound
#

What are projectiles im new

fringe meteor
#

The problem isn't about not knowing knowledge about projectiles

shadow hound
#

@steel kelp

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

shadow hound
#

What are projectiles

#

I'm new to scripting

fringe meteor
#

other stuff like

#

or not knowing what sanity checks are

#

You can't really get far in game dev without knowing that stuff

steel kelp
#

he may just not focus on lingo

fringe meteor
#

anyone can claim when they started scripting, more so about their practical backgrounds

steel kelp
#

it's not like he doesn't sanity check stuff that is common sense to sanity check

shadow hound
#

What r projectiles??

raw oasis
fringe meteor
#

when did I say that

#

i said it inherently does yeah?

steel kelp
#

or a soccer ball

shadow hound
#

oh

#

So like

#

Flying things

fringe meteor
#

the main problem just is with .Touched as a hitbox method

steel kelp
#

eh kinda

shadow hound
#

or smthn

#

or stuff you shoot

fringe meteor
#

bullets go pretty fast traditionally

shadow hound
#

like that you apply a force to

steel kelp
#

really just stuff that has a drop arc like physics based

shadow hound
#

oh

#

We're doing physics in school

#

Do you do like F = ma

#

Or smthn

fringe meteor
#

if you don't believe my word for how inaccurate hit was, or my experience. Take other people's experience for it

#
steel kelp
#

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

shadow hound
#

4th told me to send this

#

to intimidate you

fringe meteor
#

no i didnt

shadow hound
steel kelp
shadow hound
#

i think 4thaxis is one punch man

#

he says he is in the video

steel kelp
#

Nah y'all don't intimidate me you should invite me to your discord tho

shadow hound
#

kinda convincing argument maybe...

fringe meteor
shadow hound
#

Can you not photoshop dms please

#

It's really rude.

steel kelp
#

Blue guy crackheadery

shadow hound
fringe meteor
#

yes

shadow hound
#

Stop it.

shadow hound
shadow hound
#

I heard 4thAxis made the fastest camera module written for Roblox

#

You better back down, mate.

shadow hound
#
#

There was this kid that said he optimized it but tbh... I think hes a faker or something

fringe meteor
#

pro

shadow hound
#

Isn't retarded a swear word

#

Should they be banned?

steel kelp
#

Really my problem is with toxicity in general

fringe meteor
#

where's the toxicity

shadow hound
#

Kill yourself

steel kelp
#

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

shadow hound
#

I have 67 IQ

steel kelp
#

yeah right

fringe meteor
#

🙏

steel kelp
#

💀

#

We all have different experience bro

fringe meteor
#

i'm referring to practical experience

shadow hound
#

You seem really egotistical

steel kelp
#

Plenty of the topics he's discussed are practical

shadow hound
#

m8

steel kelp
#

me?

shadow hound
#

No

#

The other one

fringe meteor
shadow hound
#

@fringe meteor *

fleet sun
#

Yo

fringe meteor
#

i don't watch his youtubes or anything

fleet sun
fringe meteor
#

but teaching how to use like, if statements or whatever is stuff anyone can do with general programming knowledge

shadow hound
#

I dont think you need to have made a game to have experience in game development.

fringe meteor
#

knowing theory is one thing

shadow hound
#

Plenty of people are capable of gaining experience by building frameworks and libraries to assist game developers on Roblox.

steel kelp
#

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

fringe meteor
#

how to setup roblox physics projectile
Probably cool to mess around for beginners

somber zealot
#

One message removed from a suspended account.

fringe meteor
#

but that's not really applied in real games tho, if you have an FPS game for example

shadow hound
#

4thAxis says suphi kaner has no experience

#

Idk why...

#

@somber zealot

fringe meteor
#

pretty much none from what he said before

#

also @shadow hound is just trolling lol

somber zealot
#

One message removed from a suspended account.

steel kelp
#

I think Suphi is capable of understanding why your approach is superior, I think his hangup is with Touched being as spoofable as raycasting

shadow hound
#

I'm not trolling

#

You literally said he has no experience.

raw oasis
#

i recently changed my mind

fringe meteor
#

more about one thing working

#

over the other

raw oasis
#

i now think touch is more secure then raycasting

fringe meteor
#

i already told him that he'll have to deal with 100+ more debates from programmers on why touched sucks lol

raw oasis
#

raycasting can only be as secure as touch if you have it delayed like fastcast

fringe meteor
steel kelp
#

suphi really needs to make a video on touched based projectiles is what I'm gathering from this

fringe meteor
#

how about he makes an FPS game using touched on bullets instead

steel kelp
#

that is true

#

would also be a good litmus test

raw oasis
shadow hound
#

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

somber zealot
#

One message removed from a suspended account.

steel kelp
#

Simplest way would be to make one game that can switch between the two systems in a single server

fringe meteor
somber zealot
#

One message removed from a suspended account.

raw oasis
fringe meteor
#

can?

#

raycast you'll know will be good

#

its about touched keeping up looool

raw oasis
#

touch would be more accurate then raycasting but a player would not feel the difference

fringe meteor
#

yes seems like we should deprecate raycasts honestly

shadow hound
#

Fr muzan

fringe meteor
#

touched clearly superior

#

no need for any other hit detection method

raw oasis
fringe meteor
shadow hound
somber zealot
shadow hound
somber zealot
#

One message removed from a suspended account.

shadow hound
raw oasis
#

just need to make the thumbnail

shadow hound
#

🗿

somber zealot
#

One message removed from a suspended account.

#

One message removed from a suspended account.

raw oasis
#

😛

somber zealot
#

One message removed from a suspended account.

raw oasis
#

still datastore

somber zealot
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

raw oasis
#

1 more datastore after this video

fringe meteor
#

ping me for the drop 🔥

somber zealot
#

One message removed from a suspended account.

somber zealot
#

One message removed from a suspended account.

raw oasis
somber zealot
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

raw oasis
#

whos asimo?

somber zealot
#

One message removed from a suspended account.

raw oasis
#

oh cool what did he say?

somber zealot
shadow hound
#

He said raycasting is better than touched

raw oasis
#

ok

somber zealot
#

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.

raw oasis
#

not in my datastore videos

#

but i will in my other videos

somber zealot
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

raw oasis
#

mainly debugging in the datastore module

#

and like how to show a indicator to the client when the datastore is having connection problems

somber zealot
#

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.

raw oasis
#

here is a demo that shows how touch is more accurate then rays

#

You can change the projectiles height to effect the test

raw oasis
#

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

somber zealot
#

One message removed from a suspended account.

somber zealot
#

One message removed from a suspended account.

fringe meteor
#

😭

#

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.
#
  • 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)

#

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
steel kelp
#

I'd say that was a pretty convincing wall of text

#

@raw oasis may have trouble arguing his way outta this one..... Smile

#

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

somber zealot
#

One message removed from a suspended account.

#

One message removed from a suspended account.

raw oasis
# fringe meteor Also idk where you're going with client only projectile physics LOL

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

  1. Touch is more accurate

  2. Touch has better performance

  3. 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

  1. the shooter has network ownership of the projectile

  2. the shooter tells the server what the projectile hit

raw oasis
#

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

fringe meteor
#

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

raw oasis
#

and make the client reuse the same replicated bullets

fringe meteor
#

" 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

fringe meteor
#

can you describe how you would handle your fps networking then

raw oasis
fringe meteor
#

i did lol

raw oasis
fringe meteor
#

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

raw oasis
#

every fact has to stand on its own feet

fringe meteor
#

cool, let's believe in someone claiming there's aliens

raw oasis
fringe meteor
#

the latter is the standard and the former wouldn't work properly with your .touched idea

raw oasis
fringe meteor
#

people believe in facts

#

people are influenced by people with authority

raw oasis
fringe meteor
#

mkay

#

I think we just call them ignorant people

raw oasis
#

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

fringe meteor
#

yeah we also call that dulesionalism

fringe meteor
raw oasis
#

i belive touch is better then ray you belive ray is better then touch

fringe meteor
#

okay, but why are you dodging questions though

raw oasis
#

if you can prove to me ray is better ill change my mind

raw oasis
fringe meteor
#

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

raw oasis
#

well i believe i can prove that touch is better then rays

fringe meteor
#

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

raw oasis
#

and i dont mind you believing what you want

fringe meteor
#

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

raw oasis
raw oasis
#

if people ask for help ill try and help them

fringe meteor
#

then why are you talking about .touched vs raycast

raw oasis
#

someone asked what is better and i told them my belief

fringe meteor
raw oasis
#

now its down to them to choose if they accept what i say or not

fringe meteor
#

seems like they ignored this guy

fringe meteor
raw oasis
fringe meteor
raw oasis
fringe meteor
#

so you don't trigger .touched on your own character

#

with raycast, you don't need to worry about that

raw oasis
#

i would have touched on the bullet

fringe meteor
#

yeah? So what, you'll spawn it offsetted 2 studs forward?

raw oasis
#

and each client has touched on there own bullet

fringe meteor
#

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

raw oasis
#

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

fringe meteor
#

"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

somber zealot
#

One message removed from a suspended account.

fringe meteor
#

you said you use .touched cause of performance right? Seems countradictary here

fringe meteor
raw oasis
fringe meteor
#

not in Lua-land

raw oasis
#

the server wont receive the touch event

fringe meteor
#

that doesn't solve your collision filtering problem though

fringe meteor
#

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

raw oasis
fringe meteor
#

you understand the .touched collision process right?

raw oasis
fringe meteor
raw oasis
# fringe meteor ya

if we ignore the part and isolate the touch detection then touch is faster then doing a raycast

fringe meteor
#

ok, how would you benchmark that

raw oasis
#

i never but touch still won even when i never isolated it

#

i can isolate the physics

#

but not the parts

fringe meteor
#

lol what is it winning

#

if there's no benchmarking

raw oasis
#

if you give me some time i can send you a project with the benchmark

fringe meteor
#

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

raw oasis
#

ok so if you have 1000 parts and they all have touch events

#

then all 1000 parts are detecting touch correct?

fringe meteor
#

mmm?

#

you're basically measuring the event loop speed then LOL

raw oasis
#

?

#

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

fringe meteor
#

how would you know that lol

raw oasis
#

and then use the microprofiller to see what used more cpu time

fringe meteor
#

do you not see what you just said

raw oasis
#

and this is not even a fare test for touch

fringe meteor
#

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

raw oasis
#

roblox can do 4 touch checks quicker then you can do 1 raycast

#

and thats what my benchamark shows

fringe meteor
#

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

raw oasis
#

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

fringe meteor
#

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

raw oasis
#

i can benchmark it and i did

fringe meteor
#

measuring cpu or benchmarking time

#

measuring Roblox's engine stuff is really inaccurate

raw oasis
fringe meteor
#

ok i'll give you an example

#

actually nvm, you were the bafoon who wrote those tests in the first place 😭

raw oasis
#

😛

#

the microprofiller is a good way to benchmark things that happen behind the scenes

#

and it directly corelates to frame rate

fringe meteor
#

but i don't think you even understand the point lol

raw oasis
#

yes you have to do lots to see the effect in the microprofiler

fringe meteor
#

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

raw oasis
#

i mesured 20000 parts in my benchmark

fringe meteor
#

that are anchored?

raw oasis
#

?

fringe meteor
#

why are you randomly measuring 20k parts

raw oasis
#

20k parts welded to a falling part

fringe meteor
#

you realize they would share the same assembly

raw oasis
#

yes

fringe meteor
#

so why are you welding

raw oasis
#

thats how i isolate the physics from the touch

fringe meteor
#

what

#

why

raw oasis
#

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

fringe meteor
#

what are you even camparing it to

#

edits to " if i remember correctly" 💀

fringe meteor
#

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

raw oasis
#

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

fringe meteor
#

what does 80k mean

#

or 16k mean

#

what are your results even

#

80k at?

raw oasis
#

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

fringe meteor
#

why are you ignoring what I said

#

i don't understand how saying random numbers is going to influence anyone

raw oasis
fringe meteor
#

what is 80k suppsed to mean

#

clock cycles?

raw oasis
#

80k would be the amount of parts we should be able to support if the part is running at 60hz

fringe meteor
#

what are you saying

raw oasis
#

but 20k if the part is running at 240hz

fringe meteor
#

what are you supporting? What?

raw oasis
#

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

#
#

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

fringe meteor
#

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

fringe meteor
fringe meteor
#

i've also already told you to do custom collision math if you wanted more performance

#

you're misleading beginners

raw oasis
#

but because this is dont on the client side

#

and each client

#

only does there own bullet

fringe meteor
#

or query tags

#

lol

raw oasis
fringe meteor
#

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

raw oasis
#

i have a projectile video planed for the future

fringe meteor
#

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

raw oasis
#

#1091203163173945354 message

#

this shows touch is more accurate then rays

fringe meteor
#

gonna be pretty interesting to see people clone hitbox .touched parts or instance them in and set their properties

#

nice performance and extra labor

fringe meteor
fringe meteor
raw oasis
#

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

raw oasis
fringe meteor
#

no it wasn't always accurate

#

I talked to someone who's way more skilled and experienced than I am

#

the reason was

raw oasis
#

its been accurate since i started using roblox in 2019

fringe meteor
#

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

raw oasis
fringe meteor
#

the reason why it was inaccurate

raw oasis
fringe meteor
#

did u not read

#

" Humanoids used to "float" causing rounding errors with their feet not touching"

raw oasis
#

yes i read it 10 times i did not see the reason

fringe meteor
#

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,...

raw oasis
fringe meteor
#

suphi: Don't use humanoids

#

💀

raw oasis
#

well i do

fringe meteor
#

i think the person was just referring to just geometric robustness issues though

raw oasis
#

but not in games where the character is the focus

fringe meteor
#

humanoids do suck anyways

#

an old artifact

#

i wouldn't blame u for not using it

raw oasis
fringe meteor
#

not really any good open source alternatives out there yet exactly tho

raw oasis
#

hopefully Roblox's new physics controller makes them better

#
#

i bet the new controller uses touch where there old humanoids use rays to detect the ground

fringe meteor
#

such a troll

raw oasis
#

😛

#

does hip height work in the new controller

#

hip height is technically adjusting the length of the ray

raw oasis
fringe meteor
#

most people use capsule colliders

#

and custom collision/physics for performance speed ups, not sure if it's worth it at all now

raw oasis
#

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

fast solstice
#

I wonder how long has this been going on

somber zealot
#

One message removed from a suspended account.

#

One message removed from a suspended account.

fringe meteor
#

collision groups are more for collision control, it would be a janky way to filter what should trigger for .touched

somber zealot
#

One message removed from a suspended account.

steel kelp
#

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

somber zealot
#

One message removed from a suspended account.

#

One message removed from a suspended account.

somber zealot
#

One message removed from a suspended account.

somber zealot
eager herald
#

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

fast solstice
#

for larger objects, i likely to use touched

ionic fable
#

This was 9 months ago