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 / Testing 1075 on Windows, Android, iOS and Mac

Author
Message
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 30th May 2012 05:04
Quote: "Are you using SetVirtualResolution() to some landscape values such as 800,600 to fix the aspect ratio? SetOrientationAllowed by itself will not change the ratio. You could also use SetDisplayAspect(1.5) if you are using percentage coordinates."


Paul, i'm using the SetVirtualResolution() after in my code.. yes. (i've tried the SetOrientationAllowed after and before and i've the same issue.). I've not yet compiled the 1075 iOS Version to compare with... But everything was working well before. The SetOrientationAllowed combined with the SetVirtualResolution (GetDeviceWidth(),GetDeviceHeight()) (which is 480,320 for my android phone and 1280,800 for my android tablet) was forcing and rotating well before.


Quote: "The AppGameKit base seems to assume you start in Portrait orientation.

We need some way to indicate to the interpreter that it should be starting (or assuming) a specific orientation. Or the ability to force it as soon as the app starts (SetOrientationAllowed as the first line in the Tier1 code does not work to do this)."


totally agree with that
Grumpy Jedi
14
Years of Service
User Offline
Joined: 16th Jan 2010
Location:
Posted: 30th May 2012 09:19
Quote: "Paul, i'm using the SetVirtualResolution() after in my code.. yes. (i've tried the SetOrientationAllowed after and before and i've the same issue.). I've not yet compiled the 1075 iOS Version to compare with... But everything was working well before."


I did a compile for 1075 iOS and I'm having the same problems as you Mike. The device ignores SetOrientationAllowed() settings and always starts in portrait mode.

It will sometimes rotate over to landscape if you're holding the device that way at startup and distort the image by stretching it, while keeping the portrait aspect ratio until whatever is overriding the orientation releases control. Then it will correct the aspect ratio.

If you hold the device in portrait and start the app, it will remain in portrait until you rotate the device, even if the app has SetOrientationAllowed(0,0,1,1). Once you rotate the device, provided the portrait override has released control, it will go to the proper orientation and obey the SetOrientationAllowed() settings. If it has not yet released control of the orientation it will distort by stretching as stated in the paragraph above.


Quote: "Quote: "The AppGameKit base seems to assume you start in Portrait orientation.

We need some way to indicate to the interpreter that it should be starting (or assuming) a specific orientation. Or the ability to force it as soon as the app starts (SetOrientationAllowed as the first line in the Tier1 code does not work to do this).""


I agree as well, we need the app to adhere to the settings of SetOrientationAllowed() from the moment it is started.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th May 2012 19:11 Edited at: 30th May 2012 19:15
Paul, I just spent the morning playing with the Android and your suggestions.

I added the following at line 400 of Core.cpp in the <app>/jni directory:


I set the frame rate at 5 and did this in the accel function:


Simple output of the device type, axis and modifer values:


For the rest:

I would note that the reported X and Y were correct for the actual orientation and tilts applied. As was the GetDirectionAngle() value.

And I could not get it to go to the 'other' portrait and landscape orientations at all.

My game, did not seem to cooperate with reading the X/Y okay when I used 'SetOrientationAllowed(0,0,1,0)' in the program and 'android:screenOrientation="landscape"' in AndroidManifest.xml. It insisted that everything was 90 degrees off.

But when I used 'SetOrientationAllowed(1,1,1,1)' and 'android:screenOrientation="fullSensor"', it recognized X/Y perfectly. Except it would flip orientation and that is a problem for the game. Same result for 'android:screenOrientation="landscape"'.

Using 'SetOrientationAllowed(0,0,1,1)' brought back the same problem with reported values.

So, trying to force the Android to stay in landscape orientation causes a problem with the reporting. If allowed all orientations, it is happy, but anyone who needs to force landscape only will not be.

Cheers,
Ancient Lady
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th May 2012 19:37 Edited at: 30th May 2012 20:26
For completeness, I put back the original Core.cpp for v1075, cygwin cleaned and built, testing the 'SetOrientationAllowed(1,1,1,1)' and 'android:screenOrientation="fullSensor"' combination.

The wrong direction thing happened again AND it flipped about.

EDIT: Actually worse. It would sort of go in the correct direction and then, at certain angles, go 90 degrees off, and then change again when going the other way.

I also deleted the AGKSplash.png image and added this as the very first lines in my app:


In windows, it shows up the image correctly, first off. On the Android, I just get a black screen until the next time I change the display and sync.

