3.0.0 beta (ZGE on Android)

Information and change log about the latest ZGameEditor release.

Moderator: Moderators

Post Reply
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

OK - I got my rig to compile .apk files, but the process to figure it out was weird.

It wasn't compiling, but I noticed as the screen flashed by, it couldn't find tools.jar. By taking a trigger finger screen shot I found it was expecting tools.jar to be in programfiles\java\jre6\bin , and I found it in programfiles\java\jdk1.6.0_23\bin. Being leery of checksum errors, I cut and pasted to the expected folder.

Still no .apk , so three more trigger finger screen shots and I found javac.exe was similarly required, so I moved it also.

Success, and eclipse compiles to the emulator, so I think I'm OK.

EDIT
- the .apk's run fine on my phone
- the run.bat for debug doesn't
"great expectations"
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Yeah it is difficult to get all the apk-building dependencies right. I have tried to make ZGE wait for keypress if something goes wrong during building but haven't found a way yet.

Probably the main issue is that ADK requires the full Java Developer Kit (JDK) to run correctly. And it should be in your path, so typing javac in a command prompt should run the Java compiler.
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

I found out why run.bat isn't.

Program files is two words and cmd.exe gets hung up on "Program not being a command".

Hint: Put a PAUSE command as a fourth line in run.bat
"great expectations"
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

Here's the fix for run.bat

Substitute [Progra~1] for [Program files]
"great expectations"
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

You are right, I'll fix that and add some PAUSEs if an error occured. Thanks.
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

A little bit further on apk-building:
- Improved error handling so that both "Android: Run" and "Android: Build apk" menuitems will wait for keypress if a problem occurs.
- Quoted paths in Android builds to allow spaces in filenames
- New settings for Android keystore file and keystore alias. This is for signing. If these are set then Ant will ask for password during build of release apk and your apk will be signed and ready for upload to Google Play. Now all that's left is a dialog to help generate keystore file.
- Version name and number can be set for apk-generation. This is saved in the current project.
- Updated help file from yoffset

Install from here: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
Attachments
apksign.png
apksign.png (2.31 KiB) Viewed 12746 times
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Ville - another great update! I tested it and it's working as expected, at least in my environment. I think that Android application generation is now in a very good state, maybe it's already finished (unless some bugs appear). Or do you have some more to-dos?

BTW I looked at NDK little bit closer and, among other things, it's possible to access sensors. Do you plan to integrate Android sensor handling in ZGE directly or should I try to implementation some sensor handling shared library? The first option would be more comfortable for developers, of course.
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Rado1: Good idea. What sensor do you suggest we begin with? "Tilt" detection using accelerator seems like a good candidate but I haven't really understood what output all the different sensors offer.

We need a function to enable/disable in ZGE because unnecessarily activating sensors consume batteries. So if we use scripting for this then something like "tiltEnable(true);". Also some sensors are for higher API levels so we shouldn't accidentally use them unless we decide to leave 2.2 compatibility.
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

VilleK wrote:Rado1: Good idea. What sensor do you suggest we begin with? "Tilt" detection using accelerator seems like a good candidate but I haven't really understood what output all the different sensors offer.
Exactly, tilt would be the most useful sensor for games. Another candidate is pressing of buttons (menu, home, back, ...). A convenient way would be to use KeyPress component with special keys or codes, if possible.
User avatar
jonaspm
Posts: 89
Joined: Fri Jul 06, 2012 3:51 pm
Contact:

Post by jonaspm »

Very nice ideas!
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Ok, I am back! Wow, things do take longer than anticipated. Anyway..,

The Nexus 7 has finally arrived,. and it is so very nice :) ! Saucer Invasion runs even smoother on this one, things are looking up.

I am now trying to get caught up on some of the updates for easier development. First things first, since I now have the supplied USB cable, I would like to get the "Android: Run project" working I set the N7 to "USB debugging" and set the "Select debug app" to "ZGE Android" ?

I must have missed something,. any ideas/guidance?

