Setting up Cocos2d-x 3.0beta2 for Android on Windows and Ant build

Objectives

  • Install everything needed to build and run Cocos2d-X 3.x beta samples on an Android 4.3 device
  • Uses only the command line, (NOT using eclipse at all).

Prerequisites

  • Some game programming knowledge
  • Windows 7 PC
  • Android device with Android 4.3 (if not, either use the emulator or download the necessary SDKs and modify the tutorial as necessary)

Download

Note: Python 3.x is not supported by the python script files in Cocos2d-x 3.x (at the time of writing)

Installation

  • Extract Android SDK bundle to somewhere (without spaces in the path), e.g. D:\
  • Extract or install the rest of the downloads into the Android SDK folder, e.g. D:\AndroidDevelopmentKit, so it should now contain these:
  • In a text editor, create the following setup_cocos_env.bat, and save it into D:\AndroidDevelopmentKit
set NDK_ROOT=D:\AndroidDevelopmentKit\android-ndk-r9c\
set path=D:\AndroidDevelopmentKit\Portable_Python_2.7.5.1\App;D:\AndroidDevelopmentKit\Java\jdk1.7.0_45\jre\bin;D:\AndroidDevelopmentKit\apache-ant-1.9.3\bin;D:\AndroidDevelopmentKit\sdk\tools;D:\AndroidDevelopmentKit\sdk\platform-tools;%path%
set JAVA_HOME=D:\AndroidDevelopmentKit\jdk1.7.0_45
cd cocos2d-x-3.0beta2
cmd
  • This sets up the various paths necessary for building the Cocos2d-X samples.
  • Building and installing the samples
  • Double-click on this batch file. It will open a command prompt in the Cocos2d-X folder.
  • Run the following commands to see if the paths are set up correctly (simply type those commands in without additional parameters, and without changing directory)
    • android
    • adb
    • ant
    • python
  • If any of these fail, check your paths
  • If ok, go on to build the samples
cd build
python android-build.py all (This will take a while)
  • Go to build the java files needed for creating the apks.
cd cocos\2d\platform\android\java
android update project -p . -t android-18 (assuming you have a device with Android 4.3)
ant debug
ant release (so that we won’t need to do it again)
  • Go to every project folder and do the following (using HelloCpp as example):
cd ..\..\..\..\..\samples\Cpp\HelloCpp\proj.android
android update project -p . -t android-18
ant debug install
  • It will be installed on your device.
  • Run the samples!

Eclipse Notes

  • I’ve not covered how to set it up with Eclipse because that wasn’t my focus.
  • I’ve quickly tried, and it doesn’t package the apk with the libs, but didn’t investigate further. Another time perhaps. 🙂

Takeaways from GDC Taipei Summit 2013

I was at Game Developers Conference (GDC) Taipei Summit 2013 recently and made some notes from attending various lectures and meetings there. Maybe it would be interesting to some other people as well, so I thought I’d write them down here. Its more focused on the regional gaming situation then technical topics.

Feel free to drop in the comments anything I might have left out, or you might be interested to know.

Taiwan

  1. Taiwan has a population of 23 million, half of which play games.
  2. Most popular type of games are RPG/MMORPG and card battle games.
  3. Mobile devices: iOS 25%, Android 45%. Android monetise better than iOS as well, and publishers will ask for Android version of mobile games.
  4. One publisher mentioned that for RPGs, their main customers are working males, and there’s always a revenue spike for their in-app purchases on payday.

Hong Kong & Taiwan

  1. One speaker mentioned that games made for Taiwanese audiences will work just as well for Hong Kong audiences.
  2. Facebook games are popular in both Taiwan and Hong Kong, unlike China, where its unavailable.
  3. Mainland Chinese game publishers are increasingly interested in expanding into Taiwan and Hong Kong, both by bringing mainland chinese games over and vice versa. Some are also interested in partnering with companies in this region for development and publishing. The reverse is also true, that developers and publishers from this regions are also interested in expanding into mainland China.

China

  1. Biggest publisher in China is Tencent, due to its massive userbase from its QQ messenger. They publish games for all platforms, and provide many services for developers, such as QQ cloud.
  2. Tencent is so dominant such that there is a saying: there’re 2 universe in China, one with Tencent, and one without.
  3. China Mobile Games and Entertainment Group (CMGE) is the next largest mobile game publisher. But according to them, there are at least 3 Tencent games that each have more revenue than their total revenue combined.
  4. There’s no Android Google Play store in China, but numerous other Android stores.
  5. Most popular games in China are also RPG/MMORPG. Some publishers also bring in Western games with some successes, e.g. Angry Birds or Fruit Ninja. Games based on the Chinese classical stories of Three Kingdom and Journey to the West are oversaturated, but there is still lots of interest in games based on them.

Messaging Apps

  1. From what I heard, and what I observed on people’s phone, the most popular instant messaging apps by countries are
  2. China: WeChat (Note the dominance of Tencent yet again)
  3. Taiwan: Line and KakaoTalk
  4. Hong Kong: Whatsapp
  5. This would be relevant to developers trying to target games on these platforms

Game Engines

  1. Cocos2D-x is a widely used game engine in the region, funded by Chukong Technologies. However, 2 speakers (Ying Shuling of CMGE and Ralph Barbagallo of FLARB LLC) are of the opinion that Unity is the way forward.

Falling Bricks plugin for Notepad++

Summary

This plugin for Notepad++ is a simple tetris-like game that you can play from within Notepad++. This game is simply ported over from my minitetris game.

Rules

The rules are exactly the same, so I hope no explanation is needed 😛

Notes

  1. This is the most bare-basic implementation of tetris, so don’t expect any fancy 3D graphics or surround sound effects.
  2. If you close the dialog box of this plugin (maybe your boss just appeared?), the game will auto pause, and you can resume from where you last left it.
  3. Your high scores are not remembered, So please scribble it into Notepad++ yourself!