Greetings!

The main purpose of this website is to support Android indie game developers with tutorials, reviews and promotion of their games. The main difficulty for the developers is not to make the game, but to get exposure. To get it out there. If you find anything useful here, please spread the word. Like my page on Facebook, follow me on Google+ or Twitter. Thank you!

Google+ Facebook Twitter

× close

Wednesday 28 August 2013

Free sprites, sounds and music for Indie Game Developers

If you are making a game, sooner or later you will need graphics, sounds and music. There are a lot of free resources available on the web and if you pick the correct license, you can even use them in commercial games.

I have assembled a small list of sites (accessible from every page in top panel - List of free resources) offering free sprites (and other graphics), music and sounds that I have been using directly on indirectly as an inspiration. These sites sometimes come and go and all lists I have found suffer from link rot. If a link stops working, please let me know!
Read more »

Tuesday 27 August 2013

Tutorial - Android Logging and Logging in AndEngine

This tutorial is part of AndEngine basics.


<< List of all tutorials


If you have been working as a software developer, you probably use logging daily. But for beginning game developers, the whole concept of logging might be quite new. So what exactly is logging?

When you want to print a message from your program, you have usually two options. Print it on screen or print it to some log. A log is simply a list of messages. It can be later printed in a console, a file, or anywhere else.

In games, where you usually work with fullscreen graphical interface, it's not very practical to print anything on screen. You can use good-old Java System.out.println() method, but using logging is more convenient.

Android comes with a log facility called LogCat. You can view LogCat output through adb or if you are using Eclipse, go to Window -> Show View -> and search for LogCat (the one with rainbow tail is the one). If your device is connected you will immediately see some messages.



The log messages have the following attributes:

  • Log Level - this is the severity of the message. It can be verbose, debug, info, warning, error or assert (a.k.a.WTF - what a terrible failure)
  • Time - Timestamp when the message added
  • PID - process ID of the app that printed the message
  • TID - Thread ID
  • Application - identified by the package name
  • Tag - your custom identifier
  • Text - your custom message

You can select what level you want to see and also use filtering to show only messages containing certain string (just type the string) or tag (type tag:name). Other options are available, see the hint in Eclipse.

How to use logging in code


You can use standard Android logging or if you are using AndEngine, then it's log wrapper. Few examples:


Log.v("kulis", "This is a very detailed message");
Debug.v("This is a very detailed message");
// notice missing tag above, "AndEngine" will be used

Log.i("kulis", "Info level message");
Debug.i("kulis", "Info level message");

try {
  doSomethingDangerous();
} catch (Exception e) {
  // never swallow exceptions, at least print them to log!
  Log.e("kulis", "Oops!", e);
  Debug.e("Oops!", e);
}

Debug.setDebugLevel(DebugLevel.ERROR);
Log.i("kulis", "This message still will be printed");
Debug.i("kulis", "This will not be printed, current level is ERROR");
  
Log.wtf("kulis", "This should never happen");


Notice that when using the Android class Log, you have to specify tag, message and optionally a throwable object (exception). AndEngine Debug class adds methods without the tag. In that case "AndEngine" tag will be used. Also notice the method setDebugLevel - this will limit AndEngine logging to the set level and higher. AndEngine doesn't implement the wtf() method. It should be used for things that should never happen - so in case they happen, you will know ;)

Best practices

Always log exceptions. Never use emtpy catch block. If you are expecting the exception to happen, at least print a debug message that it happened - the code above might change later and you will be surprised if you don't print anything. Also try to use specific exception handling (don't simply catch Exception, but the Exception that you expect, e.g. NullPointerException) and use different messages for different types.

  • Verbose - used for low level debugging. Print stuff like position of your character when you are debugging why the hell it's going off screen etc.
  • Debug - Messages that could be useful to determine where something went wrong. E.g. put a debug level message to each method beginning and end.
  • Info - These messages can be useful in production as well. Log important events in info level, e.g. Engine created
  • Warning - something not quite right, but it's not a bug. E.g. you can't connect to Facebook to submit Highscore - not nice, but you can live with it.
  • Error - Log exceptions and errors that you will need to analyze later and solve.
  • Assert - this is the WTF level. Simply log things that should never happen, e.g. a case in switch statement, that you expect never to be called.

