I updated the project template used by gdx-setup-ui to generate libgdx projects. Previously you had to disable pngcrush manually, by replacing the binary in the iOS SDK with a shell script. This was necessary as our image loading library couldn’t load crushed PNGs. Xamarin added an option to the build settings of an iOS project to disable pngcrush project wide. This means you do not have to replace the iOS SDK pngcrush binary with a shell script anymore.
A couple of nice updates have arrived in the GWT backend thanks for Noblemaster, Nex and Vincent Bousquet on Github.
New Progress Bar
Previously, when your HTML5 version of your game loaded, you’d see a really ugly black/white/greyish “progress” bar. Programmer art, clearly.
A conspirative group of contributors banded together to fix my faux pas (see this thread). The end result looks way better.
Yay, branding :p You can change the appearance of the loading screen, as described here.
Reflection Support V1
GWT does not support standard Java reflection for various reasons. This posed a problem, as our UI library and other bits and pieces of libgdx like the JSON loader rely on reflection. Here’s the full story. TL;DR: i added reflection to the GWT backend to fix those issues. However, i did not expose this capabilities to users, as it’s one of the biggest hacks in my coding history. Only a small, fixed subset of classes had reflection information generated. If you used the Json class to read in Pojos, you found that that doesn’t work in the GWT backend, at all.
Vincent send us a pull request that now allows you to specify packages and class names for which reflection information should be generated. If you have Java Pojos you want to read from a Json file, you simply have to add their class name or package name to your GWT project’s gwt.xml file, like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <module> ... other elements ... <extend-configuration-property name="gdx.reflect.include" value="org.softmotion.explorers.model" /> <extend-configuration-property name="gdx.reflect.exclude" value="org.softmotion.explorers.model.HexMap" /> </module>
You can specify multiple classes and packages by simply adding another extend-configuration-property element to your GWT file.
Note that this highly experimental, so ymmv.
We began talking about implementing a Reflection utility class that works across all platforms, including HTML5. We’ll add that in the upcoming weeks. It will be a bit more limited than standard Java reflection, but should suffice for almost all needs you have.
Assets are preloaded when your GWT application is loaded. This is necessary to expose a virtual (read-only) file system to your application, so Gdx.files works as expected. The progress bar indicated how many of those assets have been preloaded, but lacked concrete byte-wise information. Vincent added this to the preloading mechanism, in addition to MIME-types.
Along the way he refactored the GWT AssetLoader responsible for preloading the assets. Binary files are now directly read into a typed Int8Array, which should improve performance considerably when working with binary files.
He also added switches that control things like caching and so on. Browser caching is now used by default. Another option is to use base64 encoding, but that’s a bit esoteric and unlikely what you want. See the pull request for more information.
Some pretty big things have dropped at this year’s Google I/O. Here’s a rundown of what i think is relevant to game devs.
The Android development tools team released a new IDE called Android Studio. Android Studio is based on IntelliJ IDEA by JetBrains. While you could previously develop Android Applications with IntelliJ IDEA, Android Studio adds a metric ton of features that make pure Android development a joy (once the IDE is stable).
Among those features are integration of the new Gradle-based Android build system (which still lacks support for native libraries), super awesome Linting (checks your source code for various types of errors the standard Java compiler doesn’t catch, with the help of annotations on most of the Android APIs), Android specific editor features (replaces resources like R.stuff with the actual string representation, shows resource images in the editor margin), and a nice layout editor with drag & drop functionality, as well as previews for different resolutions etc.
If you are interested, you should totally watch the talk “What’s New in Android Development Tools”:
Note that Android Studio is at version 0.1, and hiccups are to be expected. Regardless, the features demonstrated at I/O are really neat, and i can see how this can make developing Android apps a lot better experience.
However, there are also down-sides to this in my opinion. First of all, it is unclear how they plan on supporting both Eclipse and Android Studio, and how the IntelliJ IDEA Android plugin plays into all of this (iirc, that was managed by IDEA/the community so far). I’d speculate that the tools team doesn’t have the man power to maintain all of these things ad infinitum. E.g. will the new Gradle build system get some love in Eclipse as well? My guestimate is that Eclipse development will eventually be handed over to the community, hopefully after the Gradle build system has been added to ADT.
Another downside is that Android Studio can not be used for anything other than Android projects, e.g. Java projects. For libgdx, that’s a bit of a bummer, as our cross-platform project structure does not consist of an Android-only project for obvious reasons. I haven’t looked to hard yet, but there doesn’t appear to be a solution for that. On the other hand, most libgdx apps development wouldn’t benefit much from the new features in Android Studio anyways (apart from the Gradle build). A libgdx app normally doesn’t call into Android APIs itself, and also doesn’t have to manage UI layouts or resources the Android way. If you are still interested in using Anroid Studio with your libgdx app, check out this thread.
Hopefully the IntelliJ IDEA community edition version of the Android plugin will get up to speed with what Android Studio offers. Likewise, i hope that Eclipse isn’t killed entirely as an Android development environment.
Google Play Game Services
As anticipated by many outlets on the web before I/O, Google presented it’s new Game Center like service called Google Play Game Services (quite a mouth full). It allows you to “easily” add achievements, leaderboards, and cloud storage of game state across multiple devices. Users login with their G+ account (sneaky ), and can then share their achievements and scores with friends within their circles. On top of this base social gaming functionality, Google Play Game Services (calling it GPGS from now on), supports setting up peer to peer multiplayer games on Android devices, including nice things like lobby rooms and so on.
The real kicker is that all these services work not only on Android, but also on the Web and on iOS, except for multiplayer which is only supported on Android.
One of my biggest issue with existing social gaming platforms is that you can’t just fetch the data and display it however you want. The GPGS team was smart enough to make it a design principle that you as a developer have full control over how you want to consume the service. Most folks will be fine with using the standard UI that the GPGS SDK comes with. If you want to go full customization, you can, which is awesome!
Naturally, there where quite a few talks on these new services. Here’s a list of what i found the most informative:
“Practical Android Games Development”, gives you a great introductionary overview of how to setup GPGS for leaderboards, achievements etc. in your dashboard, what the APIs offer you and so on.
“Mobile Multiplayer Made Manageable”, gives you an overview of how to use the multiplayer services on Android.
“Advanced Game Development Tools”, gives a bit more in depth info on how to resolve cloud save state conflicts, integration with 3rd party engines and so on. Really liked this one.
You can integrate the GPGS today in your libgdx app. Nex already did so on a basic level for his Mathematiles game (not published yet). The gist of it goes like this:
- Setup your app in the dashboard, including achievements, leaderboards etc. Follow the docs on the GPGS site.
- Install the GPGS SDK and add it to your Android project
- Check out the sample projects. The BaseGameUtils project has a GameHelper class that wraps the GPGS. You can directly take that file and drop it into your Android project. It’s a nice “little” wrapper around the service APIs that should make your live easier.
- To be able to still iterate on the desktop, follow this guide on how to integrate platform specific APIs, like the GPGS API. Also make sure to follow the thread linked to in the beginning.
- Use your wrapper to integrate the GPGS services
This is of course a very coarse description of what to do. We’ll follow up with a proper tutorial on the Wiki eventually, ala Swarm.
I’m really quite excited about these new services, but am also kinda worried what this means for our friends over at Swarm Connect. Haven’t heard from them yet. We’ll see how that turns out.
I also wonder how the G+ dependency will work out. On Android it’s a no-brainer, sign-up/login is stupidly simple. I’m not sure how well that will work on the web and iOS for the non G+ audience.
Finally, i’m really looking forward how Apple will react to this. 3rd party social gaming platforms ala OpenFeint etc. have been tolerated even after the introduction of Game Center. This move by Google might just tick them off a bit.
Overall, the cross-platformness in combination with the contact managment of G+ looks to be a great addition to the social gaming ecosystem.
Staging, Alpha and Beta Testing on the Play Store
Play Store publishing has been extended with new features. You can now do alpha/beta testing with a select group of people. All of this is accessible in the developer console. Pascal of OrangePixel fame already tried out this feature. It’s extremely smooth and helpful.
Other interesting stuff
One talk discussed how to do gameplay recordings on Android, in Unity. Big take away is that you can use the VP8 encoder in Android now
Chet Hase and Romain Guy gave their anual “how we make rendering on Android faster” talk. Not a lot of new things, but still super entertaining to watch.