3.0.0 beta (ZGE on Android)
Moderator: Moderators
I tested it again and observed that noise* functions return 0 just for very large numbers used as parameters. For smaller/normal numbers the functions work fine.
I used getSystemTime() as initial value and added ZApplication.Time to get the dynamics. But getSystemTime() on Android returns x*10^9 numbers.
So it is probably matter of FP arithmetic which is probably better on PCs than on ARM processors. Therefore, this is not probably a bug, do no fix anything. I fixed my application. BTW good to know also such limitations.
I used getSystemTime() as initial value and added ZApplication.Time to get the dynamics. But getSystemTime() on Android returns x*10^9 numbers.
So it is probably matter of FP arithmetic which is probably better on PCs than on ARM processors. Therefore, this is not probably a bug, do no fix anything. I fixed my application. BTW good to know also such limitations.
Ville, the current libzgeandroid.so is built for armeabi ABI, right? I'm asking because I tested ZGEBullet on Nexus 7 and armeabi does not perform well, even on such a relatively good hardware. A version compiled for armeabi-v7a is as fast as on my Windows notebook, really nice, constant 60 FPS. I used an old ZGE version of ZGE we used to test performance of ZGEBullet some time ago. I think you compiled it for armeabi-v7a.
Therefore, to allow some serious physical or computation-intensive applications, ZGE should support also armeabi-v7a. I think to have optimal performance, not only libZGEBullet.so should be compiled for armeabi-v7a, but also libzgeandroid.so, right?
If so, ZGE should have an option (for instance in Settings/Android tab) to allow selection of the target ABI. Android NDK r8 supports just armeabi and armeabi-v7a.
Therefore, to allow some serious physical or computation-intensive applications, ZGE should support also armeabi-v7a. I think to have optimal performance, not only libZGEBullet.so should be compiled for armeabi-v7a, but also libzgeandroid.so, right?
If so, ZGE should have an option (for instance in Settings/Android tab) to allow selection of the target ABI. Android NDK r8 supports just armeabi and armeabi-v7a.
As I understand it the ABI is a specification for how functions and libraries call each other (parameter passing etc), not the actual instructions used.
ZGE is built for armabi for best compatibility but with the VFPv2 floating point extension which means it make use of hardware floating point support.
Hardware floating point is what matters most for performance.
I can't find any option in the version of Freepascal I'm using to generate armeabi-v7a binaries, so I'm not sure what I did when I built that special version for you. Do you remember from which forum thread you downloaded it? And are you sure the current ZGE beta + ZGEbullet (built for armeabi-v7a) gives poorer performance (or don't work at all) than the version of ZGE you tested with?
ZGE is built for armabi for best compatibility but with the VFPv2 floating point extension which means it make use of hardware floating point support.
Hardware floating point is what matters most for performance.
I can't find any option in the version of Freepascal I'm using to generate armeabi-v7a binaries, so I'm not sure what I did when I built that special version for you. Do you remember from which forum thread you downloaded it? And are you sure the current ZGE beta + ZGEbullet (built for armeabi-v7a) gives poorer performance (or don't work at all) than the version of ZGE you tested with?
Hi,
NDK documentation says: ABI influences the CPU instruction set, the endianness of memory stores and loads at runtime, the format of executable binaries, various conventions used to pass data between code and the system, alignment and size constraints for enum types, structure fields and arrays, and the list of function symbols available to machine code. armeabi-v7a enables to use VFP hardware FPU instructions (VFPv3-D16).
Anyway, I tested just to use libZGEBullet.so built for armeabi-v7a with the current libzgeandroid.so and its performance is good. Therefore, I'm going to use this setup for my upcoming projects; if there occur some issues, I'll discuss them case by case. But for now, ZGE does not need to have any special option for selecting ABI, unless you want device-specific optimizations, but this is not probably the goal for now.
NDK documentation says: ABI influences the CPU instruction set, the endianness of memory stores and loads at runtime, the format of executable binaries, various conventions used to pass data between code and the system, alignment and size constraints for enum types, structure fields and arrays, and the list of function symbols available to machine code. armeabi-v7a enables to use VFP hardware FPU instructions (VFPv3-D16).
This would be sufficient for performance and seems to be ideal for compatibility. You are probably using -mfpu=vfpv2 option...VilleK wrote:ZGE is built for armabi for best compatibility but with the VFPv2 floating point extension which means it make use of hardware floating point support.
Unfortunately, I do not remember from which forum I downloaded that version. It can also happen that you just started to use support for VFPv2 (?).VilleK wrote:Do you remember from which forum thread you downloaded it?
Anyway, I tested just to use libZGEBullet.so built for armeabi-v7a with the current libzgeandroid.so and its performance is good. Therefore, I'm going to use this setup for my upcoming projects; if there occur some issues, I'll discuss them case by case. But for now, ZGE does not need to have any special option for selecting ABI, unless you want device-specific optimizations, but this is not probably the goal for now.
Updated today, the above should be fixed.Rado1 wrote:Hi, I observed that switching ZApplication.ShowOpsionsDialog on causes crashing of Android application. Would it be possible to ignore this setting for generated apk?
Also: Added type "byte" for DefineArray to make it easier to work with binary files that are read using the File-component.
And a new function "setBinaryProp" that allows you to set the content of a binary property with the content of a byte array. See attached project for a demo that uses this new functionality to load and display a jpeg file. Note that the loaded jpeg must have the same width/height as the one you replace (in the project it is 512x512) so it is not a general solution.
Updated beta: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
- Attachments
-
- loadjpeg_demo.zip
- the demo displays an embedded bitmap, when you press space it replaces this bitmap with another that is loaded from file
- (226.85 KiB) Downloaded 697 times
Ville, this is really nice feature. I'll use it for dynamically loaded textures to levels defined in files. Would it be possible to load also meshes if format of the loaded file corresponds to the internal storage of meshes in ZGE?VilleK wrote:And a new function "setBinaryProp" that allows you to set the content of a binary property with the content of a byte array.
Another question: would it be possible to have functions for handling on key events? I would like to use e.g. back or menu keys.
I've now added a getBinaryProp function too so you can get the content of a binary property, modify it, and then set it again. Attached is a project that modifies an uncompressed bitmap.
Yes it can be used for all binary properties, including meshes. Although the mesh binary format is designed to be compact and not easy to use![Wink ;)](./images/smilies/icon_wink.gif)
Android back and menu keys is on my todo list. I would like the back button to behave like Escape in Windows so you can use the EscapeToQuit property and quit() functions instead if you want your own control. It requires me to write some Java code though so I haven't got around to it yet. Remind me if it doesn't appear.
Updated beta: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
Yes it can be used for all binary properties, including meshes. Although the mesh binary format is designed to be compact and not easy to use
![Wink ;)](./images/smilies/icon_wink.gif)
Android back and menu keys is on my todo list. I would like the back button to behave like Escape in Windows so you can use the EscapeToQuit property and quit() functions instead if you want your own control. It requires me to write some Java code though so I haven't got around to it yet. Remind me if it doesn't appear.
Updated beta: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
- Attachments
-
- GetSetBinaryProp.zgeproj
- (73.45 KiB) Downloaded 706 times
This is really great! As an experiment, I wanted to save an array with internal representation of a mesh into a file and then loaded this file into another ZGE project. My intention is to allow fast and simple dynamic loading of meshes to ZGE applications (my loader of obj files is quite slow). A simple ZGE project allowing to load 3ds mesh and to save it in binary form would treat the purpose of mesh file converter. The problem is that File component does not allow to save bytes, just floats. Therefore each byte of the mesh is followed by three additional zero bytes in the generated file. Here, I would really appreciate if the (binary) File component would allow to save bytes directly. (Maybe also strings, floats, and integers in their memory representation.) See the attached ZGE projects to see what I wanted to achieve.VilleK wrote:I've now added a getBinaryProp function too so you can get the content of a binary property, modify it, and then set it again.
- Attachments
-
- ResourceSaver.zgeproj
- Generator of resource (mesh) files.
- (9.75 KiB) Downloaded 686 times
-
- ResourceLoader.zgeproj
- Loader of resource (mesh) files.
- (989 Bytes) Downloaded 676 times
Rado1: I've changed so that File.TargetArray also works when writing to files. I modified your test project to use this feature and now it works.
airpas: This is fixed now, get the latest sources and try again.
Updated beta: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
airpas: This is fixed now, get the latest sources and try again.
Updated beta: http://www.zgameeditor.org/files/ZGameEditor_beta.zip
- Attachments
-
- mesh_loading.zip
- Rado1's modified example of save/load meshes
- (10.45 KiB) Downloaded 692 times