Be careful with assembling messages from several parts. For each statement where you concatenate:

Log.d("kulis", "Position: " + x + ", " + y);

Java will create a StringBuilder object, use three method calls and then throw the StringBuilder away. This can have serious impact on performace! Imagine doing this in your game loop, that is being called 60 times per second...

What you should do is one of the three following options:



if (BuildConfig.DEBUG) {
  Log.d("kulis", "Position: " + x + ", " + y);
}

if (MainActivity.DEBUG) {
  Debug("Position: " + x + ", " + y);
}

if (Debug.getDebugLevel().isSameOrLessThan(DebugLevel.DEBUG)) {
  Debug("Position: " + x + ", " + y);
}

The first option, BuildConfig.DEBUG,  is Android's built-in property that should be set to false during export with production certificate. But it doesn't work very well, so I can't recommend it.

The second option is your own boolean property - highly recommended, because you will probably want to use it elsewhere too.

And finally the third option is AndEngine's built-in mechanism to test for the current Debug level (see above). It's seems too complicated, but still can be useful.

When using any of these (except the first one in some cases ;)), the concatenation will not be called if the condition is false.

Also if you are using AndEngine Debug class set debug level to NONE  for production to avoid printing anything.

Conclusion

Use debugging whenever you need to pass a message from you application and be careful not to use too much of the concatenation. If you need it, wrap it in the if statement. Leverage the Debug class if you are already using AndEngine.

You might have noticed, that the LogCat view icon in Eclipse is droid flying with rainbow tail. This is certainly an easter egg. Another easter egg in Ice Cream Sandwich is the actual nyandroid swarm. Go to Settings -> About and start tapping on Version (that should say 4.0.x). After a while a droid dressed in ice cream sandwich appears. Tap and hold on it. Enjoy...

Read more »

Monday 26 August 2013

Nation Soccer - Learn how to make games with AndEngine by example

Nation Soccer is a small and simple game from a developer who goes by the name of delight.im. The game is inspired by Adam Wardle's 1‑on‑1 soccer and you might have seen the same concept before somewhere else. So what's special about this one? It's written in AndEngine and it comes with a complete source code!

The author said he created his game from nostalgy - he used to play the original during his school years. Also his motivation was not to make money and therefore the game is completely free of charge with no advertisement. The gameplay is very simple: your character tries to get the ball in a kind of 1.5 dimensional space to opponent's goal. There are no special football moves, you just use the character's oversized head to push and kick the ball. The game features several game modes including bluetooth multiplayer.



It still contains a few bugs and the intelligence of the computer opponent could be improved, but since the game source code is licensed as GNU GPL 2 you can give it a try and improve it yourself. In any case this is a great opportunity for anyone who wants to learn to make games for Android using AndEngine. The source code is available with all assets - graphics and sounds. You can find it in delight-im's GitHub.

The game itself is available in Google Play store.
Read more »

Sunday 25 August 2013

Leisure Suit Larry: Reloaded - great game, disappointing Android version

Leisure Suit Larry: Reloaded is a great game, long awaited by the adventure genre fans. It is a remake of an older game and it was made possible by a successful kickstarter campaign. It contains everything that I used to enjoy in the original version and more. But the Android port is buggy and it somewhat scams you into paying for the game which leaves a bad aftertaste.

Leisure Suit Larry is a series of games created by Al Lowe that used to make me smile, chuckle and look over my shoulder to make sure nobody is watching. Larry is a guy who tries to score with girls and fails miserably and you can probably guess what is the goal of each game. Larry Laffer was also a person working in software industry, making him very easy to connect with for the gamers in the late 80's and early 90's. The games are full of witty adult humour and double meanings and they never fail to be fun. The games also feature a test to prove that you are an adult by asking questions about American culture that an average adult American should know - this was a big issue for me as  in a post-communist country... The remake also has this test, which I consider stupid, because today everybody can easily search for the answers on the internet.

