Discuss Scratch

bharvey
Scratcher
1000+ posts

Snap! user discussion

xly wrote:

As soon as graphic interface + “turtle” + Logo (“Lisp disguised in Basic” ), was invented in the early 80' … none could … ignore the graphics commands of “turtle” like MOVE, TURN …
Oh, we can do turtle graphics in Scheme, but the procedures still return values, even if the value isn't the reason you're using the procedure. It's having two different kinds of procedure that's unSchemely, not having side effects. So, we shouldn't have to have both CALL and RUN, or both ASK and TELL, or (really just for historical reasons) the two CLONE blocks, or the two IF/ELSE blocks, etc.

P.S. As for parentheses, please note that all block languages are, in fact, fully parenthesized. It's just that you don't type the parentheses on the keyboard; you make them by dragging blocks into each other.

tcrass
New to Scratch
7 posts

Snap! user discussion

Hi there,

on the last forum pages I've learned that Snap! is not primarily about speed, but I keep wondering if it was – already today? – possible to increase Snap!'s performance on a Raspberry Pi 3. My kids and me have about a dozen sprites moving around, doing collision detection between one of them and all the others each round, and the animation speed is an estimated 2 fps. It wasn't all that bad before we introduced collision detection, so I guess this is a real bottleneck.

So… any advice on how to speed things up would be appreciated.

Cheers –

– Torsten
bharvey
Scratcher
1000+ posts

Snap! user discussion

tcrass wrote:

It wasn't all that bad before we introduced collision detection, so I guess this is a real bottleneck.
Are you doing sprite-sprite collision detection, or sprite-color? Sprite-sprite is way faster. Often you can get the effect of sprite-color by nesting sprites, so the blue (or whatever) part of the sprite is actually a second sprite attached to the first.

Jens
Scratcher
100+ posts

Snap! user discussion

another idea is to avoid pixel-perfect collision detection altogether and only check for a threshold of DISTANCE TO, like NetLogo and many particle systems do. I'm not recommending this, because I love collision detection myself, but if that's the bottleneck on low-powered hardware it might be an idea…
tcrass
New to Scratch
7 posts

Snap! user discussion

Hi,

Are you doing sprite-sprite collision detection, or sprite-color? Sprite-sprite is way faster. Often you can get the effect of sprite-color by nesting sprites, so the blue (or whatever) part of the sprite is actually a second sprite attached to the first.

we're doing sprite-sprite collision detection, not sprite-color. (spaceship vs asteroid, you know… ;-)

another idea is to avoid pixel-perfect collision detection altogether and only check for a threshold of DISTANCE TO, like NetLogo and many particle systems do. I'm not recommending this, because I love collision detection myself, but if that's the bottleneck on low-powered hardware it might be an idea…

Sigh… that's what I did in my first asteroid implementation some 25 years ago in TurboPascal… It seemed so promising to have “real” collision detection available in Snap!. (BTW, there sure is a bounding box overlap test prior to pixel-to-pixel comparison, right?)

Cheers –

– Torsten
tcrass
New to Scratch
7 posts

Snap! user discussion

OK, this is interesting…

Initially, we put the collision test into a generic “if <…>” start block. After moving it into the endless loop which moves the (asteroid) sprites, the animation looks a lot smoother! It seems the tests were performed way too often under the initial circumstances – perhaps for each sprite after each sprite's move (which for n sprites would sum up to n² tests, as compared to only n tests in the new implementation)?

Cheers –

– Torsten
Jens
Scratcher
100+ posts

Snap! user discussion

yes, Snap! performs a bounding box collision test before checking the pixels. Usually, sprite collision detection is really, really fast and efficient in Snap, because graphics cards kinda do it for almost free. Hmm, must be something about the Raspberry Pi that's slowing down graphics…
Jens
Scratcher
100+ posts

Snap! user discussion

Oh, I missed your second observation about optimizing performance by not using generic WHEN hat blocks! Great, I'm glad you found a way, yay!
xly
Scratcher
100+ posts

Snap! user discussion

bharvey wrote:

tcrass wrote:

It wasn't all that bad before we introduced collision detection, so I guess this is a real bottleneck.
Are you doing sprite-sprite collision detection, or sprite-color? Sprite-sprite is way faster. Often you can get the effect of sprite-color by nesting sprites, so the blue (or whatever) part of the sprite is actually a second sprite attached to the first.

After further testing the DISTANCE method suggested by Jens is excellent.

Last edited by xly (Nov. 5, 2017 21:08:06)

IAmTheGeekSquad1962
New to Scratch
4 posts

Snap! user discussion

I would like some information about running Snap in a classroom setting.

Is it possible to install snap on a server and let 12 or so students do development using Chromebooks?
PullJosh
Scratcher
1000+ posts

Snap! user discussion

IAmTheGeekSquad1962 wrote:

