Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / loadImage max 30 calls?

Author
Message
Dybing
12
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 16th Sep 2011 09:15
Hit a snag trying to load a 31st image. In my little app I have (until now) had a long nice list of images loaded in the main.agc as I've come to need them. Most for buttons (with onOver function for highlighting if mousepointer is hovering over a button).

Today, I made some new buttons for my project, and imported them through the usual method of loadImage(id, name). It all compiled nicely, but the app won't run. Stopped working windows helpfully tells me. So I started commenting out all the new loadImage calls, then it worked. Uncommenting one by one, I found the limit; 30 calls to loadImage (or possibly image ID).

Working around the problem now, by instead loading up the images need for each screen, and flushing them on exit of the screen. Like I already do with sprites and text.
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 16th Sep 2011 11:21
Not come across this in my own tests. When you say the app won't run, what exactly happens? Do you get a compiler message popping up or an error at runtime?
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 16th Sep 2011 11:27
I think he gets the "Application has stopped responding" message so neither compiler nor runtime error...in a sense.

This problem might be related to this problem.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Sep 2011 12:08
I can confirm that I load much more than 30 images in my App.

Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 16th Sep 2011 15:06 Edited at: 16th Sep 2011 15:09
And the problem is recapped here.

It has been reported on the bug board, it is the second issue on the list. But I don't think anyone at TGC is looking at that list, since there has been no status change on any issue reported there.

Mike - is Lee the only one who would be looking at that list?

Dybing
12
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 16th Sep 2011 15:45
Quote: "Not come across this in my own tests. When you say the app won't run, what exactly happens? Do you get a compiler message popping up or an error at runtime?"


It's at runtime. No compiler error.

I tried loading and flushing images as I needed them on screen, but that did not work. Apparantly my projects approx. 1200 lines of code (so far ) mean that I can only do 30 loadImage calls.

And seeing as my first work-around failed abysmally, I'm now forced to import images the proper way. Not one and one, but gathered up in an atlas-map and then later assign using loadSubImage calls.

Seems to be working so far, I have at least managed to get more than 30 images into my app.

But I'm worried about hitting the 2k (and change) lines of code wall soon. Before I add networking to my app, I guesstimate getting to at least 1500 lines of code all in all...
baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 16th Sep 2011 15:54
The problem is that if the list does not seem to get any TGC attention (or is that TLC?) then people will start clogging the forum up with bug posts again in an attempt to get answers.

It would be a shame to see such a good idea get ignored in the future because it is apparently being ignored at the moment by TGC.

Already I've seen a few posts on there where people are getting frustrated...

Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 16th Sep 2011 16:23 Edited at: 16th Sep 2011 16:25
Well, I imagine a lot of dev time is being spent on getting Android added. It is very frustrating to have no response on that board. Lee's posts about the board would seem to indicate that he will be the only one looking at it, and he's out 'til Monday.

This from Lee:
Quote: "Essentially rather than bug reports getting lost in the forum, they are collected in a central list at code.google. I will then classify the issues as features, bugs and what priority they should have. If anyone would like to pitch in on each issue to verify those bugs as confirmed, they will be given higher priority as it's quicker to fix a confirmed bug than one where I have to trial and error to find it. Once they are confirmed, I will fix the issue for the next build, and mark it as such. When the next build is released, the original reporter of the issue can confirm it has been fixed, and if not resurrect the issue on the issues board and the cycle repeats. Should be a much better system than the one used by DBP!"


Dybing
12
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 16th Sep 2011 17:11
Small update: The loadSubImage workaround did not work either. I can not assign / keep active more than 30 image IDs in my current project.

Sooooo. First I'll shave my code a bit. I'm sure I can cut from the current 1200 lines down to perhaps 1000 lines. I'll see how many active image IDs I'm allowed then. Not expecting much though.

Worst case, I'll have to rework my nice onMouseOver feature, and all the calls to it, as it nearly doubles the amount of images I use. Hmmm, perhaps just use some alpha effect for the mouseOver rather than an extra image.

Either that or reuse imageIDs by flushing the ones I do not use on a given screen, and load up new images on then available image IDs.

Good thing I got the weekend off, to rewrite a bit of code, and make the entire thing somewhat more slim and efficient.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 16th Sep 2011 19:13
I dont think its the load image command!

Only when i generate my current beta level i do with my editor, so do i load an image 500 times with this!

j = LoadImage ( "space/Tile.png" )
iSprite = CreateSprite ( j )

and it works
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 16th Sep 2011 21:58 Edited at: 16th Sep 2011 22:33
If you use loops and such I think you have less of a problem. Rich Dersheimer posted that he got a crash after 102 lines of print("a"). If you simply put that in a loop it will work fine. I think it is probably a memory issue rather than a command issue, the error number I get, when trying to compile is very long.

Still I wish they would fix it or at least acknowledge it. Lee actually posted on my Shooter WIP thread saying he would put this at top priority. Then he goes on hols to San Francisco lol. The thread still seems very much unchanged even now, as do all the others(priority wise, not complaint wise).

I understand this won't get fixed instantly, but it would be nice for someone at TGC to actually mark the thread as top priority so we know it is being addressed.

Oh, all of you guys trying to work around this. If you really feel you need to, carry on. I however have simply put my project on hold until it is fixed. I don't see the point of trying to cut code to get around the issue, only to hit it again later down the line. No amount of clever coding will stop this bug from stopping any large project from being affected. It is a little too random to actually nail the exact problem on the head anyway. I also have better things to do than rewrite projects to work around bugs (unless they are trivial bugs).

I would start another project in the meantime. This will be fixed and your project will be waiting. If it isn't there would be a lot of people wanting their money back. As time goes on, more and more people will come across this issue.

I expected at least a month before it got fixed when I first found it, so that leaves about 2-3 weeks left lol.

Oh one last thing I have way more than 30 images in my project also, so as I said above, I think the problem is a difficult one for us to pin down.


This demonstrates one of the problems. This code will work as is. Rem in the remmed out lines and it will crash.

Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 17th Sep 2011 02:16 Edited at: 17th Sep 2011 02:19
Quote: "This demonstrates one of the problems. This code will work as is. Rem in the remmed out lines and it will crash."

I also got this crappy string bugg seams to be some kind of limit to the size of memory strings use?

this dont work!



But this do work!



Thanks to bursar on the heads up on constants

Login to post a reply

Server time is: 2024-04-18 13:16:36
Your offset time is: 2024-04-18 13:16:36