New release coming, this time for iOS too!

So, today I've been working on getting the latest BennuGD for Android code up to shape.
This version bundles pretty much the same core BennuGD code -with a small but important bugfix- from previous releases but is compiled against SDL2 RC3.

What you'll get from this next version depends on what your Android version (I'll support Android 2.3.3 and above) is, as shown below:
  • All versions of Android:
    • Standard BennuGD
    • mod_multi: Multitouch support, created by me. See an example here.
    • mod_chipmunk: Physics library based on the excellent Chipmunk library. Have a look here, too.
    • mod_curl: Web request support, created by me. based on cURL. You can use it to download stuff from the web on the go from your app. See an example here.
    • fsock: Low level networking library. Really powerful, but you must have some insight into how networks works in order to use it.
    • mod_sensor: Sensor access library, created by me. It allows you to access the readings from all the sensors in your devices (gyroscopes, accelerometers, barometers, proximity sensor, light sensor...). It looks like I'll have to write some sample code...
    • Some level of gamepad support.
  • Android 3.1 and over:
    • Mouse support. You can have interfaces that act differently if you're using a real mouse/trackpad than they do when used with fingers. You'll also be able to tell from code when the cursor is moving but the user isn't clicking.
  • Android 4.0 and over:
    • When the user presses the mouse/trackpad button, you'll be able to tell if it's a left/middle/right click (through mouse.left, mouse.right...)
  • Android 4.1 and over (this includes the OUYA!):
    • Your games will be able to fully utilize joysticks in Android, as long as Android recognizes them as such.
      In theory, you can set up an unlimited number of joysticks and the user can connect them through USB and/or bluetooth.
I hope you can use this info and that available at the Android DashBoards to plan your game development according to the market shares of the different Android versions.

Enough of Android! If you're an Apple fan, there'll be updates for you as well.
I'm also going to update the iOS builds and include most* of the stuff above, so that you fanboys can have fun, too.

Hope you like the news :)

* I might not be able to include mod_sensor...

Progress update

A lot has happened since the latest blog entry. Here's a summary of what's been going on:

New packager release

I released a new version of the BennuGD Packager, this is what it looks like:
Packaging your games for Android has never been easier!

New features:

  • Support for release builds. Just specify the path to your keystore and let the packager handle everything :) Build created in this mode can be uploaded to Google Play (and probably other marketplaces, too).
  • Automatic decompression of resources. On Android your FPG, MAP and FNT files must be uncompressed. Up until now you had to do it manually but now it's the packager that uncompresses them so that you don't have to.
  • AdMob support! Once you register in the AdMob website and create a new app there, you'll be given a Publisher ID. Just enter that ID into the packager and your app will display ads!
    Monetize your app by releasing both an ad-supported free version and a non-free version.

You'll need:

  • Oracle JDK (not JRE): Get it from here. Again, install the JDK and NOT the JRE.
  • Ant: I'm now distributing the packager with the installer for WinAnt. If you already have ant in your system you don't need to do anything, but you can use this installer to get Ant in case you don't.
  • Android SDK: Within the SDK install the Android 3.2 (API 13) SDK platform and the Google AdMob Ads SDK if you want to be able to use ads.
  • Make sure you uncompress the packager to a path without spaces in Windows.
Of course, if you're running Ubuntu Quantal or one of its derivatives, you can install the BennuGD Packager much easily from my PPA. You'll be happier and you'll receive updates automatically and more frequently.
>>Get the new packager from here<<

First Android games have hit the Play Store

Some brave developers have already uploaded their games to Google's Play Store. Here they are:

Monkey vs Robots Lite

On it's developer's words:
A casual puzzle game with pixelart graphics and classic arcade gameplay.
Monkey vs Robots is a casual puzzle game with pixelart graphics and some mid-nineties retro feeling, with a classic arcade gameplay similar to Puzzle-Bubble or Arkanoid.
Your objective is to wipe robots out of your jungle; the less shoots you use, the better reward you will get. Just avoid the coconuts to bounce on the walls since they break before destroying the robots.
This is the lite version of the game. Full game is not available yet.
If you liked the game and want more stages, enemies and coconuts please rate it and we'll be very happy to work on the full version.
Thanks for playing!
Have a look at the gameplay video:

Pix Frogger


Getk the free version here.
From my friends at Pixjuegos:

