android-cmake is a great solution to build existing libraries, e.g. libpng, for android. In my linux, it works flawlessly. I compiled assimp, libpng, libz, and bullet so far. And then, I can add them to my project in the android.mk, which I attached it to the end.
android-cmake works out-of-box in Linux. In window, there is no softlink, make install will fail. I just copy those target files, such as *.so, *.a, and bin files, to the build folder, and then make install works.
"Could not find any working toolchain in the NDK. Probably your Android NDK is broken" drove me to nut. I got this problem on one PC, but another one works perfectly. I finally found out, android-cmake works only with cmake 2.8.12.2. I updated the old one. Everything works now.
In order to link your prebuilt libs, you have to define your own
LOCAL_MODULE
and put them in the LOCAL_STATIC_LIBRARIES list
android.mk
LOCAL_PATH := $(call my-dir)
#assimp
include $(CLEAR_VARS)
LOCAL_MODULE := assimp
LOCAL_SRC_FILES := $(ANDROID_TOOLCHAIN)/lib/libassimp.a
LOCAL_EXPORT_C_INCLUDES := $(ANDROID_TOOLCHAIN)/include/assimp
include $(PREBUILT_STATIC_LIBRARY)
#libpng
include $(CLEAR_VARS)
LOCAL_MODULE := libpng
LOCAL_SRC_FILES := $(ANDROID_TOOLCHAIN)/lib/libpng.a
LOCAL_EXPORT_C_INCLUDES := $(ANDROID_TOOLCHAIN)/include/
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := game
LOCAL_C_INCLUDES += $(ANDROID_TOOLCHAIN)/include/eigen3/
LOCAL_SRC_FILES := ../../common/game.cpp jni.cpp assets_file_io.cpp
LOCAL_STATIC_LIBRARIES := assimp libpng
LOCAL_LDLIBS := -lz -lstdc++ -llog -lGLESv2 -lEGL -landroid
include $(BUILD_SHARED_LIBRARY)
Friday, January 10, 2014
Saturday, January 4, 2014
Multi-Player games notes
It is NOT well organized and NO game is made yet.
I just wanna keep a note about my thoughts about a pipeline for creating a multiplayer game. It is not specific to a single game but more a frame work or work flow. I hate reinventing the wheel so I prefer choosing existing tools.
I focus on the pure game itself so far. The external elements, such as log in UI or database, are not discussed here. I wanna describe my demands with keywords. Working along, low budget or no budget, indie, multi-player, real-time, and cross-platforms.
I would like to have these steps: graphic modeling, logic, and network.
I am using blender and 3ds max for modeling. I used blender at the beginning. It is free, and incredible powerful. It is perfect for all my modeling tasks. When I found out I can get 3ds max and all the related Autodesk software for free as a student, I gave it a try as it is a kind of industry standard and a lot of models online are in max format. And, it should be better somewhere and have better compatibility with other software as it is sold thousands of dollars. However I found out, so far, it is a little better. I still need some work to import max models into unity 3d. On current stage, I would stay on blender for a while, because I am more familiar with it now. Probably I will move to 3ds max.
There are also plenty of game engines, such as blender, unity 3d, unreal,cocos-2dx, and panda 3d. I am using all of those above. unity 3d and unreal is the best in terms of performance, cross-platforms and network support.If you just need a offline game, they are the best to go. blender is good for tiny prototypes on pc. It is still powerful and easy to use, at least to myself. However, I have never seen any serious games out of it, except some demos. For cocos-2dx or panda 3d, there is no GUI, generally speaking. You need to implement your world from sketch.
Networking is kind of new to gaming, as I have not find any game engine has network embedded for dummy users. In other words, you need to program anyway if you need online games. I am not sure if unity or unreal handles server-client either. As on the server side, you probably do not need any rendering but just logic.
To conclude so far. Offline games, go unity 3D or unreal. Online games, any one is ok, and implement your own server.
I just wanna keep a note about my thoughts about a pipeline for creating a multiplayer game. It is not specific to a single game but more a frame work or work flow. I hate reinventing the wheel so I prefer choosing existing tools.
I focus on the pure game itself so far. The external elements, such as log in UI or database, are not discussed here. I wanna describe my demands with keywords. Working along, low budget or no budget, indie, multi-player, real-time, and cross-platforms.
I would like to have these steps: graphic modeling, logic, and network.
I am using blender and 3ds max for modeling. I used blender at the beginning. It is free, and incredible powerful. It is perfect for all my modeling tasks. When I found out I can get 3ds max and all the related Autodesk software for free as a student, I gave it a try as it is a kind of industry standard and a lot of models online are in max format. And, it should be better somewhere and have better compatibility with other software as it is sold thousands of dollars. However I found out, so far, it is a little better. I still need some work to import max models into unity 3d. On current stage, I would stay on blender for a while, because I am more familiar with it now. Probably I will move to 3ds max.
There are also plenty of game engines, such as blender, unity 3d, unreal,cocos-2dx, and panda 3d. I am using all of those above. unity 3d and unreal is the best in terms of performance, cross-platforms and network support.If you just need a offline game, they are the best to go. blender is good for tiny prototypes on pc. It is still powerful and easy to use, at least to myself. However, I have never seen any serious games out of it, except some demos. For cocos-2dx or panda 3d, there is no GUI, generally speaking. You need to implement your world from sketch.
Networking is kind of new to gaming, as I have not find any game engine has network embedded for dummy users. In other words, you need to program anyway if you need online games. I am not sure if unity or unreal handles server-client either. As on the server side, you probably do not need any rendering but just logic.
To conclude so far. Offline games, go unity 3D or unreal. Online games, any one is ok, and implement your own server.
Wednesday, January 1, 2014
windows/linux/osx,intel/amd,desktop/laptop/pad
I am interested in different platforms. Thus, I spent a day on googleing related information. In order not to waste such time, I decide to write these down.
windows/linux/osx
windows is best optimized on the same hardwares.
I can finish all the same tasks on those OS. They are transparent in terms of software to me. So I am more interesting hardware optimizations, especially on graphics. I thought osx has some magic on optimizations so that they can be overpriced. But, I can not find any evidence to support my hypothesis. In stead, main stream games are optimized for windows at the first place. Although osx versions may catch up years later, they will not do better. Based on my own experience, my windows works smoother than my linux on the same laptop. Even on science computation, windows versions are a little faster, at least no worse. So far, I would say, windows are optimized best, based on the hardwares(based on hackintosh or the same level mac).
intel/amd
amd is never a good solution on desktops, for price, power consuming, or performance. Maybe it is good for laptop in terms of price.
I have no amd chips to test, so all the following comparisons are from google. Cpu of amd seems really sucks nowadays.A saying is that, A10 can only reach i3 for daily use. GPU is better, maybe A10 can match 630. As a result, A10 ($130 bundle) seems a better solution than i3 ($180 bundle) + 630. However, i3+630 level is not for gamers. I would like go i5/i7($250 bundle) + 650ti ($130) at least. A10 can crossfire with 6xxx cards. Higher level cards work better standalone. Also A10 is said to consume more power.
For laptops, the story is a little difference.If you focus on battery life, go macbooks. Nothing can bit them so far. If you pursuit performance, you will get a big box, as heavy as a desktop, with twice of its prices. Neither of them is my target. I am think about a cheap laptop which can handle basic games like WoW. CPU is never my bottle neck. core 2 duo can handle such games without any problems.We assume A10 = i3 + 630m in laptops. A laptop with 630m or above will cost $700 usually and will not consume any less power. A10 ones might cost $400. Also, the coming Kaveri A10 will have unified memory for GPU and CPU, which will benefit GPU computing. If you have a tight budget, A10 laptop may be good choice.
desktop/laptop/pad
powerful desktop + light laptop/pad
Desktops are much powerful than laptops. It is proved by data and my feeling. You will pay a lot to make the performance of a laptop to match that of a desktop. Even if you match the performance, you probably get a large, heavy, and hot laptop, and you need pay more to improve the mobility. My ideal solution is, getting a powerful desktop (if I really need one), and carrying a very light laptop, like yoga2 or air, or even a pad with bluetooth keyboard.
windows/linux/osx
windows is best optimized on the same hardwares.
I can finish all the same tasks on those OS. They are transparent in terms of software to me. So I am more interesting hardware optimizations, especially on graphics. I thought osx has some magic on optimizations so that they can be overpriced. But, I can not find any evidence to support my hypothesis. In stead, main stream games are optimized for windows at the first place. Although osx versions may catch up years later, they will not do better. Based on my own experience, my windows works smoother than my linux on the same laptop. Even on science computation, windows versions are a little faster, at least no worse. So far, I would say, windows are optimized best, based on the hardwares(based on hackintosh or the same level mac).
intel/amd
amd is never a good solution on desktops, for price, power consuming, or performance. Maybe it is good for laptop in terms of price.
I have no amd chips to test, so all the following comparisons are from google. Cpu of amd seems really sucks nowadays.A saying is that, A10 can only reach i3 for daily use. GPU is better, maybe A10 can match 630. As a result, A10 ($130 bundle) seems a better solution than i3 ($180 bundle) + 630. However, i3+630 level is not for gamers. I would like go i5/i7($250 bundle) + 650ti ($130) at least. A10 can crossfire with 6xxx cards. Higher level cards work better standalone. Also A10 is said to consume more power.
For laptops, the story is a little difference.If you focus on battery life, go macbooks. Nothing can bit them so far. If you pursuit performance, you will get a big box, as heavy as a desktop, with twice of its prices. Neither of them is my target. I am think about a cheap laptop which can handle basic games like WoW. CPU is never my bottle neck. core 2 duo can handle such games without any problems.We assume A10 = i3 + 630m in laptops. A laptop with 630m or above will cost $700 usually and will not consume any less power. A10 ones might cost $400. Also, the coming Kaveri A10 will have unified memory for GPU and CPU, which will benefit GPU computing. If you have a tight budget, A10 laptop may be good choice.
desktop/laptop/pad
powerful desktop + light laptop/pad
Desktops are much powerful than laptops. It is proved by data and my feeling. You will pay a lot to make the performance of a laptop to match that of a desktop. Even if you match the performance, you probably get a large, heavy, and hot laptop, and you need pay more to improve the mobility. My ideal solution is, getting a powerful desktop (if I really need one), and carrying a very light laptop, like yoga2 or air, or even a pad with bluetooth keyboard.
Friday, December 20, 2013
eclipse ndk resolve problem
eclipse seem not to resolve includes automatically. I just add those path manually. If adding them does not work, you can remove all the .* configures and import the clean project and add native code again. At least it works for me.
jni
/usr/lib/jvm/java-7-openjdk/include/
clang(I use clang, you can replace it with gcc 4.8)
/opt/android-ndk/toolchains/llvm-3.3/prebuilt/linux-x86_64/lib/clang/3.3/include/
libc++(I use libc++, you can replace it with gnustl)
/opt/android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/
platform specific includes (such as GLES2)
/opt/android-ndk/platforms/android-19/arch-arm/usr/include/
extra includes(such as eigen3 or boost)
/path/to/your/include
Here is my include path config export
includes.xml
<?xml version="1.0" encoding="UTF-8"?>
<cdtprojectproperties>
<section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.IncludePaths">
<language name="c,cpp">
<includepath>/usr/lib/jvm/java-7-openjdk/include/</includepath>
<includepath>/opt/android-ndk/toolchains/llvm-3.3/prebuilt/linux-x86_64/lib/clang/3.3/include/</includepath>
<includepath>/opt/android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/</includepath>
<includepath>/opt/android-ndk/platforms/android-19/arch-arm/usr/include/</includepath>
<includepath>/home/jesse/local/android_toolchain/include</includepath>
</language>
</section>
<section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.Macros">
<language name="c,cpp">
</language>
</section>
</cdtprojectproperties>
jni
/usr/lib/jvm/java-7-openjdk/include/
clang(I use clang, you can replace it with gcc 4.8)
/opt/android-ndk/toolchains/llvm-3.3/prebuilt/linux-x86_64/lib/clang/3.3/include/
libc++(I use libc++, you can replace it with gnustl)
/opt/android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/
platform specific includes (such as GLES2)
/opt/android-ndk/platforms/android-19/arch-arm/usr/include/
extra includes(such as eigen3 or boost)
/path/to/your/include
Here is my include path config export
includes.xml
<?xml version="1.0" encoding="UTF-8"?>
<cdtprojectproperties>
<section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.IncludePaths">
<language name="c,cpp">
<includepath>/usr/lib/jvm/java-7-openjdk/include/</includepath>
<includepath>/opt/android-ndk/toolchains/llvm-3.3/prebuilt/linux-x86_64/lib/clang/3.3/include/</includepath>
<includepath>/opt/android-ndk/sources/cxx-stl/llvm-libc++/libcxx/include/</includepath>
<includepath>/opt/android-ndk/platforms/android-19/arch-arm/usr/include/</includepath>
<includepath>/home/jesse/local/android_toolchain/include</includepath>
</language>
</section>
<section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.Macros">
<language name="c,cpp">
</language>
</section>
</cdtprojectproperties>
Friday, December 13, 2013
qt 5.2 opengl
It is quite frustrating. I can never get hellogl_el2 running with qt 5.2. openglunderqml works though.
I thought it might have sth to do with my old tegra tablet. I added -mtune=cortex-a9 -march=armv7-a -mhard-float -mfloat-abi=softfp -mfpu=vfpv3-d16 to qt building. I tested within eclipse. These parameters worked. And qt building seemed to take those. However, I still had no luck with hello_es2 demo. Maybe I have to stay on 5.1.1.
I thought it might have sth to do with my old tegra tablet. I added -mtune=cortex-a9 -march=armv7-a -mhard-float -mfloat-abi=softfp -mfpu=vfpv3-d16 to qt building. I tested within eclipse. These parameters worked. And qt building seemed to take those. However, I still had no luck with hello_es2 demo. Maybe I have to stay on 5.1.1.
Thursday, December 12, 2013
qt 5.2 SIGILL old devices
Qt 5.1 works for me out of box, but 5.2 does not. I always got SIGILL error on my doom. I googled and got only one piece of information. It is kind of neon related. Neon is some optimization features on latest devices. I disabled it with --no-neon and recompiled. Everything works fine again. Cheers!
Wednesday, December 11, 2013
qt 5.1.1, android, and tricks
Update, qt 5.2 works fine with build-tools r19. Tested with prebuilt qt, both on win8.1 and archlinux. Some old demos do not run. Bad news is the qt 5.2 I compiled from source did not work.
I finally got hellogl_es2 demo to run, after 3 days trying. So far it works on my archlinux. I guess I can make it work on win8.1.
Qt is not that ready for android in my option, at least 5.1. I am not sure about the coming 5.2. There are too many tricks. You need to get right versions of jdk, jre, apache-ant, android-sdk, android-ndk, and so on.
I try to list my settings as detailed as possible.
archlinux 64bit rolling updated.
offical package:
extra/jdk7-openjdk 7.u45_2.4.3-1
extra/jre7-openjdk 7.u45_2.4.3-1
extra/apache-ant 1.9.2-3
aur package:
android-armv7a-eabi-system-image-15 4.0.4_r02-2
android-armv7a-eabi-system-image-19 4.4_r01-1
android-ndk r9b-3
android-platform-10 2.3.3_r02-2
android-platform-11 3.0_r02-2
android-platform-15 4.0.4_r03-1
android-platform-16 4.1.2_r04-1
android-sdk r22.3-1
android-sdk-platform-tools r19-1
android-udev 67-1
(archlinux split sdk into small package, you can also install and manage them through the android-sdk interface)
custom package:
android-qt5 5.1.1-1(I compile qt 5.1.1 for android from source)
android-sdk-build-tools-18.0.1 r18.1.1-1(critical part, latest r19 is not supported by QT5.1. You will have build.xml error with r19)
win 8.1
Make jdk, jre, apache-ant, android-sdk, and ndk up to date.
In the android package managing interface, remove build-tools r19, install r18.1.1.
Double check your system environment variables, ANT_HOME and JAVA_HOME.
If ant works, qt for android should work out of box via qt-creator.
I finally got hellogl_es2 demo to run, after 3 days trying. So far it works on my archlinux. I guess I can make it work on win8.1.
Qt is not that ready for android in my option, at least 5.1. I am not sure about the coming 5.2. There are too many tricks. You need to get right versions of jdk, jre, apache-ant, android-sdk, android-ndk, and so on.
I try to list my settings as detailed as possible.
archlinux 64bit rolling updated.
offical package:
extra/jdk7-openjdk 7.u45_2.4.3-1
extra/jre7-openjdk 7.u45_2.4.3-1
extra/apache-ant 1.9.2-3
aur package:
android-armv7a-eabi-system-image-15 4.0.4_r02-2
android-armv7a-eabi-system-image-19 4.4_r01-1
android-ndk r9b-3
android-platform-10 2.3.3_r02-2
android-platform-11 3.0_r02-2
android-platform-15 4.0.4_r03-1
android-platform-16 4.1.2_r04-1
android-sdk r22.3-1
android-sdk-platform-tools r19-1
android-udev 67-1
(archlinux split sdk into small package, you can also install and manage them through the android-sdk interface)
custom package:
android-qt5 5.1.1-1(I compile qt 5.1.1 for android from source)
android-sdk-build-tools-18.0.1 r18.1.1-1(critical part, latest r19 is not supported by QT5.1. You will have build.xml error with r19)
win 8.1
Make jdk, jre, apache-ant, android-sdk, and ndk up to date.
In the android package managing interface, remove build-tools r19, install r18.1.1.
Double check your system environment variables, ANT_HOME and JAVA_HOME.
If ant works, qt for android should work out of box via qt-creator.
Subscribe to:
Posts (Atom)