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 / AGK Hangups - The Search For Redemption

Author
Message
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 5th Feb 2012 21:19 Edited at: 15th Jun 2012 19:55
Suspects
1: Reaching out of array sizes in unusual cases
2: Multidimensional Arrays
3: UDTs within arrays
----------------------------------------------------------------
Here's a list (so far) of what to watch out for when you crash as opposed to receiving an error report
Current Listing - Crashes
1: Network Bug http://forum.thegamecreators.com/?m=forum_view&t=197782&b=41

Now What?
1: See link

fix for UDTs within UDTs - http://forum.thegamecreators.com/?m=forum_view&t=195252&b=41&msg=2327946#m2327946

Old Listing - Crashes
1: Assigning floats to integer values | ex) float b = 9 / float b = 9.0 [fixed v107+] - [returns compilation warning]
2: Assigning newly declared globals to values involving math (global value as integer = 2/4) [fixed v107+] - [sometimes fails to assign]
3: Initializing an array to a size of 0 in any dimension (hence, you'll still crash with dim arr[12,0]) [fixed v107+] - [no issue remains]
4: Calling deleteSprite on a sprite that doesn't exist [fixed v107+] - [no error will be returned in any fashion. Don't worry about removing nonexistent sprites]

Old Listing - Suspects
1: Reaching out of variable bounds [fixed v107+] - [no issue remains, if one ever did]
2: Intializing arrays in functions [fixed v107+] - [no issue remains]

swis
Joined: Tue Dec 16th 2008
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 5th Feb 2012 21:26
The easiest way to track it down would be to write out to a debug file. I have found I need to keep saving and reopening the debug file (in Append mode) to make sure I get all the data in the file.

Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 5th Feb 2012 21:32
Quote: "So far it seems that these problems might occur when variables reach out of their bounds, but I can't confirm."

I've had similar problems with arrays. I've tried to reproduce the problem but then I get the correct "out of bounds" error message. I wonder if it has to do with resizing arrays, especially UDTs.

Recently I did have an experience where my program crashed, I checked the code, couldn't find anything wrong, recompiled and it ran perfectly. Haven't a clue why that happened.

swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 5th Feb 2012 21:43
Quote: "The easiest way to track it down would be to write out to a debug file. I have found I need to keep saving and reopening the debug file (in Append mode) to make sure I get all the data in the file."

That's probably what it'll come to, though it seems like I always crash at a different point within my code.

Quote: "I've had similar problems with arrays. I've tried to reproduce the problem but then I get the correct "out of bounds" error message. I wonder if it has to do with resizing arrays, especially UDTs. "

I've done the same thing I even tried making an integer some twenty digit value and it brushed over it like nothing I still have a feeling the issue is something like this.

Quote: "Recently I did have an experience where my program crashed, I checked the code, couldn't find anything wrong, recompiled and it ran perfectly. Haven't a clue why that happened."

Same here as well. My most recent attempt crashed after a couple of frames, yet I've had times I compiled the same code goes for a good ten seconds, and only crashes on newer code.

Whatever the cause, I've managed to narrow the problem down to one of my functions. It's only about 1,500 lines worth I wish AppGameKit would report some kind of issue... I'll see what I find.

swis - No, it's not pokemon.
Joined: Tues Dec 16th 2008
Mod = Troll - http://forum.thegamecreators.com/?m=forum_view&b=2&t=114323&p=586
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 10th Feb 2012 23:12 Edited at: 10th Feb 2012 23:30
Alright well, I guess I'll just continue checking and scanning until the problem is solved, what I originally meant to say was, what can cause AppGameKit to crash? I have checked, and I'm not stuck in any loops or other... Anything persistent?

Edit: Sticking it in a loop was an original problem that I fixed quickily, but the occasionals are still an issue

swis - No, it's not pokemon.
Joined: Tues Dec 16th 2008
Mod = Troll - http://forum.thegamecreators.com/?m=forum_view&b=2&t=114323&p=586
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 11th Feb 2012 00:08
I've gotten feedback on my app so far, and there is something with the arrays that is causing AppGameKit to crash. There is no set pattern (why it runs fine on a iPhone 3GS vs iPhone 4S where it crashes) but supposedly having a lot of other apps open can cause it to crash

Hi there. My name is Dug. I have just met you, and I love you.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 11th Feb 2012 03:10
The only crashes I have had of late are when an array is accessed out of bounds. Sometimes you will get a complete crash rather than a compiler error.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 11th Feb 2012 07:14
Apps can crash if arrays are dim'd for the first time inside a conditional statement (a bug TGC are aware of and fixing). Paul's advice is as follows:
Quote: "
dim arrays in the main code and then just selectively use them with if statements, instead of dimming the array in the if statement itself"


I find if I dim all of my arrays in the main ".agc" file before the rest of my code starts it seems to avoid these kind of problems

Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 11th Feb 2012 08:30
Quote: "Apps can crash if arrays are dim'd for the first time inside a conditional statement (a bug TGC are aware of and fixing)."

What about if they are being resized but existed before the condition? I resize arrays a lot inside conditional statements and have the occasional crash.