I'm going to go see what effect this has in the Mac/iOS world.

UPDATE:
On Windows, I get a white screen, followed by my splash, then the next 'real' display.

On the Mac, it loaded so fast that I couldn't tell if my initial image showed up. But it didn't appear to pause when it couldn't find the AGKSplash.png file.

On my iOS devices, I get the correct Default image, followed by a white splash, then a black screen, then the first game screen.

Cheers,
Ancient Lady
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th May 2012 20:34
Thanks, that's exactly what I needed to know. Your tablet reports itself as being a tablet whilst having the accelerometer of a phone (Y and X values should be swapped on tablets and phones)

Try the attached core.cpp which uses a different method to detect if the device is a true tablet or phone, this time g_pTablet should be false for you as your accelerometer is of the phone type.

Attachments

Login to view attachments
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th May 2012 21:12
Okay, I'll try it shortly and let you know what happens.

I appreciate your working with me on this. I suppose I won't be the only one with a weird android device.

Cheers,
Ancient Lady
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 30th May 2012 22:09 Edited at: 30th May 2012 22:25
Outstanding! Wonderful! Oh Joy! Oh Rapture! Hazzah! (Don't know what that last one means, but it sounds good.)

My app is very happy! It is reading X/Y correctly and not flipping orientation.

AND the add gets the clicks in the correct place.

I am a very happy programmer.

And I added my own splash screen and it behaves completely properly on the Android without any white/black blanking.

When I start the app in portrait, it shows funny with the splash and 'loading' page, and then flips to the correct orientation. And returns the device to portrait mode when the app is exited. It behaves absolutely perfectly and is quite civilized.

Thank you.

Now we get to share this with everyone?

UPDATE:
I ran the show-orientation test program and it indicated that the orientation the other app was showing up in was 4. So, I checked the definition for the SetOrientationAllowed command. Landscape is 3, when you rotate the device left from default. Landscape2 is 4, when you rotate right.

I tried changed the changed the one I allowed from landscape to landscape2, AppGameKit build, copied, cygwin clean/build, eclipse run.... And it was forced the app to the other landscape and behaved well.

But it appears that my android device does orient 4 when turned left and orient 3 when turned right.

I can live with this, as long as it otherwise behaves appropriately, which it does.

I suspect it isn't a real issue. I have hard time coming up with a good scenario where it will make a difference which landscape mode is forced, as long as it is landscape.

Cheers,
Ancient Lady
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 30th May 2012 23:15
Excellent detective work!

It might be a good idea to make available a test app. We can then try it on a variety of devices and maybe draw up a table.

-- Jim
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 30th May 2012 23:33
Quote: "But it appears that my android device does orient 4 when turned left and orient 3 when turned right."


What happens if you swap lines 451 and 453 in Core.cpp so that it reads



And do the X and Y values still work if you do this?
bjadams
AGK Backer
16
Years of Service
User Offline
Joined: 29th Mar 2008
Location:
Posted: 30th May 2012 23:54
Android is one hell of a platform to support well for programmers

There are so many combinations of phones & tablets, all using their own standards.

I have a no-name made in china tablet. I only tested AppGameKit on it in the very beginning, and wonder of wonders, everything seemed to work, at around 30fps!

I don't have much motivation to release anything on Android yet, but I'm really glad that Paul is investing so much time & energy to try to fix as much things as possible.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st May 2012 01:24 Edited at: 31st May 2012 02:33
Paul, I'll give it a try a little later. I am in the middle of something.

I'll post when I have results.

bjadams, I decided to try for the android market because my hubby just happened to have one. Now I'm glad, because I can test in a bunch of areas.

UPDATE: It reports properly now, with that last little tweak.

Cheers,
Ancient Lady
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 31st May 2012 18:05
Quote: "It reports properly now, with that last little tweak."


Thanks for all your testing, hopefully this will make AppGameKit much more consistent across Android devices. Hopefully we can get a 1076 update out soon.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st May 2012 18:38
I am more than happy to help.

My customers are all very quiet right now. Which is good/bad.

It's good because it lets me work on my game and AppGameKit in general.

It's bad because it means no income for my company.

Oh well, hopefully my game does great and begins to make a name for the company (i.e. Me).

I already have the entire concept/design in my head for the next game. Which I can actually envision being played on big monitors in bars across the world. High hopes, anyway.

Cheers,
Ancient Lady

Login to post a reply

Server time is: 2024-11-23 17:11:28
Your offset time is: 2024-11-23 17:11:28