INDEX_SIZE_ERR: DOM Exception 1 - 300 images limit

Bugs will be moved here once resolved.

Post » Mon Mar 05, 2012 1:45 pm

so for pc-mac its ok?
B
32
S
9
G
6
Posts: 1,469
Reputation: 7,955

Post » Mon Mar 05, 2012 1:51 pm

[QUOTE=imothep85] so for pc-mac its ok?[/QUOTE]
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.
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Mon Mar 05, 2012 2:46 pm

OUUUF i can breath
B
32
S
9
G
6
Posts: 1,469
Reputation: 7,955

Post » Mon Mar 05, 2012 2:57 pm

@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...
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Mar 05, 2012 3:17 pm

@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!
B
81
S
50
G
10
Posts: 555
Reputation: 13,009

Post » Mon Mar 05, 2012 8:03 pm

Ashley are youre going to explain how you are making the spritesheet?? i would like to know how do you make that :D
THANKS imothep852012-03-05 20:04:07
B
32
S
9
G
6
Posts: 1,469
Reputation: 7,955

Post » Wed Nov 21, 2012 4:37 pm

This can not be a browser limitation since I have a game with ~700 images ( as animations frames ) and it plays OK on mobile browser ( Android 2.3.6 ), but can't compile using phonegap. I am not talking about exporting the C2 project for phonegap, but actually using that export into an eclipse phonegap compile, which throws the error @ranma did mentioned.
That leaves me no option but to think is a webview limitation. Now, my question: how come that the webview is different then the browser itself? Shouldn't be the same? Is there a way to overcome this limitation? How about using an expansion pack? Would that help ( if it's even possible )? In my case, reducing the files number from 700 to 300 is obviously ... not an option :)
B
16
S
4
G
3
Posts: 46
Reputation: 2,875

Post » Wed Nov 21, 2012 5:11 pm

@xyboox - this is an old thread from March. We subsequently implemented automatic spritesheeting which should help mitigate the problem. If that doesn't fix it, it must be a severe limitation in the browser. We still recommend publishing using directCanvas or CocoonJS instead of PhoneGap, so I'm going to close this issue now.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Fri Nov 23, 2012 9:31 am

@Ashley, sorry to bring this back to discussion, but ... how about this:
I tried to compile using first appMobi ( first using directCanvas, then using the webview ) with same results. Then I tried with Cocoon. Exact same result.
Then, I reduced the frames in my animations to a little under 300 and... it works with all compilers: phonegap, appmobi and cocoon. I then started adding a few frames at a time, and as soon as their number is > 300, the same error is thrown for every method of compiling.
However, it is not about the number of entities in the project, but specifically about the total number of images ( as animation frames ). I added sound files so that the number of objects passed well 300 and it still works as long as the number of items in "images" folder is < 300. Now, this might be because audio files are streamed ( maybe?).
So... where this 300 come from? Who sets this limit?

Thanks, any hint is welcome :)

LE: if it matters, the code that throws the error in c2runtime.js is this ( inside the 'if' ):

if (spritesheeted)
{
   ctx.drawImage(cur_image, cur_frame.offx, cur_frame.offy, cur_frame.width, cur_frame.height, myx, myy, w, h);
}

Thanks.xyboox2012-11-23 09:46:21
B
16
S
4
G
3
Posts: 46
Reputation: 2,875

Post » Fri Nov 23, 2012 3:28 pm

@xyboox - it's a limitation in the Android browser, there's nothing we can do to fix it. Newer versions of Android fix it, I believe.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

PreviousNext

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests