0 Favourites

INDEX_SIZE_ERR: DOM Exception 1 - 300 images limit

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

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Which browser are you using? (Please see how to report bugs) It could be a browser limitation, which would be interesting...

  • Native nexus one browser.

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

  • 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...

  • 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.

  • If you're using PhoneGap unfortunately it can only use the built-in browser, not another one.

  • 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!

  • 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. <img src="smileys/smiley11.gif" border="0" align="middle" />

  • 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. <img src="smileys/smiley11.gif" border="0" align="middle" />

    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)

  • so for pc-mac its ok?

  • so for pc-mac its ok?

    I believe so, yes. this is not actually problem of a platform, but a browser, if for some reason someone launches your game in mobile safari (default ios browser) on PC - the problem WILL occur also. but in general, if your game is not meant for mobile platforms, this probably does not apply.

  • OUUUF i can breath <img src="smileys/smiley17.gif" border="0" align="middle" />

  • ranma, what version of Android does your phone have? The Nexus One might have an out of date browser. I don't think other phones have this limitation so it's not a general limitation of 300 images, it's probably a limitation specifically with the Nexus One. Installing any updates if possible might help fix it.

    We do have sprite-sheeting planned already, but it's a reasonably complex feature and we have tonnes to do already. If other phones have the same problem I'd reprioritise it, but as it is I don't even know for certain that sprite sheets would help fix it - fewer images that are bigger might still make the phone run out of memory...

  • Ashley

    2.3.6 and "your system is up to date". I don't think sprite sheeting will help much, actually I think it may generate more problems than it will solve as most (if not all) mobile browsers have quite strict image dimensions limitation. also, it's common knowledge that on iOS devices there's around 6mb limit for all loaded images, and again, I think that most reasonable thing to do to avoid not only my nexus' problem, but also iOS', would be splitting image loading per layout. I'm aware it's a big thing and I don't expect it in the next build :) but my advise would be to concentrate on this instead of sprite sheets (because of the image dimensions limits).

    cheers!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)