Combatting storage limitation

I never noticed before, but I can now see a ‘destroy’ block.

I don’t know if this will come in handy at any stage, but when applied to a certain object, does it completely cease to exist, removing the memory of that object from the player or does it still remain clogged in the memory? If destroying objects does preserve memory, then I can apply destroy blocks whenever the trees are not on screen.

6 Likes

It literally destroys the object so it ceases to exist I think

4 Likes

I believe it removes it, but I may be wrong. I can check.

6 Likes

Also, I don’t think there is an undestroy block so why keep the objects memory?

3 Likes

It removes it as far as I know. I will test it in an hour and tell you the results.

5 Likes

It seems to remove it completely, though I don’t know if what I tested was what the block actually does.

5 Likes

It’s good to note that the quadrilaterals are the same width and height of the objects.

3 Likes

It appears they get destroyed at the next memory dump. Although the web player seems to have a memory leak so it is hard to tell.

5 Likes

Yeah, the function I tested was somethign along the lines of addToDestroyQueue, destroy() seems to freeze the project, though that may be because of collision rules.

6 Likes

So, @tehgreatdoge and @Petrichor, in terms of the efficiency of a project, do you conclude from your tests that using the destroy block on objects when they are not on screen will enhance the player?

4 Likes

Yeah it makes everything a lot faster and smoother

4 Likes

Set text also tends to cause lots of issues too due to its image change a frame late. In E-Pad, I combat this by using a variable that changes to -1 about 100ms before actually destroying it.

2 Likes

Yes, definitely – especially since player performance has gotten worse, every object matters once you pass about 100-200 (depends on their actions too but yeah try to minimize the number of objects if possible)

2 Likes

@FearlessPhoenix & @Awesome_E, in fact, I have just observed that it has the reverse effect on the player.

I used one ‘destroy’ block on only three objects, and the FPS calculations altogether crashed. Seconds later, the entire project crashed. After removing these objects, the project acted as normal. So are these destroy blocks optimal after all?

Still, there must a way to optimise the performance of the player despite a huge amount of texts. But as to how, I am at a loss.

4 Likes

That’s interesting.
In my pixel arts, I always use a destroy block…
it’s not the inbuilt one but rather a json eidted one via ae’s shortcut but it’s the same thing, just a different name.

I wonder what that’s happening to you

4 Likes

The project has a huge amount of Unicode texts, so the memory is probably maxed out.

Perhaps it uses a lot of memory to destroy an object, which my project can not afford?

3 Likes

Possibly, but i don’t see why that’d be the case…

3 Likes

Interesting.

Destroy has some quirks to it still –

  • I never destroy an original object
  • When more than 1 destroy is executed on the same frame while object is invisible, it destroys a different clone
  • Make sure rules have no possibility of activating when an object is destroyed (I am not sure if it tries to start a new rule, but it will freeze if you are finishing a rule sometimes.
3 Likes

Maybe link us a project?

Or if you want to send the project to only me

Pop in a project request here and just put the reason “project doesn’t load” and I can take a look at it and see what’s going and give a response.

(see this post for info on getting a draft’s UUID)

</details
2 Likes

Thanks for offering, but don’t stress about it. My project works fine without the destroy blocks, so I will stick to working without them.

But if unusual happenings occur more frequently later on, I will inform you

2 Likes