MM_Preloader (layout preloader) (Plugins)

Discuss Scirra's 2D Asset Store

Post » Mon Jul 31, 2017 3:32 pm

What is the stabilizer? I turn it on but when do i have to turn it off?
B
15
S
7
G
2
Posts: 33
Reputation: 2,266

Post » Mon Jul 31, 2017 7:51 pm

Xh3maa wrote:What is the stabilizer? I turn it on but when do i have to turn it off?


Hi @Xh3maa,

I briefly explained the Stabilizer in the FAQ on the store page:
Stabilizer is a built in feature that monitors the current FPS. If FPS is stable, the stabilizer sends a signal to the preloader that stabilizing process is completed.


If you enable the Stabilizer then the "Stabilizer" item is added to the preloader list which is always processed as the last item. As described above, it checkes the current FPS and if it's greater or equal of the "Minimum FPS" property (or "Maximum checks" * "Check frequency" seconds passes) then the item is considered as 100% completed.

Stabilizer simply assures you that all background processes (like rendeding, memory release, memory load, etc.) are completed and the engine is now "stable". Even though it's a useful feature in some cases, it's not needed in most of cases - that's why it's disabled by default.
ImageImageImage
B
27
S
16
G
80
Posts: 1,021
Reputation: 44,761

Post » Sun Aug 06, 2017 4:06 am

Hi, I think this plugin is what I need.
Does it support C3 ? Because I use C3 now. thanks.
B
10
S
2
Posts: 13
Reputation: 576

Post » Sun Aug 06, 2017 10:19 am

mahaiting wrote:Hi, I think this plugin is what I need.
Does it support C3 ? Because I use C3 now. thanks.


Hi @mahaiting,

[EDITED]
Yes it does, please see the post below.
Last edited by BackendFreak on Tue Aug 29, 2017 10:10 pm, edited 1 time in total.
ImageImageImage
B
27
S
16
G
80
Posts: 1,021
Reputation: 44,761

Post » Fri Aug 11, 2017 7:30 pm

MM_Preloader v1.3 and up is now compatible with C3.

By purchasing MM_Preloader from now on you will receive a .c2addon and .c3addon files.

I've just submitted c3addon to the store, should be available to download within 24h (Scirra has to approve new files).

@mahaiting this might interest you.
ImageImageImage
B
27
S
16
G
80
Posts: 1,021
Reputation: 44,761

Post » Mon Aug 14, 2017 7:02 pm

Hi @BackendFreak

I've successfully made a preloader with the global layer approach, everything fine, but recently I'm having a problem the very moment I tried to not use the stabilizer.
If I disable (or delete) the event turning on the stabilizer (stabilizer is off in properties) so that the preloader doesn't use it the first time I switch from Layer 1 to Layer 2 everything works as intended, then if I go back to Layer 1 and switch back to Layer 2 the project hangs without showing progress and it never switches to Layer 2.
Loader animations keep working though so it doesn't seem a complete "freeze" but just the preloader not starting.

More info:
- I have a title layout with just a tap to start function and on that layout is included the preloader "empty" layer and preloader event sheet. The preloader is called by a function with the "tap to start" action.

- The actual preloader global layer is in a separate layout.

- The project is lowres very light as for now since I still have to add the majority of the content, so that without preloader switching from title screen to layout is a blink even on mobiles*.

- Audio is preloaded by C2 on start of the first layout (default C2 option).

- I've tried disabling the events that show progress, hide layers, wait xx secs, but the only difference is the stabylizer being activated or not.

- Please note if the stabilizer is on everything works flawlessly even switching repeatedly from one layout to another.

*Another thing I'm wondering about is indeed the fact that when I use no preload of sorts being the assets very light switching layout is an instant while with the preloader it still gets a couple seconds to reach 100% and move on. While C2 initial preload is so fast you almost can't see in such case. So I thought it could be the stabilizer taking his time but when I tried.. Well nothing worked anymore.

Any idea on what could cause this?

EDIT: corrected some typos.
B
16
S
3
Posts: 10
Reputation: 842

Post » Mon Aug 14, 2017 9:54 pm

Hi @CrK

I suspect that you try to start the preloader while nothing has been added to the preloader's list (stabilizer is counted as an item). The preloader will not start if nothing is added because it simply has nothing to preload. So you may want to check the number of items added to the preloader ("ItemsCount" expression) before you actually start it. This way you are able to decide whether you need to start the preloader or not.

Image

If I'm right you should see "[Preloader]: Cannot start Preloader, the list is empty." message in console log. Can you check if you see such message in the console or any other message in the moment when it does not start?

In regards of the Stabilizer itself. Yes by just adding the Stabilizer your layout transition will take at least Check frequency * Confirmations required seconds because it has to be sure it's all stabilized.

If the above solution won't help then if possible could you please send me the capx for investigation? It obviously doesn't need to be your project but if you could just replicate this issue in separate capx that would help me to investigate the issue.
ImageImageImage
B
27
S
16
G
80
Posts: 1,021
Reputation: 44,761

Post » Tue Aug 15, 2017 12:26 am

BackendFreak wrote:Hi @CrK

I suspect that you try to start the preloader while nothing has been added to the preloader's list (stabilizer is counted as an item). The preloader will not start if nothing is added because it simply has nothing to preload.

If I'm right you should see "[Preloader]: Cannot start Preloader, the list is empty." message in console log. Can you check if you see such message in the console or any other message in the moment when it does not start?


Hey @BackendFreak thanks for the assistance.

You are right I just did a quick check and I see that message in the console, so now I wonder why it doesn't get the assets..
the weird thing is on the first preload it works, its the second time that hangs.. maybe there's something wrong in my logic.
I tried adding the items check and stabilizer off, same working ok on first cicle layout 1 > preload > layout 2, then on second try the preloader doesn't start cause the list is empty :?

Here's a quick screen of the original event sheet
Image

EDIT: almost forgot, yes I know the global var in the image is empty, that's because I set it with the layout name on the first layout event sheet and I made sure in debug mode the variable still get corretly set every time it goes back to the first layout.

If you still need a capx let me know, I'll try to make one asap.
B
16
S
3
Posts: 10
Reputation: 842

Post » Tue Aug 15, 2017 12:34 am

Hmm... then my guess is that gvr_NextLayout variable is either empty or it's not a valid layout name (a typo maybe?). Please double check this variable just before the issue occurs. Log it to console with Browser.log().

If the issue still remains, please send me the capx. Otherwise all I can do is guessing :/
ImageImageImage
B
27
S
16
G
80
Posts: 1,021
Reputation: 44,761

Post » Tue Aug 15, 2017 12:46 am

BackendFreak wrote:Hmm... then my guess is that gvr_NextLayout variable is either empty or it's not a valid layout name (a typo maybe?).


But in that case it shouldn't work at all since I point to that variable to switch layout and If I run the thing as you see in the image everything works perfectly. The problem happens only disabling that highlighted action referred to stabilizer (and only after going back to first layout at least 1 time).

EDIT: capx sent!

EDIT 2: I was thinking that maybe the assets aren't purged from memory after leaving Layout 2 and this is why the first time works but the second time since it has all assets already loaded the preload list remains empty?
B
16
S
3
Posts: 10
Reputation: 842

PreviousNext

Return to Scirra Store

Who is online

Users browsing this forum: No registered users and 4 guests