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 / Application doesn't render on-screen unless orientation is adjusted

Author
Message
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 1st Aug 2012 03:51
Using xcode 4.3.3 w/ iPhone 4 iOS 5.1 and AppGameKit 1076

Here's my init code for the screen and resolution



But my app won't render to screen unless something forces the app to switch resolutions: the screen appears black and blank (though I can still interact with the app, because I hear music and noise coming from it from within my app).

It's just that there's nothing there to view on screen! If I rotate and move the phone around for a bit, it will eventually start to display.

Anyone else have this problem?

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: 1st Aug 2012 16:41
Try doing two Sync() commands after the code you list.

The display does not update at all until you do a Sync() (that is what the command does).

If you are doing your own splash screen at the start of the app while you load stuff up, definitely do TWO syncs to make sure that the the display updates. The 'new' display is written in a back buffer while the 'current' one is displayed.

Cheers,
Ancient Lady
AGK Community Tester
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 1st Aug 2012 16:54 Edited at: 1st Aug 2012 16:55
I just threw in about 10 syncs() right before my main menu, I'll test it out.

BTW, I'm getting more errors with my app - I keep getting null pointer exceptions when I build and run with xcode (and causing my app to crash and burn) but it works perfectly in the AppGameKit Player.

I am still at a complete loss. I'm in the process of sending an email for help to the TGC team.

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 16:58
Also, I changed the layout of my file storage to where I no longer need to use "SetFolder" or "SetCurDirectory", etc. but file commands still do not work - I cannot delete files for the life of me.

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: 1st Aug 2012 17:50
Do the unzip commands work now?

Why is it necessary to delete the files? If that is the only thing holding you up, it might not be worth worrying about.

Cheers,
Ancient Lady
AGK Community Tester
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 1st Aug 2012 18:45
Hey Ancient Lady,
I have no idea what's going on, but now my app is crashing (again) after playing a level. I seriously don't understand how or why it's doing it - I send the AppGameKit team an email, and from my guess is that the Player is dealing with null pointers that are crashing.

Anyway, the reason why I need to delete the files is because it's downloadable content. Granted, I could switch the feature to 'download new maps!', which could actually work in the long-run. But the problem is, right now the temporary files needed to play a map will keep accumulating and will cause conflicts, as well as increase the application size. :/

Also, the whole 'screen does not render on start' problem doesn't help. The fact I added 10 syncs before I start my main thread doesn't help, the player just randomly decides to display the screen on it's own.

I'm trying to install an old SDK to see if that helps, and I sent three members of AppGameKit team an email cry for help. But, there's only so much I can do. This is starting to turn into a problem with the AppGameKit interpreter for iOS instead of my code.

The reason why I can say this, is because when I run it on my PC, it runs 100% like it should. If AGK's motto was true ("Write once, deploy everywhere") the same should apply to the iOS version 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: 1st Aug 2012 19:24
10 syncs() is too many, you should not need more than two.

If you reorganize your main.agc file it might help. Put all the constants at the very top (I noticed that you referenced a couple before they were defined). Put all your type definitions next, to make sure that everything is allocated. Then put all global variables after that. Then start doing function calls. I know the IDE doesn't complain and it works on Windows, but proper ordering of things will help to make sure that all definitions are in place when needed.

It's also possible that the length of time it takes for a display to show up has to do with the size of the app and all the data.

I suspect that the IDE/Player combination doesn't work as well as playing something directly on the device. We found that to be the case with a reported bug (#380).

If you built the app in Xcode and then attached your iPad (iPhone, whatever) using the standard cable, you can run the app from Xcode. Once it is run that way the first time, you can run it directly from the device without using Xcode. Both Xcode and Eclipse leave a fully functional copy of your app on the device if they are used to run it at least once.

I have had very few problems running my Tier 1 projects from Xcode on an iPad 2, an iPad3 and an iPod Touch. The only time I have any problems is when there is something wrong in the original code.

So, even if something apparently works in Windows, there may be something wrong in the code that shows up in the other platforms.

Try reordering your code in the main.agc file as suggested and see what happens. If you still have a problem, send me the project again and I'll test it on my setups.

Cheers,
Ancient Lady
AGK Community Tester
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 1st Aug 2012 21:03
Good news, I found the area that was causing the app to crash after playing a map. I added some conditional statements and it should be cleared up.

I'm still having issues with my app not displaying immediately, though it should be. And still the same issue with files not being deleted, although they should be anyway.

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: 1st Aug 2012 21:56
Try putting a non-blank splash screen up as the first code, right after the constant, type and global declarations.

Something like:


That's what I do in my app and it shows up after the Default.png image.

Do you have a Default.png, Default-Landscape.png and Default-Portrait.png images set as resources, NOT in the media directory?

Check this link to make sure you have the required images, otherwise Apple will reject your app: http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html

The Launch images are the Default(-Landscape/Portait).png ones.

If you have a Default.png image in your Xcode Resources (again, directly under the Resources folder, not in media), it should appear as soon as the app starts to load and will stay visible until at least the first line of code (from your bytecode.byc file) gets executed.

And, how can you tell if files are being deleted or not on your iOS device?

Cheers,
Ancient Lady
AGK Community Tester
anwserman
12
Years of Service
User Offline
Joined: 20th May 2011
Location: Wisconsin
Posted: 2nd Aug 2012 11:01 Edited at: 2nd Aug 2012 11:04
Ancient Lady,

AGKsplash.png was the problem. It wasn't being removed from the screen on the first sync. Because it was a black image - it just looked like nothing was being rendered. When I changed the image to one with random scribbles, that stayed on-screen until I started rotating the phone, and then it disappeared and normal gameplay resumed. I deleted AGKsplash.png from my project

That being said, I'm now in the process of killing and restarting my app multiple times to test it out, and my splash screen transitions like it should.

Also, to tell how files are being deleted or not! Simple - whenever I start the internet functions in my app, I tell my app to delete one file, "listings.zip". This is the first file that gets downloaded for DLC in my app.

Through trial and error, I discovered that AGK's internet commands will create a 0-or-1 byte file if it cannot download a file. What ends up happening, is that the file does not get deleted, it does not get replaced with a 0-or-1 byte file (on failure to connect) and the program happily accepts the previously downloaded file as new.

So, the game will somehow keep ALL of the files I've already downloaded and pretend that it's downloading them as new. It's supposed to overwrite existing files, but instead it keeps them all. I don't know how or why, but I can end up playing maps that should have been smited off my phone.

The code works if the file was never downloaded to begin with - e.g., whip out a brand new iOS device, install it, disable the Internet, and viola - it throws errors that it cannot connect to the internet. No such dice if a version of the file already exists.

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

Login to post a reply

Server time is: 2024-05-07 05:30:48
Your offset time is: 2024-05-07 05:30:48