How to fix lag?


#1

Me and @CreativeCoder are making a game and it's very laggy, does any one have ideas on how to make it less laggy?


#2

Does the game have a lot of clones or code?


Clones are lagging?
#3

@Kiwicute2015 The game doesn't have any clones, and I have made games with more code before. The link is:
https://c.gethopscotch.com/p/xkmc287uu


#4

Strange. I've only had a lag problem with clones. I don't know the problem then.


#5

I know, it's strange. We'll keep trying. Thanks anyways!


#6

@AHappyCoder I will try to recreate the code you put in. Maybe it just lags for some random reason


#7

The reason for the lag here is that you put a WHOLE lot of rules that it lags a lot. Usually, projects with many characters or rules tend to lag.

This is because the iPad (or device rather) have to keep track of a lot of rules, especially when there are lots of "Check if" kinds of blocks.

To put this in a real life case (please don't flag this 'cus it maybe out of topic, but It applies in real life and in hopscotch) , say that you are given work by your boss. Then he asks you to perform MORE tasks, like keeping track of the economic situation of the company, answering to queries (questions) from customers and so on.

In the end, you get tired and you work slower and slower, until you fall sick.

Same applies to digital devices. The more tasks you ask it to perform, the slower it gets and it will soon...

crash...


#8

heheh great explanation.

We'll take a look at this project cause the whole point of hopscotch is that you can create lots of rules and crazy complicated games...so if it gets too slow, that stinks.


#9

First off, @CreativeCoder @AHappyCoder, this game looks SO awesome. I'm psyched to see the final version.

Like @Kiwicute2015 suggested, the biggest cause of lag by far in Hopscotch is using clones with the "When ____ bumps_____" rule.

But I don't see any clones in here, so it probably has to do with something else. It's possible all the "Check if/else" rules, if they are in repeat forever blocks, are causing the slowdown because the iPad is constantly running those rules. Just a suspicion, though. We're going to take a closer look at it later today and we'll update you if we learn anything!


#10

Thanks @Liza and @Ian! I'm glad you're liking it so far. I am going to be taking a closer look at it and try to make it cleaner.


#11

I'm having the same problem. The worst part is my game isn't even close to done :smile:. I'll look in the code try to find a solution. Thanks to everyone for the tips though!