Beta release 3.1b

Information and change log about the latest ZGameEditor release.

Moderator: Moderators

Post Reply
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Ville,

I tried to create a ZGE live wallpaper, but only with a partial success - it starts ZGE in a wallpaper preview mode, but throws

11-18 13:35:27.290: A/libc(20287): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1)

after trying to 'Set wallpaper'. The same behavior I obtained for Compatible as well as for ES2/GL3 GLBase.

Attached you will find my source code. I took inspiration from here and here.
Attachments
com.rado1.BallZ2.zip
walpaper sources
(751.74 KiB) Downloaded 517 times
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I'm still too busy to debug this I'm afraid but very cool you made it this far! How about starting with a blank ZGE project just to see if the crash is dependent on the ZGE content? And in the first link you provided there seems to be a discussion the comments on various reason it might crash when choosing "Set wallpaper", perhaps something relevant there? I'm guessing it loses the GL-context somehow and ZGE is not prepared for it.
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Wallpaper starting crashes even with a blank ZGE application. Unfortunately, the discussion did not bring any solution; I tried all advises but without success. I'm afraid the code should be debugged anyway.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

I'm getting the same error here. I think the problem is that it tries to reinit the app without unloading it first.

Can you try with the attached zge.java? I tried to rebuild the app myself (using the m.bat file) but get build errors:

Code: Select all

build.xml:622: The following error occurred while executing this line:
build.xml:658: null returned: 1
Attachments
Zge.zip
(2.9 KiB) Downloaded 503 times
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Thanks Ville, it works! Just one detail: changed type of hasInitiated to

Code: Select all

private static boolean hasInited = false;
Also there are some unused imports...

Here we have the first ZGE live wallpaper! I'm going to polish the sources, experimenting with the possibility to specify settings + catching touch events and then I'll give you the final sources. I observed some problems: a crash after pressing "Set wallpaper" and also animation stopped on the lock screen. These errors are occasional. My older ZTE mobile has crashed after 1/2 hour of running the ZGE wallpaper, but I did several "dirty" things there, so I'm not sure whether the walpaper was the reason for crashing. We need more experiments and fixing...

To produce your wallpapers, you can use the previously sent ZgeWallpaperService.java. Just copy res\xml\zge.xml, src\org\zgameeditor\ZgeWallpaperService.java, and AndroidManifest.xml to the generated android folder. Modify labels in AndroidManifest.xml to set name of application and wallpaper and remove src\org\zgameeditor\ZgeActivity.java.

Since the current ZGE replaces wallpaper-based AndroidManifest.xml by original activity-based file, for compilation use directly SDK or ADT with imported project. I used Android SDK 4.2.2/API 17; Android SDK 2.2/API 8 thrown an exception and I did not want to check where's the problem.
Attachments
Tried also to add particles - works fine
Tried also to add particles - works fine
scr.jpg (44.94 KiB) Viewed 13433 times
WP.zip
Project file and generated apk
(285.98 KiB) Downloaded 480 times
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Another update with touch events enabled on live wallpaper.
Attachments
WP.zip
Application, ZGE project and updated ZgeWallpaperService.java
(289.02 KiB) Downloaded 503 times
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Excellent work Rado1! Works perfect here. This provides a whole new use for ZGE on Android. Jph, are you reading this? I'm sure you have some wallpaper ideas too :)
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Thanks Ville. I hope you can integrate this feature to ZGE soon. Integrated compilation is much more comfortable than compiling with ADT or manually from command line.

BTW I run my testing wallpapers on all available Android devices in our family for ca. one day without problems. I'm going to create some new (demo) wallpapers.
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

Hi guys, yup I am stalking around still,. My android build setup got messed up when my system drive got zapped in a thunderstorm,. I have yet to re-setup all that,. been working just on PC stuff since then. I will get back to Android dev. eventually,. the wallpaper stuff could be fun indeed,. thanks for sharing all that work!

I am also just trying to keep up with all the new features and changes,. some simple examples showing how to use some of the newly possible stuff could be helpful, for new folks.

a couple of basic setups for various styles of projects,. perhaps. Showing good practices for simple tasks most games need. I would try however my practices are often less than good., ;)
iterationGAMES.com
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