Leisure Suit Larry: Reloaded by N-Fusion Interactive and Replay Games is a remake of the first game Leisure Suit Larry in the Land of the Lounge Lizards by Sierra which is actually a remake of an even older text adventure game called simply Softporn Adventure. It is not the first remake, a VGA clone of the original Larry already exists. You can compare the original and the two remakes on the following pictures (chronologicaly from the oldest, if you can't tell!)


And you can compare another set of pictures of the another scene (warning for the easily offended by brief nudity, don't click) from 1987, 1991 and 2013. Apart from improved graphics, the game is also fully narrated and the voice suits the game very well.

From now on, I will be talking only about the Android version, because it's actually much worse than the PC version.

Leisure Suit Larry: Reloaded is a typical point-and-click adventure which works well with touch screen. However the controls are somehow buggy and it happened to me many times that I couldn't move or do any other action. Save/restart/load helps, but it's very annoying. Also the graphics are very resource hungry and the game sometimes looked like this when I went back to menu and then started a new game on my low end tablet:


The game uses Unity engine that is usually ok and this is no one-man-zero-budget game. Fortunately it was working fine on a phone. However it's a shame to see such things in a game that you actually have to pay for.

And that's another problem I have with this game. When you find it in Google Play Store, you will rejoice, because it's free and it doesn't say anywhere that it is not a full version. The game description is just full of positive reviews from gaming websites. The star rating, which is currently at 3.1/5 should be a big giveaway though. You need to read a few reviews to find out that it's actually not free. The game scams you into paying for it later.

After few minutes of playing, you will be thanked for playing a demo and asked whether you want to purchase the full version. It would be much nicer if the game actually told you that it is a demo and did not download all content from the start - which takes by the way almost 500MB of your precious drive space.

I guess I did expect it. The steam version for PC costs $19.99. But if I did not know about that, I'd feel cheated, even though the in-app purchase asks for just $5.

Conclusion

Leisure Suit Larry: Reloaded is a really well done game with nice graphics and good humour. If you want to give it a try, you can download the Android version but treat it as demo and expect you will have to pay later. If it is stable on your device, it is worth paying for.
Read more »

AndEngine Tutorial - Getting Started

This tutorial is part of AndEngine basics.


<< List of all tutorials

There are few good tutorials about how to get started with AndEngine. But they are video tutorials and if you are like me and can't follow videos, here's a tutorial for you. If you like it, there's a good chance you will this book about AndEngine as well.

AndEngine is a 2D OpenGL ES game engine for Android, developed by Nicolas Gramlich. OpenGL is usually used for 3D graphics, but with certain settings (orthographic projection) it can work very well for 2D.

AndEngine is a game engine. It's not a game creation system. Most of the apps for Android are written in Java. It's the same with AndEngine - it's just a library that helps you take care of some aspects of your game. This tutorial requires you to already know Java, know how to install Java on your computer and basic Java programming. It also expect you to have an Android device; phone or tablet. In later tutorial I will cover installing a suitable emulator, but you can't replace testing on a real device. I use Windows, so everything I say applies to Windows. It should be pretty straightforward to apply it to other OS too.

Let's get started. If you find something unclear or hard to understand, please comment on the article below. Note: You can see the original size of any image by clicking on it.

Install and prepare required software

Install latest Java JDK. Grab the one that says just JDK, you won't need NetBeans IDE. The IDE of choice for Android is Google's version of Eclipse. There is another IDE coming, Android Studio, but it is in early access stage. So just forget it for now.

Install Android SDK with adt bundle. Download it from the linked page - agree to the EULA and choose the right version for you (32-bit or 64-bit). If you are running 32-bit Java on 64-bit system, choose 32-bit. You can also download just the adt bundle and use your existing Eclipse. This is not covered here.

The downloaded file should be something like: adt-bundle-windows-x86-20130729.zip. Simply unpack it to a directory of your choice. First run the file "SDK Manager.exe". It might take a while to start and it doesn't show any splash screen. Give it time. You will be presented with this screen:



Check any packages that have update available. Note that you only need the latest SDK, which now is SDK 18 - Android 4.3. Every SDK version allows you to write applications that can be deployed to any Android version. If you use a function from SDK 18 that is not available for older Android phones, the method will not be executed and you will get a warning or exception. Be careful with that. But the code will compile and deploy!

After the update, close it. You can of course install any packages you think you need. But for this tutorial, the default are enough. The SDK Manager is accessible from Eclipse too.

Now run eclipse: adt-bundle-windows-x86-20130729/eclipse/eclipse.exe. After the splash, the first thing you will see is this:



If you have never worked with Eclipse, note that workspace is both a virtual space on your screen (the layout) and a directory where your projects and some metadata that Eclipse keeps about your projects are stored. Choose any directory you want but one with easy access. You can have multiple workspaces. If you check the "default" checkbox, you will be working with this workspace by default and this dialog won't appear again at the start. It is always available from the File menu in Eclipse.

After the start, close the Welcome screen and you will be presented with Eclipse default layout. Everybody prefers something else but you will see my layout later on the screenshots. Everything can be drag-n-dropped, play around. Also you can have different perspectives for each workspace. I will explain this later in a tutorial about debugging.

Download and unpack AndEngine sources

AndEngine is Open Source, licensed under Apache licese v2. You can use if for your commercial games and you can license your games as you wish. You can also make modifications to the engine, but then you have to make the modifications available for public.

The official location of AndEngine sources is GitHub. You will only need the basic AndEngine library for this tutorial.
 

There are more extensions available plus a project with examples and you will actually need all of the extensions to be able to compile and run the AndEngine examples, but let's not complicate things for now. I will cover the extensions and examples in the next tutorial.
Notice that there are several branches of AndEngine. The GLES1 branch deals with OpeGL ES 1.0 and it is the oldest. I don't recommend using it. GLES2 is newer and GLES2-AnchorCenter is the newest. Use the GLES2-AnchorCenter if you haven't used AndEngine before. AnchorCenter branch biggest difference from the GLES2 vanilla is the fact that point 0,0 is now in lower left corner of the screen. This is the same as in OpenGL, that's why it's recommended.

GitHub is a versioning source code repository (like SVN or CVS) but to make things simpler, click on Donwload Zip button. Versioning systems are widely used in software development, sooner or later you might want to go back and use it. For your own benefit. Check my other tutorial on GitHub to see the alternative way to download the sources.

Unpack the file AndEngine-GLES2-AnchorCenter.zip to your workspace directory. Rename the "v" directory to "AndEngine". Then In Eclipse, select File -> Import and choose Existing Projects into Workspace. Browse to your workspace directory. This is what you should see. Import the project by clicking on Finish.




 If you have installed the adb bundle with SDK 18, you will see the following message in your console:

[2013-08-25 15:36:11 - AndEngine-GLES2-AnchorCenter] Unable to resolve target 'android-17'
[2013-08-25 15:36:11 - AndEngine-GLES2-AnchorCenter] Project compiler settings changed. Clean your project.

Actually you will be seeing this quite often. Let's deal with it: Right click on the AndEngine project, select Properties and choose Android. There should be just one option to select. Do it and click OK. You will probably have to Project -> Clean the project to make the error dissapear (that's just lazy Eclipse). We had to do this, because the project was saved with SDK 17 selected. Now we don't have it, so we have to select the one we have.


Hello World

What kind of tutorial doesn't give you a Hello World, right? Go to File -> New -> Android Application Project


Application name is going to be visible under the app's icon in your phone. When creating a real application/game, give it some meaningful name. Project name is just the project in eclipse - this is how you apk will be named. I recommend using a single word derived from your Application name. Let's say your game is called Awesome Football Manager. This you can simply put in Applicaiton Name, but on the phone you will probably see "Awesome Foo..." under the icon, due to limit on number of displayable letters. 

Package name is used for your java codes. If you have your own domain, put it there (backwards). If you don't have one, imagine that you do and what it would look like. Note that the package is the unique identifier used in Google Play store and all the other alternative stores. Make sure your chosen package name is not taken! My domain is kul.is, therefore my package starts with is.kul.

Minimum target SDK is simply the lowest Android version that you are going to support. AndEngine works well with SDK 8, but if you are going to use big textures you might run into problems. I will cover this in later tutorials.

For Target SDK and Compile with pick the highest available SDK (18) and do this always. It makes no sense to pick anything else unless you need to reproduce some old bug.

For Theme select none. You activity background won't be visible, so don't bother with it. You might see some ugly bars around your picture. This is out of scope of this tutorial for now.

Click Next. Deselect "Create custom launcher icon", we are not going to waste our time now for eye candy. Click Next again and you will see Activity creator Wizard. "Blank activity" should be selected". Select it if it is not and Next.

The next screen allows you to customize your activity. The only important thing for now is the activity name, which will be the same as the Class name of the activity. Just keep everything default and press Finish.

Now you have created an empty Android application (not AndEgine yet). Plug in your Android device and try it out. Make sure you have enabled USB debugging on your Android device. If not, tap Settings, scroll down to { } Developer options and enable it. Click the green play button in the Eclipse top panel and select Run As -> Android application.


Next popup will appear. It should list your Android device. Here you can see my chinese tablet identifying itself as "unknown-q88". I highly recommend doing this with real device and not the emulator. But I will get to emulators later. Clicking on Use same device... is recommended until you get to stage when you test with multiple devices.



You app should start on your device. If not, you will have to troubleshoot it - it's not related to AndEngine yet.

Another popup should appear asking you if you want to auto monitor messages from your app using LogCat. Select yes. I will conver LogCat and Debugging in separate tutorial. But fo now, select yes and check the LogCat tab that was added to Eclipse. It contains usefull messages from your app and all the other apps. This is something you will want to use later.

If you did everything right, you should see Hello World message.

Adding AndEngine to Hello World

Right click on your project and select Properties. Choose Android. Click add and select the only available option there. This is how it should look like after you add it. Click OK.





That was a lot of configuration, downloading, let's see some code! Open MainActivity.java. Tip: You can use Ctrl+Shift+R to quickly open any resource in your workspace. Press it and type Main... you will see MainActivity as one of the options.

This is how it should look like:


package is.kul.tutorial.helloworld;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;

public class MainActivity extends Activity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.main, menu);
    return true;
  }

}

