Nerdy Hopscotch Questions - Coding Megathread

I have a question: why are strings that contain only numbers, not any letters or space, limited to 23 digits?

2 Likes

Wdym can you add more detail or an image

1 Like

theyre not strings, theyre number (11, 826, -2, etc) and they have a length limit [1] which is probably what you mentioned.


  1. maybe javascript limit? not sure ↩︎

1 Like

Ok, let’s say I’m making a semi-auto pixel art, and I just copied out the string, and used something to remove all whitespace, and copied it directly into Hopscotch, why does it become only 23 digits and it is not the original string

2 Likes

editor or player? if it’s editor, it’s a bug, and if it’s player, it’s what i said 2 posts above

2 Likes

Aah! That makes so much sense! The number would be e+ and would not work

3 Likes

yeah it turns into an exponent

2 Likes

after some coding experience, i found out that we need to add an empty wait (0) after a destroy block or the block after it will be run

3 Likes

I don’t have a project on hand, but something you can do is explore the main variable in the browser console while the project runs on a computer. That should be able to answer some of those questions

Depends on the loop – some like device press I think are limited to 30FPS, but game playing I think is 60. I’m not super involved in the player, so I wouldn’t know other performance differences right now.

Very much. Removing the canvas, or even the frame, doesn’t seem to ever fully reset the tab memory to what it was before that. To be honest though, maybe something isn’t being garbage-collected when it should be though.

If they don’t exist on stage, theoretically nothing would have effect. If they do, Set Text would have the largest impact I would imagine.

I think I remember that… there’s also some weird behavior that occurs when you run two or more destroy blocks on the same frame with invisible objects.

4 Likes

Hmm… memory leaks? :thinking:
That does count as a memory leak right? lol

Hmm, actually do you think that’s related to the SVG engine? Maybe Set Object (changing the shape for example) has the same performance hit?

(I’m actually now wondering if new SVG text objects are instantiated every time behind the scenes, or if they just change text contents. I’m guessing i uses <svg>? I would hope that it’s the latter…)

I’ll definitely need to mess with projects in the browser console a lot more.

3 Likes

someone ready to test that out?

3 Likes

Already have before, I pretty sure I did z index 99999999 before it womped!

1 Like

Welp now i know the best way to have intentional lag (not that i want it)

More fun frame rule stuff:

1 Like

I believe it stays around for a frame or so then it gets removed.

That would make sense but not by much.

They’re not strings. Currently in player 2.x there is no way to get a string with only digits. Characters between block no longer always returns a string

Yes the player definitely has memory leaks.

I’ve been working on a player mod to explore these sorts of things in the app more easily and to step through code one block at a time, which should make debugging code that is split across multiple rules easier.

If I recall correctly, whenever an object changes its z index the player sorts the objects at the start of the next frame. To do this, it makes a huge array that is the size of the highest z index set, which would take a lot of memory at higher z indices. Definitely try to keep z indexes low and change them infrequently for best performance.

6 Likes

So you make the player interface, I make the editor interface? Got it. Here’s my preview of what I’m working on (finally I can show it now that the web editor is released!)

Yes, that’s correct.

5 Likes

Where is the modding tool or project search on the web player?

1 Like

not public yet – it’s a browser extension

1 Like

Where is the browser extension. Or is it not out yet

1 Like

“Spider HS” still choosing a name

AE is also still working on it

pretty awesome (e)

2 Likes