mte.goto, logic behind bScale and adverse effects on load time

Hi, I’ve been playing around MTE and have noticed that having a low blockScale setting greatly increases the load time but what makes no sense to me is that the same amount of images are loaded each time unless culled by the margin. 

Can some please explain the logic behind blockScale. My tile size is 256x256? Why would a block scale of 1 take so much longer to load than a scale of 64 for example. I’ve managed to speed things up with cullingMargin parameter and higher blockScale  but I just don’t get whats happening?

Any insight would be great? thx. 

Hello Beloudest,

BlockScale determines two things; the size of the tiles on the screen, and the number of tiles in the active culling region. The active culling region is calculated based on screen size, so filling that area with larger tiles gives you fewer tiles than filling it with small tiles. Goto() doesn’t load any images, but it does have to create all the display objects representing the active tiles. Setting blockScale = 1 in an app running at 480x320 resolution would mean goto() has to create more than 153,600 image rects. This would take ages and wouldn’t run on any device, including the simulator, at more than 1fps if at all. A blockScale of 256 in the same app would require on the order of 10 tiles and would run more or less instantaneously. 

Scrolling your map with the movement functions is far less demanding than calling goto() in most situations because the movement functions only destroy and create tiles a row/column at a time, in whatever direction your map is scrolling. Still, it is wise to keep the number of simultaneous active tiles around 1000, depending on the devices you’re targeting. 

Thanks Dyson, thats a much clearer now. 

Hello Beloudest,

BlockScale determines two things; the size of the tiles on the screen, and the number of tiles in the active culling region. The active culling region is calculated based on screen size, so filling that area with larger tiles gives you fewer tiles than filling it with small tiles. Goto() doesn’t load any images, but it does have to create all the display objects representing the active tiles. Setting blockScale = 1 in an app running at 480x320 resolution would mean goto() has to create more than 153,600 image rects. This would take ages and wouldn’t run on any device, including the simulator, at more than 1fps if at all. A blockScale of 256 in the same app would require on the order of 10 tiles and would run more or less instantaneously. 

Scrolling your map with the movement functions is far less demanding than calling goto() in most situations because the movement functions only destroy and create tiles a row/column at a time, in whatever direction your map is scrolling. Still, it is wise to keep the number of simultaneous active tiles around 1000, depending on the devices you’re targeting. 

Thanks Dyson, thats a much clearer now.