Disclaimer: Android authors chose Hungarian notation for Android code style. There's a great debate on the internet whether this notation is good or bad. Without starting any flames, Nicolas used the same notation for his engine. I will try to follow it too in the tutorials. You will see it more often than not, get used to it. It will make your life easier. See details on this page.

Download the following image, name it "helloworld.png" and place it in your workspace in the Tutorial_1_HelloWorld/assets folder:



Now replace the code in MainActivity with this code:

package is.kul.tutorial.helloworld;

import java.io.IOException;

import org.andengine.engine.camera.Camera;
import org.andengine.engine.options.EngineOptions;
import org.andengine.engine.options.ScreenOrientation;
import org.andengine.engine.options.resolutionpolicy.RatioResolutionPolicy;
import org.andengine.entity.scene.Scene;
import org.andengine.entity.sprite.Sprite;
import org.andengine.entity.util.FPSLogger;
import org.andengine.opengl.texture.ITexture;
import org.andengine.opengl.texture.bitmap.AssetBitmapTexture;
import org.andengine.opengl.texture.region.ITextureRegion;
import org.andengine.opengl.texture.region.TextureRegionFactory;
import org.andengine.ui.activity.SimpleBaseGameActivity;
import org.andengine.util.adt.color.Color;


public class MainActivity extends SimpleBaseGameActivity {

