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 / Game runs on Galaxy Tab S2 but not in ZenPad 8

Author
Message
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 4th Jan 2018 15:28 Edited at: 4th Jan 2018 15:46
I cannot image what is going on here.
The game runs without any problem on Samsung but I am getting the following error in Asus:
Quote: "Array index out of bounds, Index: -1, Array Length: 6 in ../agklib/xxx.agc at line 104"


I suspect that for some reason a file cannot be found. But why only on one tablet and not on the other?
Do you have any ideas?
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 4th Jan 2018 16:12 Edited at: 4th Jan 2018 16:13
It looks like your trying to access an array element at position -1 on the zenpad, which makes me think you use an uninitialised variable. (Value as integer) When you create the value used to choose the array position, do you initialise it to 0, or just use it? (Value as integer: Value = 0)
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 4th Jan 2018 17:28
Hmm... can I debug while I am broadcasting?
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 5th Jan 2018 11:31 Edited at: 5th Jan 2018 11:35
I think I face a problem that is beyond my knowledge.
I spotted the issue to the the following part of my code:

I placed the end command BEFORE the imgmap_Create(m.area[i].map, img_filename, data_filename, 0.0, 0.0, 100.0, 100.0) function call, and the program terminates normally. As someone would expect.
I placed the end command AFTER the imgmap_Create(...) function call, and the program crashes and displays the message:
Quote: "Array index out of bounds, Index: -1, Array Length: 6 in ../agklib/xxx.agc at line 104"

After that I decided to end the game inside the function imgmap_Create(...), in order to locate the bug. What happens here is strange:
The program terminates normally even if I place the end command at the end of the function. If I remove the end command from the function then the program crashes again.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 5th Jan 2018 11:50 Edited at: 5th Jan 2018 11:51
Quote: "area_length = imgmap_areaGetCount(m.map) - 1"

If m.map is 0, then area_length will be -1, causing the error.

Perhaps try the following:



Could you show the code from the imgmap_Create function?
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 5th Jan 2018 17:34
Hi Mobius,
Thank you for spending some time for my issue
I tried the If area_length < 0 Then area_length = 0, the issue remains
Here is the imgmap_Create function:


Note: I've enabled the developer mode in Asus tablet, but I have not made any changes to the developer options.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 8th Jan 2018 09:27 Edited at: 8th Jan 2018 09:27
You change the length of m.area

You set a value called area_length before your call to imgmap_create, then within that function, you change the length of the array. When you leave that function, the for loop is using the original length of the array causing an issue.

I believe that this for loop would be better structured as a while loop.

george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 8th Jan 2018 19:18
Quote: "You set a value called area_length before your call to imgmap_create"

Thanks again Mobiius, but this is not the case. I dind't post the whole part of the code which is the following:


What drives me crazy, it's the fact that the same code runs without problem under my windows PC AND the tablet Samsung Galaxy TAB S2
I've attached the APK file. Could you please test it in your android device and let me know if it runs?

Attachments

Login to view attachments
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 8th Jan 2018 20:16
I haven't tested the APK, but this is likely to be something to do with different screen resolutions / ratios. A position on the Tab S2 and PC might relate to something within range, but on the ZenPad8 might be out of range if that makes sense. Are you using a virtual resolution set to the device width and height by any chance? Just a guess - I'd need to see more code to know for sure, but might help point you in the right direction.
george++
AGK Tool Maker
17
Years of Service
User Offline
Joined: 13th May 2007
Location: Thessaloniki, Hellas
Posted: 8th Jan 2018 20:43 Edited at: 8th Jan 2018 20:44
Quote: "Are you using a virtual resolution set to the device width and height by any chance?"

Yes I am using virtual resolution.
Quote: "I'd need to see more code to know for sure, but might help point you in the right direction."

Wish I could. I don't mind to share anything but it I think it won't help, since there is a lot of code behind.
If I got some reports here, that my code is not running then the Samsung is the exception and not the Asus.
The tragedy: I bought the Samsung a year ago for sharing with my wife. The goal was to test the AppGameKit code. But my wife had other plans, and I couldn't use it for a long time. So I decided to buy Asus for me, but this f...g stuff is not playing.

Login to post a reply

Server time is: 2024-11-24 03:24:07
Your offset time is: 2024-11-24 03:24:07