PiX Frogger is a multiplayer racing game about frogs crossing the street.
The game allows 2 players playing simultaneously on the same device!
A great casual Frogger clone with a multiplayer touch (it uses mod_multi, by the way :)

Dead Snow

Check the free version here.
From my friends at Pixjuegos:

*This game was made in only 3 hours!*
* Try it, and if you like it, please invite us to a snack by buying the donation version! *
You control a Snow Ball which hates the world and goes down the hill smashing everything.
But avoid trees, they are stronger, and also explossive barrels!
Another great casual game, created in just three hours!

Nerea's Bank Panic 

From the nice guys at Pixjuegos.
Some robbers are attacking the bank, and the only one who can save them is you, the sheriff!
A humble tribute to SEGA & Sanritsu Denki's Bank Panic!
It's dedicated to Nerea for her birthday!
Isn't love wonderful? Panreyes created this game and published it in Google Play for his girlfriend's birthday!

What's left?

People are already uploading games, the port mus t be done, right?
Unfortunately not quite yet. There are a few tasks to do yet:
  • Wider GPU support. There are problems with some Adreno GPUs. I have an idea of why those are happening buthaven't still been able to test the fix.
  • Mouse input support I've been working on patching SDL2 to support real mouse input. Up until now mod_multi simulated mouse events when the user touched the screen. You'll now be able to disable mouse emulation (mouse emulation will be an opt-out feature) and detect real mouse input just as in your PC. The code for this is already written in the SVN and the feature will be bundled with the next version of the Packager.
  • Gamepad/Joystick support I've been looking at patching SDL2 to add gamepad/joystick input. The current implementation lacks any kind of joystick support and all the code must be written. I pretty much know how I'm going to do this but I'll have to sit down and write the code.
  • Bugfixing Bugs will be found and we'll have to mercilessly kill them.
Please note that in order to enjoy full mouse/gamepad/joystick support you'll need to be running Android 4.1 in your device. Older versions of Android will give you some but not all of the features (from Android 2.2 on you'll be able to get left mouse button signals, but you'll need a more recent version to be able to get right mouse button clicks, for example).

Hope you like the news!

mod_multi example

I've had some multitouch sample code lying around for quite some time. I believe some of you might find it useful:
/**
 * Android test
 * Joseba GarcĂ­a Etxebarria - (C) 2012
 * Use as you wish
 */

import "mod_video"
import "mod_text"
import "mod_mouse"
import "mod_sound"
import "mod_wm"
import "mod_map"
import "mod_draw"
import "mod_say"
import "mod_file"
import "mod_text"
import "mod_multi"

GLOBAL
// Set to your device's native resolution
width  = SET ME;
height = SET ME;

Process Main()
Private
int song=0, num_fingers=0, i=0;

Begin
    set_mode(width, height, 32, MODE_FULLSCREEN|MODE_FRAMELESS);
   
    write(0, 0, 0, 0, "Width: "+width+" Height:"+height);
   
    graph = map_new(width, height, 16);
    x = width/2; y = height/2;

    write_var(0, 0, height, 6, num_fingers);
    drawing_map(0, graph);
    drawing_color(rgb(0, 255, 255));

    while(num_fingers != 5)
        // Store the total amount of fingers touching the screen
        num_fingers = multi_numpointers();
       
        for(i=0; i<10; i++)
            if(multi_info(i, "ACTIVE") > 0.0)
                draw_fcircle(multi_info(i, "Y"),
                             multi_info(i, "X"), 5);
                say_fast("Drawing fcircle for pointer "+i+" @ "+
                             multi_info(i, "Y")+
                         "x"+multi_info(i, "X")+
                         " active:"+multi_info(i, "ACTIVE"));
            end;
        end;

        frame;
    End;

    unload_map(0, graph);

    say("Quitting");
End;
As you can see, what this code does is paint a circle at the same position as you place your fingers.
t also writes the total number of screens as detected on the screen. IT'll qut when you place all the five fingers in your device's screen.

Lots of things, new iPad game

First of all, I'd like to thank all those who donated for the iPad fundraise! I already wrote directly to those who donated, but I want to publicly thank them, too.
Here's a couple of photos of the iPad showing a post on the BennuGD forums and Puzsion running in the iPad (it works great!):


