INDEX_SIZE_ERR: DOM Exception 1 - 300 images limit

Bugs will be moved here once resolved.

Post » Sat Mar 03, 2012 11:09 pm

In exported game, this just happened:

Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1
c2runtime.js: Line 6956 : Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1
Uncaught Error: INDEX_SIZE_ERR: DOM Exception 1 at c2runtime.js:6956

did a quick research, it's when image is not fully loaded and you try to draw it into canvas. started appearing when I moved my project to r80.2 and added new sprite, and it seems to be the problem, as just as this error hangs the game, every other sprite is visible, just the new one is not. but after downgrading to 79.4 and exporting the project again, problem is still there :(

and this is line 6956 of the c2runtime (first line = line 6956):

[code]ctx.drawImage(cur_image,
myx,
myy,
this.width,
this.height);
}
else
{
myx = this.x;
myy = this.y;
if (this.runtime.pixel_rounding)
{
myx = Math.round(myx);
myy = Math.round(myy);
}
ctx.save();
var widthfactor = this.width > 0 ? 1 : -1;
var heightfactor = this.height > 0 ? 1 : -1;
ctx.translate(myx, myy);
ctx.scale(widthfactor, heightfactor);
ctx.rotate(this.angle * widthfactor * heightfactor);
ctx.drawImage(cur_image,
0 - (this.hotspotX * Math.abs(this.width)),
0 - (this.hotspotY * Math.abs(this.height)),
Math.abs(this.width),
Math.abs(this.height));
ctx.restore();
}[/code]ranma2012-03-04 00:10:56
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Sun Mar 04, 2012 12:05 am

ok, so the real bug is that every image above number 300 will not load. I had 302 images, and this idea came to my mind, I reduced some sprites animations, exported 298 images total, and BAM! it worked perfectly. can we do something about it? where is the limit? is this canvas / html5 / device specific problem?

also maybe it's time to think about layout-based image loading?ranma2012-03-04 00:11:28
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Sun Mar 04, 2012 2:25 pm

Which browser are you using? (Please see how to report bugs) It could be a browser limitation, which would be interesting...
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sun Mar 04, 2012 3:40 pm

Native nexus one browser.

The problem also occurs after phonegap export so I believe it's quite serious.ranma2012-03-04 16:12:44
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Sun Mar 04, 2012 4:27 pm

Ah, well mobiles tend to have much weaker hardware/software. You probably just have to design your game to use less images for now. We do plan to add sprite sheets in future but there's no ETA for that, and the phone might still run out of memory anyway...
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sun Mar 04, 2012 5:17 pm

ranma, if you're using a Nexus, i suggest you to try using Dolphin. It's the best browser for Android and *maybe* won't have this limitation.

I don't believe it's a HTML 5 limitation.
English is not my native language. Sorry for any mistakes and feel free to correct me if needed.
B
14
S
5
G
3
Posts: 110
Reputation: 3,225

Post » Sun Mar 04, 2012 6:25 pm

If you're using PhoneGap unfortunately it can only use the built-in browser, not another one.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Mon Mar 05, 2012 12:19 pm

AppMobi also has this problem, probably because also using default browser. I think this is huge, 300 images per game is very limiting, imagine you have 50 objects (which is actually very little for a medium sized game) - every of these objects can have only 6 frames of animation. another example (more probable) - dice game - you are throwing one die, there are 6 possibilities, but you need to animate the throw, assuming every throw has 30 frames (one second, fluid animation) - and you've eaten up 180 frames, you're left with 120 images to use in the whole game - gui, background, buttons, etc. and that's very little. I personally think that loading images per layout should be next milestone for construct as it would eliminate this problem if I keep my frames per layout resonable :)

Also, strange thing, this problem occurs only in first load, so it happens like that:
1) build, install.
2) first run (if over 300 images, hang)
3) press back button (exit app)
4) second run - work fine, until...
5) random hang (probably random image trying to be displayed, but due to over 300 (9000? ;) images, that one is not loaded)

again pretty please for per layout image loading @Ashley :)
cheers!
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Mon Mar 05, 2012 12:28 pm

limtited to 300 pictures....so i supose im dead with my game project...because its going to have a lot of pictures more than 300 for sure.
B
32
S
9
G
6
Posts: 1,468
Reputation: 7,953

Post » Mon Mar 05, 2012 1:10 pm

[QUOTE=imothep85] limtited to 300 pictures....so i supose im dead with my game project...because its going to have a lot of pictures more than 300 for sure. [/QUOTE]
only if you're going for mobile browsers, desktop browser don't seem to have this limitation (or have some other, ios browser has around 6.5MB for all images limit, not image count)
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 6 guests