Is it possible to install snap on a server and let 12 or so students do development using Chromebooks?
Any particular reason you don't want to use the hosted version that's already online?

bharvey
Scratcher
1000+ posts

Snap! user discussion

IAmTheGeekSquad1962 wrote:

Is it possible to install snap on a server and let 12 or so students do development using Chromebooks?
The normal thing is to run it from our web site. That does work on Chromebooks. If you want to install a local copy, it'll run, but you won't be able to log into our cloud server, so you'll have to save projects locally. I haven't used a Chromebook myself so I'm not sure, does it have local file storage?

IAmTheGeekSquad1962
New to Scratch
4 posts

Snap! user discussion

bharvey wrote:

IAmTheGeekSquad1962 wrote:

Is it possible to install snap on a server and let 12 or so students do development using Chromebooks?
The normal thing is to run it from our web site. That does work on Chromebooks. If you want to install a local copy, it'll run, but you won't be able to log into our cloud server, so you'll have to save projects locally. I haven't used a Chromebook myself so I'm not sure, does it have local file storage?

I've tried to create an account, but was never asked for a password during setup. Instead I got “data is temporarily unavailable Error ID…” I never received any confirmation email from snap.berkeley.edu. I did try to create the account a second time, but the system now recognizes that the id is already taken. It looks like the account only got partially created.
bharvey
Scratcher
1000+ posts

Snap! user discussion

IAmTheGeekSquad1962 wrote:

I've tried to create an account, but was never asked for a password during setup. Instead I got “data is temporarily unavailable Error ID…” I never received any confirmation email from snap.berkeley.edu. I did try to create the account a second time, but the system now recognizes that the id is already taken. It looks like the account only got partially created.
I'm sorry you had that problem. If you email me (bh@cs.berkeley.edu) the user ID I'll see about getting you a password.

Alternatively, click the “change password” item in the cloud menu and it should set a new password to your email on file.

sonnyglau
New to Scratch
1 post

Snap! user discussion

Hi,

I'm trying to help one of my students out. I'm trying to open her project and it is stuck in the “Opening project…” portion. The project will never open.

Here is the link to her project that won't open.

http://bjc.edc.org/snapsource/snap.html#present:Username=asmith8&ProjectName=snowman


Thanks!

Last edited by sonnyglau (Dec. 4, 2017 21:38:36)

bharvey
Scratcher
1000+ posts

Snap! user discussion

sonnyglau wrote:

I'm trying to help one of my students out. I'm trying to open her project and it is stuck in the “Opening project…” portion. The project will never open.
It's too big to load. Here's a version with the costumes and the huge dictionary removed. She can put in a smaller dictionary etc. and try again:
http://snap.berkeley.edu/snowman.xml

theLman
Scratcher
80 posts

Snap! user discussion

Hi everyone,

I've been trying to get started on Snap a few times over the last year or so, but I can never seem to log on. When I try and re-set my password, it sends me a link, but when I (immediately) click on it I get the error message: “password reset key: <whatever it is> is no longer valid, please request a new one.” Has anyone else had this problem? I wonder if it's related to time zones?

Edit: By the way, the reference manual is amazing! It's so easy to follow. I wish all programming languages were documented in this style.

Last edited by theLman (Dec. 19, 2017 14:13:56)

bharvey
Scratcher
1000+ posts

Snap! user discussion

theLman wrote:

I've been trying to get started on Snap a few times over the last year or so, but I can never seem to log on. When I try and re-set my password, it sends me a link, but when I (immediately) click on it I get the error message: “password reset key: <whatever it is> is no longer valid, please request a new one.” Has anyone else had this problem?
Sorry you're having this trouble!

This is a known problem. It happens rarely but persistently. We're working on it. Meanwhile, mail me (bh@cs.berkeley.edu) your Snap! login name and the email address you used, and we'll send you a password manually.

theLman
Scratcher
80 posts

Snap! user discussion

bharvey wrote:

theLman wrote:

I've been trying to get started on Snap a few times over the last year or so, but I can never seem to log on. When I try and re-set my password, it sends me a link, but when I (immediately) click on it I get the error message: “password reset key: <whatever it is> is no longer valid, please request a new one.” Has anyone else had this problem?
Sorry you're having this trouble!

This is a known problem. It happens rarely but persistently. We're working on it. Meanwhile, mail me (bh@cs.berkeley.edu) your Snap! login name and the email address you used, and we'll send you a password manually.

Thank you Looking forward to getting into SNAP!, the updates in 4.1 look great. Any updates on the rollout of the planned new front page?
bharvey
Scratcher
1000+ posts

Snap! user discussion

theLman wrote:

Any updates on the rollout of the planned new front page?
The latest theory is to have a beta release for brave people in Feb, and the big cutover in March.

Powered by DjangoBB

Standard | Mobile