  private static final int CAMERA_WIDTH = 800;
  private static final int CAMERA_HEIGHT = 480;

  private ITexture mHelloWorldTexture;
  private ITextureRegion mHelloWorldTextureRegion;


  @Override
  public EngineOptions onCreateEngineOptions() {
    final Camera camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);

    return new EngineOptions(true, ScreenOrientation.LANDSCAPE_SENSOR, 
        new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), camera);
  }

  @Override
  public void onCreateResources() throws IOException {
    this.mHelloWorldTexture = new AssetBitmapTexture(this.getTextureManager(), 
        this.getAssets(), "helloworld.png");
    this.mHelloWorldTextureRegion = TextureRegionFactory.extractFromTexture(
        this.mHelloWorldTexture);
    this.mHelloWorldTexture.load();
  }

  @Override
  public Scene onCreateScene() {
    this.mEngine.registerUpdateHandler(new FPSLogger());

    final Scene scene = new Scene();
    scene.getBackground().setColor(Color.YELLOW);

    final float centerX = CAMERA_WIDTH / 2;
    final float centerY = CAMERA_HEIGHT / 2;

    final Sprite sprite = new Sprite(centerX, centerY, 
        this.mHelloWorldTextureRegion, this.getVertexBufferObjectManager());
    scene.attachChild(sprite);

    return scene;
  }

}

