Howdy! I made a spelling bee game, and when someone on vr takes off their headset without leaving the room, everything just breaks when it's their turn. The timer for the word stops, the word audio doesn't play, nothing that needs to fire fires until they disconnect, which can be 3-10 minutes before that happens... how can I prevent this from happening?
#Player AFK Detection
1 messages · Page 1 of 1 (latest)
Well, there is a "Is player afk" chip
That would be my first try
And if that didn't work for some reason, I would check the velocity of there head, and if under a certain threshold for long enough, send them to dorm or another subroom
every 10-15 seconds check if the head and hands positinos and velocities are the same as last check
if they are, you save their positions in a list and if the positions are still the same after 2-3 checks that mean that they're afk
it's slow but it wont work on someone who just lags badly
you can change the interval between checks but dont make it too small
The issue here is that if someone takes off their headset wont all circuits being fired not work on them?
most circuits just stop working fully when someone is frozen (has their headset taken off), so chips like "is playe afk" might not work
Because you can try to votekick/softban them yet it doesn't work until they de-log
So just have room auth check for them?
What if room auth is frozen 💀
pick 3 random players and check everyone from their perspective
basicaly this
I might just have the room auth be pinged by someone random and if it doesn't get received then room auth is frozen.
this might fry the net heat so you can try to decrease players that check or add some randomness (f.e. every player has 1 out of 5 chance to check everyone else)
its like 2% net heat
not even
i said "might"
and im always paranoid about net heat ngl
3 things to note:
- Sending an empty event to all players is extremely cheap
- Sending an event to all players is the same net as sending it to 1 player
- Network heat is a measure of data sent per second, if you send the signal once every second, all net heat the first signal caused will be cleared by the time the second signal is sent
So what you're implying is just send an event to everyone and just have them send an event right back?
No, no sending back, there is no need
Just have everyone send a signal to everyone every second
If you dont receive a signal from someone after a certain timeframe (say, 5 seconds), then you know they have stopped sending pings
So then how would you detect if someone doesn't receive it: and also how do you get who that is?
You dont care if they dont receive it
oh yeah, ig ALSO include a player lol
I'm so lost lmao
have everyone tell everyone the player who sent the signal
You dont give a shit if they got the signal or not, you only care if they are sending signals to you
If they arent sending signals to you, they are frozen
Everyone sends everyone signals every second
Lets say it was a two way ping system
PlayerA sends a ping to PlayerB
How does PlayerA know that PlayerB was pinged? well, lets have PlayerB send a ping back... wait, how does PlayerB know that PlayerA received their ping?
basicaly each iteration you save every ping into a player list
compare that list to "all players" list
if there's an elements that only shows in all players but not in your custom list that means that players doesnt send signals
prob not the best solution but first thing i could come up with
You wouldn't save the players, you'd just have 1 List<Float> Variable keeping track of when you received a signal from that player. The list should have 1 element for each player that can be in the room (If max players is 20, have 20 elements). When you receive a signal from a player, set the item at their room index in the list to the current time
nah I'm just playing
you should playe enigmatica 2: expert fr fr
for normal ppl, it's a very hard tech modpack for 1.12.2
So then just check like every 10-15 seconds if their response time hasn't changed then give em the boot?
yeah
sweet
Well, no...
For the most efficient check, check at 60hz
For a check thats good enough, you can just check after sending your ping signal
If you're sending a signal every second, and you assuming everyones ping is under 4000, then you can have the timeout duration be like, 5 seconds, 1 second for the ping delay, 4 for networking delays
I might have it be 10 just for extra safety
Wait what would I set their variable as?
Just delta time?
you set it to Instance Get Lifetime
that way you can check Current Lifetime - Stored Lifetime = time thats passed since last signal
But what would I set the list<float> as?
Like when a player joins do I add their index to it or something?
Ok I changed it to be something like this...
Now what 🤣 I'm very lost atp
Have the local playr send a signal to all players containing themselves (player type)
When you receive this signal, get their room index, set their room index in pingTime to Instance Get Lifetime
now you know the ping times for all players
At 30hz/every second, go through this entire list and see whos last pings are more than X seconds ago
Ok this makes sense but I'm still confused... if I set the index of the list while it's empty it's an error... what do I set the list as to have the index of everybody?
initialize the list when you join to have as many elements as the subroom player count
If your subroom supports 16 players, initialize the list to have 16 elements
So just set the list to a list create with 8 items?
when the local player joins, yes
Alternatively, you could also set the list everytime you check
So, every time you check, if the list has 0 items, set it to 8 items, else do nothing
Okie dokie
So send an event to all and set the list index to be the local player's room index and then change the element value to be the instance lifetime?
no...
Send an event to all players
When the LOCAL PLAYER receives a signal from A PLAYER, get THAT PLAYERS room index, and set the value at THEIR room index to instance get lifetime
Can you boot them if they're in that state of having their headset off but not being fully out of the room?
No idea about sending them to different rooms, but you can remove them from your custom game
Still kind of lost but trying my best 😬
This getting there??
checking the values and setting the values are different
send the event Ping Time to all players once per second, all that should do is set the List Set Element
I hate that circuitboard, but yes, now you have the ping system setup
Now you need to be able to check the time of the last ping for each player
btw, for a rate limit system, do this
Function, looks way nicer, way cheaper on chips
Ok I got this part made... how tf do I execute it lmao
There's nothing in my palette for functions
call Rate Limiter
Yup found it
That add is in the way what ports is it outputting to?
I did something wrong with it but idk what because it is not executing once per second...
I think you have to wire it into itself (the saved time part into the same port)
Yeah I did
Ok anyways here we are 🤣
Alright I got here. I changed the event to only send to others instead of all because if it's on all the list will store twice in one second. But here it's able to detect other players who are afk
you cant check a players value after they send it to you
the time will always be 0
You need to check ALL players values when YOU send a signal, so after YOU send Ping Time
that, or you could also do it at 30hz
Your check time should be less or equal to the ping delay, so with a 1s ping delay, you can check every time you send or faster (like 30hz)
faster is technically more accurate, but doing it every time you send should have the same effect
Ok is it bad if I ask for a visual? I am very confused on what to do 🤣
Looks familiar 
Isn't the issue that the player entering this state causes circuits to stop functioning until they fully leave?
thats why other players run it
It's been a long while since i've had this happen so i may just be misremembering or it may have changed, but doesn't it affect all players in the instance?
Why would 1 person freezing up cause other player's circuits to stop working?
It doesn’t. The issue is when it’s their turn, the timer for spelling stops, which means they can’t spell and the game freezes
Essentially breaking it for everyone
I guess i'm just thinking of how it behaves in quests, it makes all functionality stop in there
Yeah, CV1 stuff relied on RA to work.
Ah, didn't know it had anything to do with room authority
Is that why paintball crashes constantly