INDEX_SIZE_ERR: DOM Exception 1 - 300 images limit

Forum Home Forum Home > Construct 2 Development > Bugs > Closed bugs
 Post Reply Post Reply Page  123>
Author
8,159 Rep
Post Options Post Options   Quote ranma Quote  Post ReplyReply Direct Link To This Post Topic: INDEX_SIZE_ERR: DOM Exception 1 - 300 images limit
    Posted: 03 Mar 2012 at 11:09pm
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):

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();
}


Edited by ranma - 04 Mar 2012 at 12:10am
Back to Top
8,159 Rep
Post Options Post Options   Quote ranma Quote  Post ReplyReply Direct Link To This Post Posted: 04 Mar 2012 at 12:05am
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?

Edited by ranma - 04 Mar 2012 at 12:11am
Back to Top

Scirra Developer
81,187 Rep
Post Options Post Options   Quote Ashley Quote  Post ReplyReply Direct Link To This Post Posted: 04 Mar 2012 at 2:25pm
Which browser are you using? (Please see how to report bugs) It could be a browser limitation, which would be interesting...
Back to Top
8,159 Rep
Post Options Post Options   Quote ranma Quote  Post ReplyReply Direct Link To This Post Posted: 04 Mar 2012 at 3:40pm
Native nexus one browser.

The problem also occurs after phonegap export so I believe it's quite serious.

Edited by ranma - 04 Mar 2012 at 4:12pm
Back to Top

Scirra Developer
81,187 Rep
Post Options Post Options   Quote Ashley Quote  Post ReplyReply Direct Link To This Post Posted: 04 Mar 2012 at 4:27pm
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...
Back to Top
1,008 Rep
Post Options Post Options   Quote Cassianno Quote  Post ReplyReply Direct Link To This Post Posted: 04 Mar 2012 at 5:17pm
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.
Back to Top

Scirra Developer
81,187 Rep
Post Options Post Options   Quote Ashley Quote  Post ReplyReply Direct Link To This Post Posted: 04 Mar 2012 at 6:25pm
If you're using PhoneGap unfortunately it can only use the built-in browser, not another one.
Back to Top
8,159 Rep
Post Options Post Options   Quote ranma Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 2012 at 12:19pm
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!
Back to Top
1,670 Rep
Post Options Post Options   Quote imothep85 Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 2012 at 12:28pm
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.
Back to Top
8,159 Rep
Post Options Post Options   Quote ranma Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 2012 at 1:10pm
Originally posted by imothep85 imothep85 wrote:

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.

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)
Back to Top
 Post Reply Post Reply Page  123>

Forum Jump Forum Permissions View Drop Down