You can see almost the same example in AndEngineExamples project, in SpriteExample.java. But when you try to import the Examples project now, it will most likely fail. Let's deal with examples in the next part.

When you run this application, you should see this:



For now, let's just go through this code and explain bit by bit what each part means.


public class MainActivity extends SimpleBaseGameActivity {

SimpleBaseGameActivity extends BaseGameActivity. Every Activity in AndEngine should have BaseGameActivity as one of it's ancestors. SimpleBaseGameActivity then implements some functionality (callback after some events) that you not always need to customize. In real game you will probably want to extend only BaseGameActivity and implement the callbacks yourself.

  @Override
  public EngineOptions onCreateEngineOptions() {
    final Camera camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);

    return new EngineOptions(true, ScreenOrientation.LANDSCAPE_SENSOR, 
        new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), camera);
  } 

This method tells the engine, how it should behave. You create camera here, because you then pass it to the engine. For now you want the camera to view the whole scene, so set it to the same size as the resolution.

Notice the EngineOptions.
  • First parameter is whether you want to run in fullscreen.
  • ScreenOrientation simply tells the app how to behave, when you rotate the device. There are four options, fixed and sensor for both landscape and portrait. Sensor means the engine will rotate the screen when you turn the device upside down.
  • resolution policy is one of the trickiest thing ever. Let's just say that the two bars you might see around your screen are caused by that. The rule of thumb is that you specify resolution (and resolution policy) that best suits your game and the engine will take care of all scaling. 
    • Let's say we set the camera width x height as 800x480 but your phone has resolution 1280x720 - no problem, with ratio resolution policy, the engine will scale your scene from 800x480 to 1200 x 720 and leave the two 40px wide bars on the left and right. And you will be still placing entities in the scene as if it was 800 pixels wide and 480 pixels high.
    • It's really not complicated, but choosing the right policy is difficult.
  • And the camera

  @Override
  public void onCreateResources() throws IOException {
    this.mHelloWorldTexture = new AssetBitmapTexture(this.getTextureManager(), 
        this.getAssets(), "helloworld.png");
    this.mHelloWorldTextureRegion = TextureRegionFactory.extractFromTexture(
        this.mHelloWorldTexture);
    this.mHelloWorldTexture.load();
  }

Create all resources here. We only have one image. You need to understand three basic terms here:
  • Texture - this is a bitmap representation of an image in your device's memory
  • Texture Region - is a part of texture
  • Sprite - is a virtual entity that is linked with the Texture Region and displays it.