Note; when I use a file File Manager on the N7 the root seems to be called "sdcard0" or from the windows connection "Computer\Nexus 7\Internal storage" ??
Attachments
what i get?
what i get?
zdroid_run.jpg (88.65 KiB) Viewed 12654 times
Last edited by jph_wacheski on Sun Jul 29, 2012 4:47 pm, edited 2 times in total.
iterationGAMES.com
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

I set the N7 to "USB debugging" and set the "Select debug app" to "ZGE Android" ?
usb debugging is correct - debugging app? - dunno - try it.
called "sdcard0" or from the windows connection "Computer\Nexus 7\Internal storage" ??
Yeah - windows only reads from the sdcard-not allowing access further back up the path, and calls it internal storage. I use "Solid Explorer" free from Google apps to get around the directories. When you get to the root look for "mnt" and "system" and "sdcard".
Note- advice for Galaxy nexus.

cmd line end should read /sdcard/zzdc.dat
"great expectations"
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Hi Jph,

The "device not found" message indicates that the Android SDK does not recognize your device.

I Googled a bit and it turns out that this could possibly be resolved by just using another USB port on your computer.

Another option is to try installing Google USB driver (although it does not mention Nexus 7).

You can also try upgrading Android SDK by starting "SDK Manager.exe" (found in SDK folder) and install whatever it suggests.

I'm not sure what the ""Select debug app" setting is, must be something new and you shouldn't need to set it. Some more suggestions here.

Hope it helps!
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

A quick small update regarding the discussion we had earlier about more options for realtime sound. I came up with a solution to let scripting modify audio while it is playing.

New property: Sound -> IsReference (edit: renamed PlaySound.ByReference). When this is checked then the sound isn't cloned when emitted so scripting can modify the properties and they will take effect in realtime. Try attached example.

Note that on Android there are still noticeable "steps" in the audio, this is because the internal buffers are large. This will work better when I find time to use the newer audio API:s instead. Also since scripted changes occurs every frame it means that the audio changes will still be somewhat frame rate dependent. Still it should make things possible that weren't before. I'm sure Jph can (ab)use this feature with great results ;)

Also note that just like models with SpawnModel Reference, a sound with IsReference set cannot be played more than once (because there exists only one). Then it needs to be played until completion until it can be played again.

Install from here: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
Attachments
SoundRefTest.zgeproj
demo project. either use mouse or touch to modify sound. two touch cursors are recognized.
(1.1 KiB) Downloaded 436 times
Last edited by VilleK on Thu Aug 02, 2012 8:27 am, edited 1 time in total.
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

ohh,. new sound option=cool! I will check that out.

I just can not seem to get adb to find the device, this is strange as it shows up in windows and I can transfer files fine,. (putting the zzdc.dat in "Computer\Nexus 7\Internal storage" works fine) the tablet shows "USB debugging connected" notification too. Anyway, with the usb connected it is easier than going through dropbox, so I will leave this for now and just start building something fun. It is just a drag and drop, plus a couple mouse clicks to test like this so whatever. (I have not tried the automated building yet but doubt that will work till I get adb going.)

One thing that would be great is an option to set the screen orientation. The nexus7 home screen is locked to portrait, so I think some vertically oriented games will be good here,. it is easy to hold one handed too. Ideally we could use the tilt sensor to reorient the game,. actually just the GUI stuff would be needed to turn 90 degrees, as thouches are the same no mater how you hold the thing.., but it is really the OS bar that needs to move, (and a flag sent to zge when it does, so the game code can shift the GUI stuff). for now the simplest thing would be to just have a flag in the editor for portrait/landscape. This way we can just choose for each game the orientation. (I tried setting width to 720 and hight to 1280 but the OS GUI bar stays landscape.)

oh, also is there anywhere I can set the build path for the "Build zzdc.dat file" as I don't like to write over and over to my solid drive,. I have a spinner i use for most data,. other than apps that I want to load fast.
Attachments
zzdc_of_tapFling_tests.zip
some sort of simple strategy game developing here,. . just a test.
(7.43 KiB) Downloaded 405 times
iterationGAMES.com
Post Reply