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 / "Failed to extract zip File - Could not open the zip file" on iOS

Author
Message
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 31st Jul 2012 17:30 Edited at: 31st Jul 2012 17:46
So my game runs beautifully using the AppGameKit player, but when I wrap it up and try to run it as a standalone, it does not run - it gets to the maploading screen and then crashes. I'm getting this "Failed to extract zip file, could not open the zip file" message through the output window on XCode.

Also amusing enough, it decides not to render half the time. I can touch the screen, interact through my menus, etc. Music plays, sound effects play, but not a bit of rendering going on.

I need assistance with these issues ASAP. :/

EDIT: So somehow zip files do work. Why? I don't know how but I can open up a track that I downloaded from the internet through my app, but not any local tracks. I'm really confused about how this is the case!

Hi there. My name is Dug. I have just met you, and I love you.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st Jul 2012 17:56
I have not worked with zip files, but seeing what you are trying to do (the code) might help us help you.

Or at least try to do some tests, anyway.

I do have an Xcode setup. What version of Xcode are you using?

Cheers,
Ancient Lady
AGK Community Tester
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 31st Jul 2012 18:02 Edited at: 31st Jul 2012 18:14
I'm using xcode 4.3.3 with AppGameKit 1076.

I just don't get how the exact same code runs perfectly when using the AppGameKit Player but barfs when it is ran through XCode.

Anyway, what I'm doing is that I take a ZIP file, extract a map out of it, and then load that map into memory. Simple stuff - and it works file when it's broadcasted - but it only works when I download a track. :/

EDIT2: I think Xcode (and the app) is looking for the local zip files in a wrong location. Would broadcasting the app over store those files any differently than including them with Xcode?

Hi there. My name is Dug. I have just met you, and I love you.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st Jul 2012 18:45
In your xcode setup, did you create a directory named 'media' and put all your zips, media, etc. in it and then add the directory as a resource (so that it shows up as a folder in the Resources tree) in the project?

Cheers,
Ancient Lady
AGK Community Tester
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 31st Jul 2012 18:47
Yes mam.
Now I'm sitting here trying to figure out how I nerfed my entire project, because now it defaults to the AppGameKit player whenever I run the app.

I'm slightly pissed off right now. I might delete the entire project and rebuild it from scratch.

Hi there. My name is Dug. I have just met you, and I love you.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st Jul 2012 18:56
If you add the line "#define STANDALONE" to interpreter.h as the third line, it will make sure that the interpreter always looks for the bytecode.byc for Mac and iOS.

Are you sure that your Mac is set up with the same version of AppGameKit as the Windows box that created your byte code file?

Can you show me the code you are using to access the zip file?

Cheers,
Ancient Lady
AGK Community Tester
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 31st Jul 2012 19:08 Edited at: 31st Jul 2012 19:11
Yup, using interpreter 1076 - and I just deleted the entire project and am rerunning it from scratch. I also just added



to my interpreter.h file. And it still goes immediately to the AppGameKit Player instead of my app.

As for the code accessing the ZIP file,



Where I put in "maps/53.zip" for the path and "temp" or "download" for the target.

EDIT: This should all be moot because the code works when it's broadcasted over WI-FI grrrr

Hi there. My name is Dug. I have just met you, and I love you.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st Jul 2012 19:16
Assuming that 53.zip is in media/maps, try using "/media/maps/53.zip" to make sure the app is being explicit in its path.

Also, do the same for the pTarget value and see if that helps. I've had very mixed (not good) experience when I don't make my paths completely obvious.

Stupid question, but if you started from scratch, did you make sure that your byte code file is named 'bytecode.byc' and is in the media directory?

Cheers,
Ancient Lady
AGK Community Tester
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 31st Jul 2012 19:29
Yup, bytecode is named "bytecode.byc" as such. I'll try being more specific with paths as well, and I did make a couple slight changes to my code (deleting my download directory on startup as well).

Here's hoping it works.

Hi there. My name is Dug. I have just met you, and I love you.
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 31st Jul 2012 19:53
So far, no dice. I'm noticing that my app keeps choking on trying to load what I think is a remanent file (that shouldn't be there?!?) so here's hoping that clearing out that folder will work as well.

Hi there. My name is Dug. I have just met you, and I love you.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st Jul 2012 20:00
Do you uninstall your app on your device before you try to test it?

And, how big is your zip file? Are you trying to use something to big for your iOS device?

Cheers,
Ancient Lady
AGK Community Tester
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 31st Jul 2012 20:06
Yes, I uninstall the app and everything. This is a sign of me being frustrated, but THE APP WORKS WHEN I BROADCAST IT OVER. Seriously, I throw up AppGameKit Player, broadcast the app over, and it runs like a charm. No problems, it just works. I've played my game front-to-back with no hiccups or issues to speak of.

I throw the EXACT same files that I just broadcasted over from the AppGameKit IDE into a xcode project, and build it, it runs like crap. I cannot get the first level to run successfully. There is NO reason why this should be so difficult.