So we create a texure object, define a region and then load the texture from the file to memory. 

  @Override
  public Scene onCreateScene() {
    this.mEngine.registerUpdateHandler(new FPSLogger());

    final Scene scene = new Scene();
    scene.getBackground().setColor(Color.YELLOW);

    final float centerX = CAMERA_WIDTH / 2;
    final float centerY = CAMERA_HEIGHT / 2;

    final Sprite sprite = new Sprite(centerX, centerY, 
        this.mHelloWorldTextureRegion, this.getVertexBufferObjectManager());
    scene.attachChild(sprite);

    return scene;
  }

Last method creates the Scene. It's a good idea to register the special handler for displaying framerate. You will see it printing FPS messages to LogCat.

Here I simply create a yellow background and put the Sprite in the middle of the picture. See how you create a sprite. You have to pass it position, texture region to display and then vertex buffer object manager (vbom). The vbom is out of the scope of this tutorial, for now we can say, just do this always...

Summary

This is it. You should have a working HelloWorld example running on your phone. Start by exploring the Examples. I promise I will post a tutorial how to open all the other projects and fix problems soon. You can tr it yourself. Simply download all extensions from Nicolas' GitHub, add them to Eclipse, fix the projects setup.

Next: AndEngine Extensions and AndEngine Examples

Further reading

You can see the list of books about Android Game Development for further reading, not just about AndEngine but game development in general.

If you have any questions, you can contact me on Google+, post on the website's Google+ page, Facebook page or simply send me and email to android@kul.is.
Read more »

Saturday 24 August 2013

Simply Sudoku

Unless you have been in coma since 2005, you probably know Sudoku. A simple number puzzle that got extremely popular because it's so easy to print and publish in newspaper, magazines or even on a roll of toilet paper. Simply Sudoku for Android is exactly what the title promises: simply a sudoku, just for your Android phone.

Simply Sudoku's best feature is probably its clean design. It takes advantage of the fact it's not paper but it doesn't overdo it and gives you just the features and decorations you need to make solving sudoku easier. The game is free and supported by advertisement, but the ads appear only in menus and are not intrusive at all.

Most of the Sudoku apps nowadays allow you to write in small numbers in the squares representing possible variants. Simply Sudoku goes a step further and with smart keyboard also hints you which numbers are already eliminated. However this feature in combination with a hint button that fills the correct number for you makes solving Sudoku too easy and almost takes all the fun out of it.

The app contains simple relaxing music as well, but both music and sounds can be turned off. Fortunately even the smart keyboard can be turned off. If you don't want to spoil all the fun, I highly recommend doing so. 




The only small flaw of this app is that is works only in portrait mode. It makes it a bit awkward to play on a tablet. 

Simply Sudoku's author Sergei Ozerov promises several improvements and additions like Sudoku puzzles along with a dark theme. According to his words, he just needs the app to get some popularity. If you like the game and you miss any features, let him know. I am sure he will be glad to hear from you.

Conclusion

Simply Sudoku is a well done Sudoku app with clean design and almost no annoyances. If you simply want to solve a Sudoku, give Simply Sudoku a chance.

Dowload Simply Sudoku from Google Play
Read more »

New Blog Design, Game Reviews and more

As an excercise in CSS, HTML and XML, I have tried to make this blog look more professional. I have used an existing free template (see footer) and removed all elements that I did not like. Also blogger.com doesn't really handle multiple pages very well. The pages in the menu are links to searches for certain labels, but it'll do. I hope this new design looks good enough for the new purpose of this blog: game reviews & tutorials.

Game reviews

The biggest problem of Indie Game Developers is publicity. I learned that the hard way. I got positive feedback from people playing my game, but simply not enough players found it. I believe every little bit of publicity will help fellow Indies so I have decided to give it a try. I play those games anyway.
I will start reviewing games from people who already helped me during my development, but if you want to request a review, click on Submit game for review link in the top bar.  It's free with a small condition. See the submission form for details. I plan to do a review or two per week.

Tutorials

