Sunday, January 22, 2012
Beta testers needed
Thursday, January 5, 2012
Shrinked Scala jar from proguarded files
<profile>The above profile uses the original scala-lang as provided scope (used in compilation) and the shrinked is used in compilation scope (is packaged in the APK).
<id>hacked</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<use.lazy.unpack>true</use.lazy.unpack>
<compile.scope>compile</compile.scope>
</properties>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.punchwolf.scala</groupId>
<artifactId>shrinked-scala</artifactId>
<version>1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
</plugins>
</build>
</profile>
Monday, January 2, 2012
Useful terminal with git in osx
#for white terminal
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
# Set git autocompletion and PS1 integration
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then
. /usr/local/git/contrib/completion/git-completion.bash
fi
GIT_PS1_SHOWDIRTYSTATE=true
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
PS1='[\u@\h`__git_ps1` \W]\$ '
Tuesday, December 13, 2011
SCAWAR Space Combat trailer
We are also really close to starting our Open Beta round so if you want to know when that starts or anything else related to our game, follow us on Facebook:
facebook.com/scawargame
Saturday, November 5, 2011
First screenshots
TexturePacker
While working on our first Android game, I came across a tool that let's you combine all your small sprites in to a single sprite sheet that will be loaded by your game engine. The tool is called Texture Packer.
The tool will try to fit all the images you throw at it in the smallest possible spritesheet. If you want, it can also crop and rotate the images to make it possible to fit even more images to same space. Several different game engines are supported, so for example AndEngine which we currently use, the tool will create one image file, one XML data file that contains the locations, rotation etc. information of the sprites in the image file and one Java file which has a constant for each of the sprites for typesafe handling of sprite loading.
Packing all your sprites to one image has multiple benefits. OpenGL ES requires the textures dimensions to be a power of two. This way, if you have a single texture buffer for each sprite, you end up reserving lots of extra space for nothing. With single, tightly packed spritesheet you usually can get away with considerably less empty buffer space. Using a single TextureAtlas for multiple textures has performance advantages in both loading the textures as well as drawing them. Details about advantages in drawing performance are explained here.
The tool is easy and intuitive to use. The developer is friendly and fast to response to any problems you might have. And it does now have a version for Ubuntu, which was perfectly timed as I had just moved my development to Ubuntu from Windows as I kept having issues with Windows filesystem and Maven.
As I'm starting to sound like a marketing droid here, I will state here that I don't have contacts to TexturePacker or it's author, I didn't receive any payment from this post. Andreas Löw, author of TexturePacker, was kind enough to provide me with a free Pro license of TexturePacker.
Sunday, October 9, 2011
Integrating Scoreloop to your Maven build
I’m a big fan of automated build process. Especially on Android where creating a release-ready package is a really multi step process: you need to compile, strip with ProGuard, dex, package, sign, verify and what not.
When it came time to integrate Scoreloop to our game, we had some problems. Scoreloops offers a nice UI ready for use. But this means you can just put it in a jar and use it like normal dependency, because UI’s need graphics, layout xml’s and other resources. Finding info on how to get this to work with Maven proved difficult. Thanks to Julien Donguy at Scoreloop for pointing me to Android Library Projects.
Here’s how you would go about adding Scoreloop to your Maven build:
Download the Scoreloop SDK and unpack it somewhere. Inside you’ll find two directories: ScoreloopCore and ScoreloopUI. ScoreloopCore contains scoreloop-core.jar which you can install to your local maven repository like any other jar:
mvn install:install-file -Dfile=scoreloop-core.jar -DgroupId=com.scoreloop -DartifactId=scoreloop-core -Dversion=2.4 -Dpackaging=jar
Next you want to create a zip file from the contents of the ScoreloopUI directory (so that AndroidManifest.xml is in the root of the zip) and rename that zip to scoreloop-ui.apklib.
We can then add that package also to your Maven local repository with command:
mvn install:install-file -Dfile=scoreloop-ui.apklib -DgroupId=com.scoreloop -DartifactId=scoreloop-ui -Dversion=2.4 -Dpackaging=apklib
Note the different packaging parameter.
Next you’ll add both of these packages as dependeciens to your pom.xml.
<dependency>
<groupId>com.scoreloop</groupId>
<artifactId>scoreloop-core</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>com.scoreloop</groupId>
<artifactId>scoreloop-ui</artifactId>
<version>2.4</version>
<type>apklib</type>
</dependency>
Now running mvn clean package should create an apk that includes all necessary parts from Scoreloop. You can see the apklib getting included with something like this:
[INFO] --- android-maven-plugin:3.0.0-alpha-11:generate-sources (default-generate-sources) @ YourGame ---
[DEBUG] Expanding: C:\Users\someuser\m2\repository\com\scoreloop\scoreloop-ui\2.4\scoreloop-ui-2.4.apklib into C:\ideaworkspace\examples\YourGame\target\unpack\apklibs\com.scoreloop_scoreloop-ui_apklib_2.4
We did experience problems with earlier versions of maven-android-plugin so we suggest using Maven 3 and android-maven-plugin 3.0.0 alpha’s.
Atleast for Intellij IDEA, there’s one more step to go. Apklib’s, unlike regular jar dependencies, are not visible inside IDEA, so if you start coding, you’ll find none of the classes from the scoreloop-ui.apklib available. To fix this you can add the ScoreloopUI as a module dependency inside IDEA:
- Select File –> New module.. –> Import module from external model
- Point the file explorer to the location where you unpacked ScoreloopUI.
- When it’s imported, select your game’s module and “Open Module Settings”
- Select “Dependencies” tab and click Add.. –> Module Dependency and select ScoreloopUI.
Now the sources for the UI classes are available to your IDE, and this doesn’t affect the maven build process.
From here on forwards you can follow the User Guide that comes with Scoreloop.
Comments and feedback are welcome as usual!




