Fixed the red mac loading bar for my game.

Discussion and feedback on Construct 2

Post » Tue Dec 15, 2015 2:44 pm

My game was obviously way too big to not get the red bar loading error (thousands of animation frames , 246 megs.)

game in question: https://www.scirra.com/forum/viewtopic.php?f=148&t=163151&p=999204&hilit=eternal+step#p999204

But with some outside help and fiddling involving changing a few lines in the project file we managed to get a fix that worked for mac on our game.

Pass us a tell if you would like instructions to try on your game see if it works for everyone else.
B
12
S
4
G
1
Posts: 137
Reputation: 1,519

Post » Tue Dec 15, 2015 2:53 pm

mapmerry wrote:My game was obviously way too big to not get the red bar loading error (thousands of animation frames , 246 megs.)

game in question: https://www.scirra.com/forum/viewtopic.php?f=148&t=163151&p=999204&hilit=eternal+step#p999204

But with some outside help and fiddling involving changing a few lines in the project file we managed to get a fix that worked for mac on our game.

Pass us a tell if you would like instructions to try on your game see if it works for everyone else.


Why not just post the fix for anyone?
If your vision so exceeds your ability, then look to something closer.
Moderator
B
130
S
29
G
80
Posts: 5,270
Reputation: 55,972

Post » Tue Dec 15, 2015 2:56 pm

It just feels kind of bad for me to post alterations of the engines code on their forums. Is it OK to do so?
B
12
S
4
G
1
Posts: 137
Reputation: 1,519

Post » Tue Dec 15, 2015 3:35 pm

You could also pass it on to @Ashley and maybe he can fix it, if it's a C2 issue. :)
Be sure to check out my Metroidvania game, A Hole in the Earth
B
59
S
24
G
3
Posts: 359
Reputation: 5,683

Post » Wed Dec 16, 2015 12:25 pm

Yeah, I'd be curious to know what you changed and if we can incorporate it in to an official solution.
Scirra Founder
B
386
S
229
G
87
Posts: 24,207
Reputation: 191,602

Post » Wed Dec 16, 2015 12:39 pm

Well having 0 coding knowledge I can only speculate at best but here's the fix someone got for me:

in runtime.js after export.

replace:


img_.onerror = function (e)
{
img_.c2error = true;
anyImageHadError = true;
if (console && console.error)
console.error("Error loading image '" + img_.src + "': ", e);
};
if (this.isEjecta)



with:


img_.onerror = function (e)
{
if(img_.try===3){
img_.c2error = true;
anyImageHadError = true;
if (console && console.error)
console.error("Error loading image '" + img_.src + "': ", e);
} else {
img_.src='';
if(img_.try===undefined) img_.try=0;
setTimeout(function(){
img_.try++;
img_.src=src_;
},50);
}
};
if (this.isEjecta)

(we also had the red loading error on linux and it fixed it there too though people don't seem to get that as often.)

Not sure if it will the same for everyone else but it worked for us.
B
12
S
4
G
1
Posts: 137
Reputation: 1,519

Post » Wed Dec 16, 2015 12:46 pm

Awesome, I will try this out and report back.
B
11
S
3
Posts: 135
Reputation: 1,309

Post » Wed Dec 16, 2015 1:35 pm

So you just implement up to 3 retries for loading the image?

Even if that works, it's a classic band-aid solution: the root problem is still there, and there's no reason to think there won't be three or more failures for image loading which will have the same consequence, so it seems dubious...
Scirra Founder
B
386
S
229
G
87
Posts: 24,207
Reputation: 191,602

Post » Wed Dec 16, 2015 1:54 pm

Yeah that's why I wanted to see if it worked for others before saying anything. We have tested a lot after though and never got any fails or errors in game on the Macs we tried.
B
12
S
4
G
1
Posts: 137
Reputation: 1,519

Post » Tue May 17, 2016 6:32 pm

mapmerry wrote:Yeah that's why I wanted to see if it worked for others before saying anything. We have tested a lot after though and never got any fails or errors in game on the Macs we tried.

@mapmerry I'm interested in this fix you discovered because I have the same issue. I've gotten to where my GPlay game doesn't load, but rather has the red progress loading bar, due to having too many image and audio assets: 771 png images at 34.3mb, and 539 ogg sounds at 23.7mb. But when I applied your fix, it just did this thing where the blue bar goes forward then back again, and loops that way, never actually finishing the loading. Also attempted it with 9 instead of 3, same thing. Have you by any chance discovered an improved version of your fix since last? Thanks
B
7
S
1
Posts: 47
Reputation: 541

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests