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 / My game is not responding

Author
Message
JORGEMAL
14
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 22nd Jul 2013 21:39
I developed a game using Basic Tier 1 which has 30 levels, all of them working fine if I run them in my Windows PC. I have built an Android App using the instructions on the video "Building an Android App with App Game Kit" successfully. The problem that I have is that, when I run the game in my Android device (Nexus 7 tablet), it sometimes gets stucked when I want to go from one level to another with the following message:

Space Thunder isnĀ“t responding.
Do you want to close it?

Where "Space Thunder" is the name of my game.
First, I thought the problem could be with sprites, but I have a function which gets rid of them at the end of each level together with other resources as images, sound, etc. In fact, I also have another function (inside the loop) that deletes sprites as soon as they move out of the screen.

I know this is a difficult issue to solve through this forum, but anyway I post my case in order to get any feedback.

Regards,
Jorge Maldonado
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 22nd Jul 2013 21:50 Edited at: 22nd Jul 2013 22:02
i think there is a long loop (long delay) and the device think it do no response.
a pc is much faster and different.
maybe debug with print some timestamps, mean timer() command that you can add in a string.
i know this kind of message, it must have a continue button.

at my android device i think big png's took a long time at loading.

for your solution , try some sync() between steps
that take a little bit longer, so the os get feedback.
(progressbar)
JORGEMAL
14
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 22nd Jul 2013 21:55
Thanks for your reply Markus.
You tell me to try some sync() at longer loops or between steps. Do you mean to include more than 1 sync() in a loop or to include sync() in other parts of the code?
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 22nd Jul 2013 21:58
i edit my entry , i don't want confuse you.
at first you must find the part that take longer.
you said it is between level changing.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 22nd Jul 2013 21:59
Hard to say what it could be. There are normally issues with getting your app working nicely on all devices. Things can time out easier on android than the pc for one. I would definitely check you have identical names in code and filename. So try to avoid having ANY difference in the file name.
For example.
loadimage(1,"test.png", where the file is actually "Test.png", that will not work on android. you have to match them precisiely, caps and all.

Possibly not the issue, but worth a check.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 22nd Jul 2013 23:03
Another thing to try is to make sure that the text/sprite/image exists before calling the delete command for it.

If you try to delete something that isn't there, it just might cause an issue.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JORGEMAL
14
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 23rd Jul 2013 22:37
I included code to generate a text file to write "debug information" like Markus suggests, but I do not know where to find such a file in my Android device. I connected my Nexus to a PC and performed a Windows search but nothing was found. I will appreciate any comments.

Regards,
Jorge Maldonado
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 23rd Jul 2013 23:43
Some Android devices let you use the Android file manager (either native to the device or downloadable from the Play store) to find things.

And some don't, unless you jail break it. Which I do NOT recommend.

But I have discovered that only one of my 5 tablets (the Android 2.3.3 one) actually lets me find the directory where things are written for my apps.

The directory for your app in the sand box area will be named the same as the app package (com.yourcompany.yourapp). In theory, it will be directly under a directory named 'AGK'.

My Nexus 7 is one of the ones that somehow hides all those directories for the AppGameKit apps I put on it.

If you were in Tier 2, there is a way to output to the LogCat viewable in Eclipse.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Auger
12
Years of Service
User Offline
Joined: 21st Aug 2011
Location: Out There
Posted: 24th Jul 2013 06:41
Just a thought are your levels loaded from the device when you switch between them? I made a word game with a fairly hefty dictionary and it would load instantly on the PC but took roughly 6 minutes to unpack on an android device.


Auger
Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 24th Jul 2013 23:37
game pls respon

JORGEMAL
14
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 29th Jul 2013 02:20 Edited at: 29th Jul 2013 17:22
We found the issue that causes our problem, which I am describing below.

We have 15 mp3 music files in the media folder. Each level loads and plays(loops) one of them, and it is deleted at the end of each level. If we set our game not to play music, then it works fine; the "not responding" issue gets fixed. We have noticed that when the music is enabled in the game, sometimes the music does not loop. The sizes of the mp3 files vary from 285 KB to 1041 KB. One of the levels that stops responding plays a music file of size 325 KB.

Any comments will be appreciated.
Regards
JORGEMAL
14
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 29th Jul 2013 19:30
I have read several posts saying that music is a known issue in AppGameKit v1076. In my case, some mp3 files play well, other do not loop, and in other cases, my game stops responding. What is the recommendation? Should I wait until version 108 is released ?

Regards.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Jul 2013 20:05
You might try installing v10816 in a separate directory from your v1076 setup and see if your problems get fixed.

I know they've done a lot of work on music and sounds since v1076.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JORGEMAL
14
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 29th Jul 2013 22:39
I just installed v10816. Now I want to generate Android code so I open my project with this new version and compiled, but I do not see a new byc file in the media folder.

Regards,
Jorge Maldonado
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 29th Jul 2013 22:57
Delete the <yourproj>.exe file in your project directory and the following files from the <yourproj>/media directory (if they exist):
<yourproj>.byc
SourceCode.agc
SourceCode.txt
ErrorReport.txt

Then rebuild in the v10816 IDE (make sure you have the right one).

Then there should be <yourproj>.byc and SourceCode.txt files in the <yourproj>/media directory.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JORGEMAL
14
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 30th Jul 2013 21:37
I followed your instructions and tested in my windows environment, but now the text messages that show the game stats (lives, energy, enemies left, number of bullets left, etc) look like garbage. What I noticed is that the file "SourceCode.agc" in the media folder does not get created anymore after rebuilding the game no matter if I used version 1076 or version 10816. Also, the problem with the text messages appears in both versions of AGK.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Jul 2013 21:47
v10816 doesn't make the SourceCode.agc file, it doesn't need it.

Can you show the code that you use to create the text?

Are you using a custom font?

If so, is it fixed width or variable?

If it is variable, do you have the "<font file name> subimages.txt" file? It would have the same name as your font.png (without the .png) file, followed by a space and then 'subimages.txt'.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JORGEMAL
14
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 30th Jul 2013 22:02
Here is the code that creates the text message. The Arial.png image is located in the media folder, which I suppose is automatically included when a new project is created.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th Jul 2013 22:37
The Arial.png file is the default for text, you don't need to load it to use it. And it might not be impossible that you are confusing the system.

What is the value of intFontImage?

And, try this order of commands (I left in your font commands just to be sure we used the same set of commands as you started with):


How is it not appearing correctly?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JORGEMAL
14
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 31st Jul 2013 20:27
intFontImage is an integer variable that has the value for the ID of the image, in my case it is 821.

You say that Arial is the default font and that I do not need to load it, but if I remove the LoadImage command I get an error.

Now my game is a mess everywhere text is displayed. I created 2 projects for testing purposes, one with version 1076 and one with version 10816 beta, and my problem remains no matter which version I use. I do not have any idea of what is going on, my game was working fine before I deleted <yourproj>.exe from the project folder and the files from the media folder:
<yourproj>.byc
SourceCode.agc
SourceCode.txt
ErrorReport.txt

I wonder if deleting these files had anything to do.
I am attaching a screenshot for you to see how it looks.

I will appreciate any comments.

Attachments

Login to view attachments
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st Jul 2013 20:54
Quote: "LoadImage command I get an error."

Did you also remove the SetTextFontImage(1, intFontImage) command?

The files I said to delete are the ones that are created during a build. Some versions create all of the files mentioned for the media directory (v1076) and some don't do the SourceCode.agc (v10816).

I always delete the files when I switch AppGameKit IDE versions. I have v1076, v1082-v1085, and v1088-v10816 all installed in separate directories. And I keep my projects in a path outside of the AppGameKit paths. Then I can test the same code with different versions.

Deleting those files before you compile should not cause an issue. In fact, there had been (and probably still are) cases where the IDE doesn't recognize that a source file has changed and doesn't actually rebuild the byte code file.

I am pretty certain the Arial.png is the default font.

What did/does your font load command look like? The Arial.png is not in the default location for loading images.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JORGEMAL
14
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 31st Jul 2013 21:26
I am sorry, I had not deleted the SetTextFontImage command; text messages now can be seen.

What is the correct location of the Arial.png file or any other png font file?

Regards.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st Jul 2013 21:32
If they are your own font files, then the media directory is a good place.

The Arial.png (and some other images) are generated when an app starts and deleted when it ends (properly, anyway).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JORGEMAL
14
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 1st Aug 2013 21:15
Quote: "v10816 doesn't make the SourceCode.agc file, it doesn't need it."


Should v1076 create the SourceCode.agc file?
I am testing with both versions and I do not see such a file when I use v1076.

Regards.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 2nd Aug 2013 18:28
Quote: "Should v1076 create the SourceCode.agc file?"

Yes, it does.

Are you using the same project directory in both versions of AppGameKit (like I do)?

If so, you need to make sure to delete the <project>.exe file before you build in either version. If you build in v10816, then try in v1076, it might think that it doesn't need to because of the time stamp on the .exe file.

The compile function is not always good at recognizing that maybe it does need to compile the byte code file.

This is sort of a known issue and why I requested a 'Clean' function for the IDE.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
JORGEMAL
14
Years of Service
User Offline
Joined: 2nd Aug 2009
Location:
Posted: 3rd Aug 2013 00:31
Yes, I am using the same project for both versions. I make sure to delete the executable in the project folder, and the following files in the media folder (as you recommended):

<yourproj>.byc
SourceCode.agc
SourceCode.txt
ErrorReport.txt

I suppose I can create a new project and compile from scratch using v1076 but I would not want to have 2 versions.

Is there anything else I can do to go back to v1076?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 8th Aug 2013 23:31
I apologize for not responding sooner, but I've been on vacation since the first.

It is possible to have multiple versions of AppGameKit installed at the same time. Just put them in different directories.

You can then put your projects in a separate directory. Only one AppGameKit IDE can be open at a time. But both will use the same project list (the projects that are opened in one IDE will show up in the other when it is opened).

Then, you do the file deletes manually of the built files and recompile when you switch versions. I do this regularly to test which version introduces or fixes a bug.

I use a tree something like this:
C:\TGC\AGK1076\IDE
C:\TGC\AGK10816\IDE
C:\TGC\Tier1Projects (with lots of projects that are included in the list of projects in all IDEs)
C:\TGC\Tier2Projects

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-04-27 13:17:52
Your offset time is: 2024-04-27 13:17:52