MvR, GPU scaling, in-app purchases, bugfixing...

You thought development had stopped? Keep reading :)

First of all, let me announce (if you haven't read it yet) that Pixelatom has released Monkey vs Robots for Android. We've worked closely to bring this game to life and, as a result of this cooperation, I've added some pretty cool features to BennuGD on devices.
But, first of all, the game trailer:
The game is pretty fun to play and if you want to support either a small indie game development studio or BennuGD development on devices, buying the game is a good way to do so. We've also released the Ouya version as a demo. Once you download the demo (from DISCOVER in your Ouya) you're given the option to purchase the full game as an in-app purchase.
So, again, if you want to have a good time playing a nice game or just reward us for our good job :) just:
Or just switch on your Ouya and purchase the full version in-app

Like I said before, while developing the game, I've improved the port in a few ways. Let me talk to you about some of them.

Hardware scaling

I already talked to you about it. GPU scaling is now ready for primetime and I must say it's working beautifully. In the next few days I'll be uploading the code to the SVN server in Google Code. I'll post a small update when it's ready, but you might also want to follow my public twitter account to know about it as soon as it happens.

Ouya in-app purchase module

In order to get the in-app purchase experience going, I had to create an in-app purchase module. If I have to tell you the truth, it's pretty cumbersome to set up and to get it working you probably want to have a notion of what you're doing.
I'll also upload some sample of the module working, and have some "fake" modules so that you can compile your games in your computer.
As a side benefit, this module allows you to tell an Ouya apart from a regular Android device.

Nuts & Scrap

Our friends at Devilish Games recently celebrated their 15th (wow!) birthday. To celebrate, they released Nuts & Scrap -one of their first games ever- on Android for free.
The game is coming to iOS, too (and uses hardware scaling :) and uses Pixjuegos' on-screen controls. In fact, it was Panreyes from Pixjuegos who did the Android port and adapted the game code from Fenix to BennuGD.

PixTemplate

People are complaining that using the Android port is too hard and Panreyes created a template for you to use. It includes all you need to port your BennuGD games to Android (if you're on Windows, that is).
It's pretty useful, and includes some of their goodies (like on-screen controls and a great control abstraction layer). Be sure to give it a try!

Ripollés' Nightmare

Something quite nasty happened to the great guys at PixJuegos with this game that they had already finished. I'll talk to you more about it on a later post but didn't want it to go unmentioned on this one.

That's it for today. I'd say you've got quite a few things to check out!

Happy coding

WIP games, GPU scaling and BennuGD 2

First of all, let me show you something I'm working on with the guys at Pixelatom.
My TV looks small to you?
Buy me a new one!
Yep, Monkey vs Robots is coming to the Ouya and iOS soon.
The game is basically ready but we need to set up the in-app purchase process in Ouya. You can check the game's site (and purchase the Windows version) here.
Here's the game trailer:
While preparing the port something beautiful happened: SDL2 was released, along with some beautiful docs on porting your SDL 1.2 code to the new version.
The docs include specific info on how to put fully rendered frames (like those BennuGD creates) to screen through a texture AND includes info on how to use SDL's new SDL_WINDOW_FULLSCREEN_DESKTOP mode. What this new fullscreen mode does is that instead of changing your monitor's resolution (that flickering you see when launching some games), it creates a window with your screen's native resolution and then scales your game's contect up to that resolution.
Now, that's pretty much what some BennuGD games -including MvR- do using scale_resolution. The problem with BennuGD's current implementation of scale_resolution is that it works completely by software and that is SLOW.
SDL's implementation, however, works completely by hardware if supported by your platform. I did a quick switch to this new method, and here are some preliminary results:
Performance of MvR in an iPod touch  4G while using BennuGD's current software implementation
Performance of MvR (the same DCB file)  in the same iPod Touch 4G when using hardware scaling
XCode shows you how much time your code spends doing different thigs. The graphs above show a metric of how long it takes your program to render each frame, where is that time spent (CPU vs GPU) and how many FPS it's running at.
When rendering the frame completely by software, we can only render ~10fps and it takes 113ms to render each frame, most of which (101 ms) are CPU time. The game is unplayable.
When switching to GPU scaling, the FPS meter goes up to 21fps*. The total CPU time is now 58ms, 46 of which are CPU time.

That this means is that with the current software scaling in BennuGD, the iPod was spent more than half the time just scaling frames, Not drawing stuff or performing game logic: just making the fully rendered frame look bigger. And when we offload that job to the GPU, well... the GPU time doesn't even increase.

The new code is not yet publicly available, but I'll upload it to my SVN server soon, but you should not have to do anything in your BennuGD code to be able to use the new functionality.

This is, obviously, huge for BennuGD and when presented to the rest of the community sparked a very interesting discussion: we might switch the whole rendering pipeline to SDL2's new SDL_Render API.
This should -finally- give us full hardware rendering on targets that support it (Direct3D in Windows, OpenGL in Linux/Mac, OpenGL ES in iOS/Android) while having a software rendering fallback stack on the rest of targets. Most interestingly, to do this we'll have to actually remove a lot of code from BennuGD, and change some other tiny bits.
We might call this BennuGD 2. I'll keep you posted ;)

* Remember that this is an iPod Touch 4G, which won't be supported by iOS 7, so we can consider this the lowest performance we'll get in any iOS device.

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...

Blog Archive