Discuss Scratch

PotatoManthetrue
Scratcher
37 posts

How to code a Ping counter in scratch? (if possible.)

So, I know you can code a FPS counter in scratch. But I want to know if you can code a Ping counter. I heard someone say it was similar to FPS counters, but they didn't elaborate on it any further.
Jareddddddd
Scratcher
1000+ posts

How to code a Ping counter in scratch? (if possible.)

I mean yea, but what would it be pinging? Anyways, since cloud variables update every 0.1 seconds, your ping would be the millisecond difference between the expected update time, and the actual update time.
PotatoManthetrue
Scratcher
37 posts

How to code a Ping counter in scratch? (if possible.)

Jareddddddd wrote:

I mean yea, but what would it be pinging? Anyways, since cloud variables update every 0.1 seconds, your ping would be the millisecond difference between the expected update time, and the actual update time.

I was thinking of working on a multiplayer game and thought about adding a Ping counter (like the one that is measured in ms)
mysinginmonsters
Scratcher
100+ posts

How to code a Ping counter in scratch? (if possible.)

A ping counter is the amount of milliseconds it takes for your data to get sent to the server and back to your computer. This matters in cloud multiplayer projects. The fastest ping in Scratch is 100 milliseconds. The higher the number goes, the more “laggy” you will be in the multiplayer game.

You can make this in Scratch like the post above says, but there's really no reason to. I don't think I have seen a multiplayer project in Scratch have a ping monitor.

Last edited by mysinginmonsters (Oct. 4, 2024 13:18:22)

PotatoManthetrue
Scratcher
37 posts

How to code a Ping counter in scratch? (if possible.)

mysinginmonsters wrote:

A ping counter is the amount of milliseconds it takes for your data to get sent to the server and back to your computer. This matters in cloud multiplayer projects. The fastest ping in Scratch is 100 milliseconds. The higher the number goes, the more “laggy” you will be in the multiplayer game.

You can make this in Scratch like the post above says, but there's really no reason to. I don't think I have seen a multiplayer project in Scratch have a ping monitor.

I don't really care about reason, I just thought it would be cool.
mysinginmonsters
Scratcher
100+ posts

How to code a Ping counter in scratch? (if possible.)

I found this which uses the translate block instead of a cloud variable https://scratch.mit.edu/projects/1049595129/editor/
Although I'm not sure this is really accurate to the cloud variables. I don't have a lot of knowledge on how this networking works.
deck26
Scratcher
1000+ posts

How to code a Ping counter in scratch? (if possible.)

I'm not sure what you're hoping to achieve. A normal ping system is used to check the response time for a packet sent to another system. It has to distinguish between pings sent from different sources (eg two users pinging at around the same time) and repeat pings sent from the current user. To do something similar in Scratch would involve quite a lot of work for little benefit.
PotatoManthetrue
Scratcher
37 posts

How to code a Ping counter in scratch? (if possible.)

deck26 wrote:

To do something similar in Scratch would involve quite a lot of work for little benefit.
That explains me coding in scratch tbh.
_the-toe-tickler_
Scratcher
1 post

How to code a Ping counter in scratch? (if possible.)

when green flag clicked
forever
set [ v] to (timer)
end
somethingelse0_0
Scratcher
65 posts

How to code a Ping counter in scratch? (if possible.)

mysinginmonsters
Scratcher
100+ posts

How to code a Ping counter in scratch? (if possible.)

somethingelse0_0 wrote:

maybe this helps: https://scratch.mit.edu/projects/587871304/
That's delta time. Not ping
_
SmallRations
Scratcher
1 post

How to code a Ping counter in scratch? (if possible.)

so IS there a way to detect ping? I'm trying to make a project where the loading screen shows ping, rather than just wifi detection. i just think it'd be a nice touch.
scratcherokay
Scratcher
33 posts

How to code a Ping counter in scratch? (if possible.)

PotatoManthetrue wrote:

So, I know you can code a FPS counter in scratch. But I want to know if you can code a Ping counter. I heard someone say it was similar to FPS counters, but they didn't elaborate on it any further.
Well, as far as I know, setting up a ping would be like this:
when green flag clicked
forever
broadcast [ping]
end

so theoretically, you could just add a
when I receive [ping]
change [ v] by (1)
if <idk> then
set [ v] to []
end

Powered by DjangoBB