There's never enough tutorials and since I have already made one published and one unpublished game in AndEngine, I want to share my experience in a series of tutorials. There are already some tutorials for AndEngine, but this simple and free 2D engine always suffered from a lack of documentation - so I guess it won't hurt to write an article or two!
Read more »

Monday 19 August 2013

Emulator Alternatives II - Genymotion

Genymotion is a quite new addition to Android emulators family. I got it recommended first by a tester working for one of the biggest Android development companies in Czech Republic and therefore I put it on my to-try list. After that I did not really try it, because I managed to get good enough performace on my desktop PC with Intel HAXM driver. But when I tried the same on my older laptop, I couldn't get enough performance to at least unlock the screen without lagging.
For some time I was using Bluestacks but it is lagging as well a bit and it is Android 2.3. So I gave Genymotion a try. It is awesome.

Development, debugging

Genymotion runs as a virtual machine in Oracle Virtual Box. The installer comes with Virtual Box bundled, so you don't have to worry about it. It also has Eclipse and IntelliJ Idea plugins, but I am fine using it standalone with adb. Deploy and debugging work perfectly.

Features

Genymotion is ideal for game development. It uses your hardware to run OpenGL, so it's fast - even on my old laptop. It allows you to select all the popular resolutions along with DPI - therefore it's very easy to test how ads like AdMob ads will look on screen in your game. Thanks to this, I have discovered that some small screens with very popular resolutions actually look quite bad in my game, Mr. Dandelion's Adventures. They cover important elements on the screen.

Available images

Also you have many options of Android devices to choose from - they get downloaded on-demand. I was very happy to see Android 4.3, but a bit dissapointed to find out that they do not have Android 2.3 yet. But according to their Twitter they are working on it.

Conclusion


When Genymotion releases Android 2.3 image, I will uninstall BlueStacks and never run the original emulator again!

Read more »

Thursday 8 August 2013

Emulator Alternatives I - BlueStacks AppPlayer

BlueStacks is an Android 2.3.4 Emulator for Windows and Mac that runs pretty fast even on slow machine. You only get one device though. It's purpose is to actually run the apps, but it is very usefull for debugging and testing using almost genuine Android 2.3.4.

Settings

The only dissadvantage of BlueStacks for me was the absence of settings, especially screen size and memory. This is important for games - you want to try as many screen sizes as possible. However you can set almost everything using windows registers:

 
[HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks]
 
To increase or reduce BlueStacks RAM, change the following value. I use 384MB, the default was 768MB:
 
[HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android]

"Memory"=dword:00000180

And here is BlueStacks screen size:
[HKEY_LOCAL_MACHINE\SOFTWARE\BlueStacks\Guests\Android\FrameBuffer\0]
"Width"=dword:00000320
"Height"=dword:000001e0

You can of course try and play with all the settings, but some of them might break the emulator.

Debugging

BlueStacks come with USB debugging enabled, simply run the following command to connect with adb:

adb connect 127.0.0.1:5555

Installing APKs

Installation of applications is very simple. You can use Google Play Store, install the APK using adb or Eclipse. Or you can use BlueStacks AppHandler on Windows (Right Click->Open With option) to install it from Explorer (Mac probably has similar option).
 

Experience

BlueStacks runs very smoothly, ideal for taking videos. Sound works, OpenGL works.
Read more »

Saturday 3 August 2013

My First App - Mr. Dandelion's Adventures


After three months of learning Android, Open GL and AndEngine, I released my first app to the Google Play Store: Mr Dandelion's Adventures.

Mr. Dandelion Adventures is a casual game where you command the wind to guide the main character Mr. Dandelion through four colourful seasons on his travels, Gather coins and avoid dangerous traps. Play as you like - easy difficulty, just get him to the finish, or extreme difficulty - try to pickup all coins in combos to earn three stars rating for each level.


Here is a promotional video I have made for the game:



It was fun making it and it's nice to be part of the Indie Games Developer community. There's a lot going on there and the support is amazing. I just got free ad on  http://criticalindiegamer.com/

Read more »