Hi there. My name is Dug. I have just met you, and I love you.
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 31st Jul 2012 20:17
Ancient Lady - if you want the source code of my entire project and all supporting files, I'll send it to you. Just let me know where to, and you'll realize I'm not going crazy.

Hi there. My name is Dug. I have just met you, and I love you.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st Jul 2012 20:25
Use the 'email' button and send me the zip file. I'll see if it works for me.

Cheers,
Ancient Lady
AGK Community Tester
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 31st Jul 2012 20:34
Sent, check your spam box. I titled it, "Retro Racer"

Hi there. My name is Dug. I have just met you, and I love you.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st Jul 2012 20:55
I got the file (12MB worth!).

I don't test by broadcasting, since my home setup really doesn't work well for that (we hardwire most of our network).

I'll test it first in Windows and then in Xcode.

Cheers,
Ancient Lady
AGK Community Tester
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 31st Jul 2012 21:09 Edited at: 31st Jul 2012 22:18
Ok, can do. Thanks, still trying to get it to run. Is there an updated version of the AppGameKit Player for iOS? I'm having issues getting it to run period on the Mac now.

EDIT: Also Ancient Lady, you might get lucky and experience the wonderful 'graphics do not render' bug that I've noticed that my app seems to have.

EDIT2: Here's what I've found so far:
1) AGK's ZIP functions have a bug in them to where they cannot find local zip files
2) The reason my game won't display immediately is due to a rotation issue. Rotating the screen around a couple times will get it to render
3) AppGameKit doesn't find files to delete them, although it really should be - files that exist in the folder previous to "DeleteFile" persist even though they should be removed

Hi there. My name is Dug. I have just met you, and I love you.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st Jul 2012 22:45
If you are running on a Mac, you aren't using the Player, that is only for broadcasting from a PC from the AppGameKit IDE.

The only way to get an updated iOS player is build your own. And, since you have a Mac and Xcode, you have everything you need.

Simply comment out the line I told you to add in interpreter.h and build the interpreter_ios app and run it from Xcode while connected to your iOS device.

The beauty of running an app from Xcode is that it leaves a fully functional version of it after you stop it in Xcode.

Remember to uncomment the line you just commented out before trying to build your own apps.

I ran the program on my Windows box. It takes a long time to actually get to a play screen, lots of options to select. But, once I had the green light to go, I could not get the car to do anything using the arrow keys (on Windows they are used to simulate the accelerometer on an iOS device, works fine in my games).

Also, there are lots of places where you do path references after using the SetCurrentDir command. I have not had good experience using that command. You are much better off just using the full path you want, starting with a "/" to make sure it does it from the default start (always start with "/media/<whatever>").

And the joystick did not appear, which is what I assume is supposed to be used.

It's entirely possible that using the SetCurrentDir command and 'relative' paths is one of the main problems when executing on an iOS device.

When I put your media into my Xcode test project, it got to a black screen (your splash) and no further. After waiting a while, I tapped on the screen (the Windows test showed that it was expecting that) and the same music as played in Windows played.

But no images.

The game takes up 21.6MB when loaded and I don't think that counts the unzipped data (averaging .6MB each for unzipped file).

I strongly suspect it is your directory usage that is making the problems (in both my windows version and the iOS one).

I looked through a bunch of the code, but I don't have time to go through every line and try to make it work.

If it doesn't work in Windows, it probably won't work as standalone in any device.

Try removing all SetCurrentDir commands and make all paths explicit, starting with "/media", including in your data files, and see if that works better.

Have you tried running in Windows? I always do that before I attempt any other devices.

Cheers,
Ancient Lady
AGK Community Tester
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 31st Jul 2012 22:53
Hey Ancient Lady -
Thanks for looking at the code. It uses the joystick to run, so you'd use WSAD for control (the joystick doesn't appear in the Windows version as you'd use the keyboard).

Since you were writing that post, I updated my original posting to state that if you rotate the screen around a bit (including going back to home/returning to the app) it does reappear. I'm guessing it's something to do with the orientation of the device causing it to not appear.

As for the using SetFolder and SetCurrentDir - I would love to not use them. But I need to empty out and delete temp storage files from my DLC. There is no way to access what these files are unless you use those commands.

I'm working on this some more, testing it out. But this is BS that this works fine in the AppGameKit Player but not on the actual iOS device.

Hi there. My name is Dug. I have just met you, and I love you.
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 1st Aug 2012 03:45
ARM6 IS EVIL

Removed every single reference to ARMV6 in the build dialogs, and all issues with loading images from maps ceased to exist. However, I still have some other issues to work out, but the fact I can now play my game without crashing is a relief.

Hi there. My name is Dug. I have just met you, and I love you.

Login to post a reply

Server time is: 2024-04-28 07:55:47
Your offset time is: 2024-04-28 07:55:47