As next step of experiments with Android live wallpapers was to use GLES 2.0. Unfortunately there are some problems with usage of the current ZGE due to strange lifecycle of Android wallpapers. Here's the story:

When running in preview mode the first time, the wallpaper works fine. However, when trying to set it as a wallpaper, it crashes. Android tries to create a new instance of ZGE; logcat tells "I/ZgeAndroid(10902): SurfaceCreated: OpenGL ES-CM 1.1". This is basically wrong, because GLES 2.0 surface should be created instead. Naturally, this error is followed by many errors "E/libEGL(10902): called unimplemented OpenGL ES API".

When the process of wallpaper running in preview is killed manually (I did it from ADT/DDMS console), the ZGE wallpaper starts working in normal mode (see the 1st screenshot). But when user tries to see preview again, the same errors as mentioned above occur.

There's a suspicion that when ZGE is running in ES2/GL3 mode, it cannot be instantiated more than one time. Wallpapers require 2 overlapping instances; one for preview and another one for normal running.

Ville, can it be fixed?

Another problem I observed with GLES shaders is that after some time they become slow and are not rendered properly; kind of pixelation (incorrect arithmetic) occurres - see the 2nd screenshot. Pixelation and slowing down increases with time. The same problem appears if GLES 2 shaders are used in normal Android application. I tried several GLES shaders from this site with ZGE running on Android and all behaved as described here.
Attachments
screenshot of running the wallpaper after several minutes
screenshot of running the wallpaper after several minutes
scr2.jpg (83.93 KiB) Viewed 13308 times
screenshot of wallpaper immediately after starting
screenshot of wallpaper immediately after starting
scr.jpg (70.19 KiB) Viewed 13308 times
Shader1.zip
.apk and .zgeproj files
(255.26 KiB) Downloaded 475 times
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Hi Rado1,

Try changing the java-code like this:

Code: Select all

        if(!Zge.hasInited) {

...

           Zge.hasInited=true;
        }
        if(NativeGetGLBase()==1) {  // <<<--- This IF section moved outside block above
            Log.i("ZgeAndroid", "GLES 2");
            setEGLContextClientVersion(2);
        }
About the low resolution in shaders I have no idea. Could it be something that the device itself do to preserve power? Check your Android power settings.
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Hi Ville,

the fix works great. GLSL shaders are working fine on newer devices. A nice feature is that they have low CPU footprint comparing to conventional live wallpapers.
VilleK wrote:About the low resolution in shaders I have no idea. Could it be something that the device itself do to preserve power? Check your Android power settings.
I'll have a look at this problem closer. It can relate to power management on Nexus 7 (?). BTW on a less powerful device (ZTE Blade 2) I did not observe this problem.
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Finally, I found the problem of "pixelation" of GLES 2.0 shaders on Nexus 7. There is some problem with precision of FP values for larger numbers passed as uniforms. In my case the shader used a reference to App.Time which worked for smaller numbers, but not for larger numbers coming to the shader after ca. 1 minute of working.

As a workaround, the time-sensitive uniform shader variable used a reference to an "artificial" variable Time which contained just values from the animation period.

Code: Select all

Time += App.DeltaTime;
if(Time >= Period) Time -= Period;
This seems to be strange that Nexus 7 is so "imprecise" and older devices work correctly.
User avatar
jonaspm
Posts: 89
Joined: Fri Jul 06, 2012 3:51 pm
Contact:

Post by jonaspm »

hi guys, long time! :D

Sorry for changing the topic but... VilleK, ¿Did you find a way to support OUYA system out-of-the-box?

BTW, i don't know if it it is possible, but how about ally with Ecere SDK?
www.ecere.com

maybe something big could happen :D i don't know, something like improving ZGE in many aspects
¿Is it possible in any way?

thanks in advance, hope you are doing well :)
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Quick update today with an option to set the font size in code editors.

To set font size open ZGameEditor.ini file in a text editor. Then add a "CodeEditorFontSize" line somewhere under the "Designer" section.

For example:

Code: Select all

[Designer]
CodeEditorFontSize=16
Then start ZGameEditor.

http://www.zgameeditor.org/files/ZGameEditor_beta.zip
Post Reply