It's a refurbished iPad 2 -they're a bit less expensive- with 16GiB storage space and it's pretty cool, so thanks!
In the days since I wrote the last post, a few things that might interest you happened:
  • After buying the iPad, I believe I found the cause of the graphic glitch that appeared in it and I believed I've fixed it: BennuGD automatically starts the graphic mode to a default one (320x240) and then when you do a set_mode() it tries to switch to the mode you specify.
    For some reason, this was failing in the iPad 2 but not in the rest of hardware from Apple nor in the Simulator.
    The workaround is that now BennuGD won't set the graphic mode until you do a set_mode. This also helps in Android.
  • 32bpp graphics mode is now working in iOS! iOS -like OSX- uses BGR color ordering, instead of RGB, like most other OSes do. I integrated DCelso's patches for the PSP and expanded them a bit where needed and now 32bpp seems to be working just fine.
    There's still some work to be done, yet, as now all the iOS games start in 32bpp, no matter what you set with set_mode(). It shouldn't be a problem in most cases, but you know, this project wants to always be as compatible with upstream BennuGD as possible.
  • I created and integrated mod_curl. It's just a wrapper around libcurl that allows you to work woith resources in the internet. This allows you to perform two very interesting tasks:
    • Download resources from the internet, thus allowing you to bypass the 20MiB AppStore limit.
    • Do some client-server communication like fetching highscore tables from your servers, checking for updates...
  • Integrated mod_fmodex, which is another wrapper around FMOD Ex. FMOD Ex is one of the most powerful sound engines available and it's used in many AAA games. Right now it provides sound playback with variable frequency plus spectrum analysis (think Singstar) for both microphones and playing sound. The binding will be expanded in the future as needed so if you feel a particular area needs improvement, please let me know.
    Please take into account that FMOD Ex is a commercial product and it costs quite a bit of money in case you want to profit from it. Check here for a full list of prices. Also, please note that FMOD Ex is entirely optional. You can continue to use the regular BennuGD sound system, as usual.
  • Integrated mod_multi into the iOS builds so that people using iOS -the code was already working in Android- can implement multitouch in their games. The implementation is still a bit rough around the edges, but it's working and solving the remaining issues should be easy.
  • I compiled the old code found in the available templates for the simulator and uploaded it to the google code project site.
  • I integrated mod_curl into the old code found in the available templates and uploaded both the iOS and the iOSSimulator templates. You can find these in the Downloads page in the project site.
  • I compiled the new code found in the SVN -containing the new code which directly uses  the SDL1.3 API and not its ugly SDL1.2 compatibility layer- into a template and sent it to those who donated for the iPad 2.
  • I worked with the guys at iPhoneGamesDev.com on their new iPad game called iDraw for Family, which you can already get from here.
    Yeah! I coloured the teapot! Did I unlock any achievements?
That's pretty much it! In the next few days I'll try to upload some sample code for the new modules so that those interested can start coding with them.
Hope you liked the news!

Android port progress, multitouch module

Yesterday I finally got a couple of important things working regarding BennuGD on Android:
First of all, the guys working on SDL workarounded what appears to be a bug in Android that caused APK resource loading to fail, so now you can just package your game's resources into the APK and directly load them from there. There's nothing special you have to do from your BennuGD code. Up until now you'd had to use resources found in the user's SD card, which isn't particularly useful...

Another important thing is multitouch support: Yesterday I created a module to support multitouch. It's based in SDL 1.3 so it should work in both iOS & Android (and on desktops too, if you're still using that sort of devices :P), although I have just tested it in Android. It's still quite buggy but it's working. You can see a very simple preview of how it's working (the sample has some background music although I'm not sure it can be heard in the video) below:

The video is pretty crappy, but you get the idea.
Also, touch sensitivity is better than it looks like in the video.

Those are two very important things to have working for a game engine running on Android so I'm quite happy to see them working.

As per the work left regarding the Android port of BennuGD before we can call it a release, the list of things to do goes as follows:
  • Fix image loading: The colormode for PNG loaded images is not working as expected (yet). Not sure about other formats.
  • Handle rotation: The programmer should have a way to control how they want the phone to respond to rotations when their game is working.
  • I believe that right now we don't have a way to know when the app is in second plane->let the programmer know it through mod_wm.
  • Fix set_mode. Right now the video mode is set for you to your device's default resolution and, if you call set_mode again, Bennu crashes.
  • learn where the programmer must keep their persistent data.
  • [Update mod_chipmunk+compile mod_sqlite3 in].
  • Test it!
Get your little green devices ready because BennuGD is coming!

Blog Archive