baxslash
Valued Member
Bronze Codemaster
17
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 11th Feb 2012 10:24
That's a different bug I think.

swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 11th Feb 2012 19:36
I've had array issues as well in the past. Looks like from what you all report that's essentially the only known issue. I dim all my arrays in an initial gosub (but that will always run), and a few within functions (these serve as temperary). I've also noticed the lack of the undim command... So I'm not sure how we're supposed to free memory. Will also add array bounds catch for good measure

swis - No, it's not pokemon.
Joined: Tues Dec 16th 2008
Mod = Troll - http://forum.thegamecreators.com/?m=forum_view&b=2&t=114323&p=586
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 11th Feb 2012 20:51
I always dim my arrays at the start of the program in the main if I use others, I am old school, so most times I just use one file rather than several. If I want to clear an array I simply loop through it and set the values to 0 or whatever value is relevant. I always use static array sizes, and oversize them. You can just use the array to store the available size and increase as you need it.

anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 21st Feb 2012 08:33
Has there been any updates regarding this issue? I don't use if/else statements to dim my mulch-dimensional arrays, but I think this problem is still manifesting itself in my code through user crashes.

Hi there. My name is Dug. I have just met you, and I love you.
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 24th Feb 2012 22:34
I haven't made any progress myself The issue seems to have gone dormant, even though I know it's still out there... I'll still try to catch the cause when I can reproduce it, but for the time being, I think it knows we're hot on its trail. The bug won't show its face anywhere. May have to write some separate code as well to test.

swis - No, it's not pokemon.
Joined: Tues Dec 16th 2008
93% of human interaction is non-verbal.
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 16th Mar 2012 19:44
Alright! I'm reviving this thread because I'm fairly certain the issue is simply derived from reaching outside the array (and nothing else tricky, as we suspected), whether or not it seems possible within your code. I added catch statements for my problem arrays and haven't had a crash since. We still need to throw together some example code My issue always came up in for loops

swis
Joined: Tue Dec 16th 2008
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 17th Mar 2012 10:24
@ swissolo. That is what I said near the beginning of the thread lol.

Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 17th Mar 2012 12:26
To be honest, I think there are several 'ninja's of the night'... I found one the other day where my app would crash instantly and it was because I declared a variable as a float and tried assigning the value 15 and not 15.0. Normally this would be ok, but for some reason this was causing the app to crash instantly... Once I changed this, all was ok...

Its difficult to recreate these issues, from what I can tell they only occur on larger projects, when there is alot of code...
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 20th Mar 2012 20:00
Quote: "@ swissolo. That is what I said near the beginning of the thread lol."

Just restating in hopes of resolution and pointing out I had the same results

Quote: "To be honest, I think there are several 'ninja's of the night'... I found one the other day where my app would crash instantly and it was because I declared a variable as a float and tried assigning the value 15 and not 15.0. Normally this would be ok, but for some reason this was causing the app to crash instantly... Once I changed this, all was ok...

Its difficult to recreate these issues, from what I can tell they only occur on larger projects, when there is alot of code..."

I've found the same thing as well. Although I'll have to check the integer casting point you noted. I'm a bit upset with AppGameKit at this point because it just won't work correctly. In some cases large bunches of code don't even run, then I move a comment and the code functions, until I declare a new variable and it crashes I feel like we really need to isolate the issues so TGC can have any hope of fixing them.

swis
Joined: Tue Dec 16th 2008
3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 20th Mar 2012 20:24
If program is in c++ I would use vectors instead.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps.
Developed the tiled map engine seen on the showcase.
Veterian for the military.
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 20th Mar 2012 20:26
Quote: "If program is in c++ I would use vectors instead."

It's tier 1, so everything has to be managed with arrays

swis
Joined: Tue Dec 16th 2008
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 25th Mar 2012 19:35 Edited at: 25th Mar 2012 22:00
I was writing code for a hexagonal grid and I seemed to get the error. Unfortunately, I can't seem to fix this one. I haven't any idea if the code is right. Have a look,

The adjacent command isn't even used yet, this grid should appear rectangular at this point. (had to test it, looks like it failed)

swis
Joined: Tue Dec 16th 2008
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 25th Mar 2012 21:10
The error is in this line:


You are missing a 'g', it should be:


Cheers,
Ancient Lady
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 25th Mar 2012 21:51 Edited at: 25th Mar 2012 22:06
haha, whoops Well it least it can be noted that initializing an array to 0 slots can crash it. Thanks

Edit: yup! works right now!


swis
Joined: Tue Dec 16th 2008
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 27th Mar 2012 23:46
Just a note to everyone, I've reworked this thread so we can all target the issues There's a short list already.

swis
Joined: Tue Dec 16th 2008
swissolo
14
Years of Service
User Offline
Joined: 9th Jan 2010
Location:
Posted: 12th Jun 2012 00:28
A few months later and I felt it may be a good idea to get back on top of this small thread. It needs to be updated for the v1076 most recent update. I'll run a few tests first to see what is still nonfunctional

swis
Joined: Tue Dec 16th 2008

Login to post a reply

Server time is: 2024-05-07 07:43:42
Your offset time is: 2024-05-07 07:43:42