Holiday Bugfix Release - Chaotic Rage 1.5
A quick release foc Chaotic Rage while away on holidays/vacation. I've never uploaded a 40-something installer using phone thethering before!
This release is mostly bug fixes because I haven't had heaps of time. There were a few launch bugs (i.e. crashes at launch) for Intel graphics, and I think there was a DLL error which affected almost all Windows users. That one has been fixed. A lot of little annoying network bugs have been fixed too.
I'm taking a couple of weeks off before development continues, so the next cycle might be a bit longer and/or not contain much.
Also, I don't have an Android development environment on this laptop at the moment, so I don't have an Android build. I did fix some Android bugs, but you'll have to wait for them, sorry about that.
New release - 1.4 is now available
TLDR; new release with Android support.
Wow what a massive release this has been! One of the largest releases in Chaotic Rage history, this release adds Android support! A huge amount of changes were needed to bring this dream to reality, and I only slipped one week to four weeks.
Now I'll have to admit it's a little half-baked at the moment, because I haven't finished started getting the controls working. I need to develop some sort of "virtual" joystick or something.
Nonetheless, it's compiling and running, so that is a good start. It would be great to get some testing on a bunch of different devices. It should run on anything with Gingerbread (2.3.3) or later. It's not in the play store yet, so you'll need to enable "External sources" to be able to run it.
As I already mentioned, the release is large, one of (if not the) largest release ever. 114 commits in the Git repo. The stats are pretty interesting:
1337 files changed, 168787 insertions(+), 138877 deletions(-)
It's pretty funny that LEET files changed...anyway, it's a big release, considering 1.3 was only 157 files changed...
Well there is the obvious inclusion of Android support, but I did some other stuff too.
I had to make everything OpenGL ES compatible, so a lot of the render code got cleaned up.
I migrated the game to SDL 2.0, it was previously running 1.2.
The guichan library (which wasn't getting much upstream support) has been incoporated into the Chaotic Rage source.
I removed the zip file support for mods. Just plain directories now.
I brought the two-file config file loader (libconfuse) into the main source tree too.
I even added command line support for Windows.
Have a play
The actual gameplay hasn't changed much, but if you've got an Android phone or tablet, why not download and have a play?
Things I've learnt with Android development
I've learnt a lot when it comes to Android development, here is a summary:
Using the Android NDK is hard
Seriously. If I wasn't porting an existing game which was already coded in c/c++, I wouldn't bother. Getting compiles working, getting the Java shim working, it's all a lot of work.
You don't only need to get your own code to work - all of the libraries you use and all of their dependencies need to be compiled for Android. To make things harder, not everything compiled out of the box. I needed to code up patches to get things working properly.
Google have repos for common libraries
There are heaps of libraries in the Android source repos (platform/external/*) which are basically upstream libraries patched to work properly on Android, and with a ready-to-go Android.mk file.
After spening ages trying to mash freetype into Android, I discovered they've already done it.
Word of warning though. It appears people (Google employees?) do lots of work on these libs and then only push when a new version of Android comes out. When 4.4 KitKat came out, the freetype repo got a few extra commits, but there was lots of changes in them and they broke my build. I ended up forcing
8afe960 which was the last one which worked properly.
Spend time on good logging
One of the most useful things is a decent logging macro. There is one as a part of Android, but if you're doing cross-platform dev you'll need to wrap that with something. I ended up using a macro which wraps either the Android logger or good-ol printf.
The Android dev tools are really not too bad once you get to know them; adb logcat was a lifesaver.
OpenGL SL != GLES SL
After days of bashing my head against the wall trying to figure out why I was only getting a black screen, I discovered various errors in my shaders.
Only once I had added lots of logging to my shader comple and link stages did I discover that the OpenGL shading language uses a different syntax to the OpenGL ES shading language. They are similar, but the ES SL uses the keywords from GLSL 1.0, even though it has some of the features of GLSL 1.3 and similar.
One of the coolest tools I found was Shdr Editor, an online shader validator and experimental area. It uses WebGL, which is generally OpenGL ES 2.0
Issues with SDL_CreateWindow in SDL 2.0
It's not Android releated - this was just a personal mistake. I thought that if I passed SDL_CreateWindow the SDL_FULLSCREEN flag and a width and height of 0, it would assume the screen size. It doesn't, and it doesn't throw an error or assert either. It just doesn't work.
Well I've still got more Android work to do, so there will probably be more notes going forward. I still need to implement controls so I'll probably learn more about multi-touch and the accelerometer going forward.
So there hasn't been any blog posts for a while, but that doesn't mean Chaotic Rage has died...quite the opposite. As the GitHub commit log will show, there has been a massive amount of work on the game as of late.
In fact, if you look at the git stats (i.e. git diff --shortstat 1.3..HEAD), they're pretty impressive:
1299 files changed, 164545 insertions(+), 135115 deletions(-)
All of this flurry of activity has been the adding of Android support, although I brought in the sources of Guichan and libconfuse as well, which accounts for quite a few of the insertions.
This video is of the emulator, but I've had it successfully run on a Samsung Galaxy S II as well.
I know it might look quaint, but this is actually a huge step forward for the project.
Anyway, expect a new release soon.