Wednesday 30 April 2014

ATF experiments in Adobe AIR (in Android)



After we developed out latest app PerfectBrew for Android (helps you making teas!)
We realized it takes ages to load (well... 10 seconds!) but we want it faster. We had one unique texture atlas with PNG (2048x2048), fully crowded with everything....
In order to be able to expand our app later on we have decided to split it in 3 atlases (same contents for now)
  • 1 PNG (1024x2048)
  • 1 PNG (1024x1024)
  • 1 ATF (1024x2048)
We wanted to make sure we use ATF as much as possible without breaking the graphics (as it doesnt support preMultiplied Atlas!)

We compressed out PNG to ATF with:
png2atf.exe -c e -e -q 10 -4

And here are the results:

1 big PNG:
Loading time: 9-10 seconds.
VRAM used (right after loading) 3 PNGS: 31Mb

3 PNGs:
Loading time: 9-10 seconds.
VRAM used (right after loading) 3 PNGS: 37Mb

2 PNGs + 1 ATF:
Loading time: 8-9 seconds. 
VRAM used (right after loading) 2 PNGS + 1 ATF: 29Mb

We couldn't speed up the load unless we had some textures loaded AFTER the app started. But this was just an experiment where we forced the program to load everything at start.

We used ATFs in Beekyr (a ton of textures there!) and it was a lot more noticeable as there are a lot of ATFs in the game.

I hope this can be useful for somebody!

Monday 28 April 2014

Porting Beekyr for OUYA: (Part II)

After a few months of the release, the game was kind of hidden somewhere in OUYA market.

We barely had many downloads. We had an In App Purchase for 1.99USD.  It was a pretty good deal considering you are getting a good console game. But don' t be hasty, Master Meriadoc.

The current live port was running at very low FPS (25-30) with mayor slowdowns, and that was killing the experience. Not many people enjoyed the game as OUYA controller lagged even more than usual due the FPS problems (explained here) and its OUYA own native problems with WIFI-Bluetooth interferences, which has been fixed recently with 'ChupaCabra' firmware update.

Gamers thought the game was pretty bad, so it didn't have a chance of success... Download were pretty low (about -2 a day?) and sales almost zero.

We left that version and we lost all faith in OUYA ... So we would leave that version there till we could find a solution...

A few months after we got offerd to show our great game in RetroMadrid (thanks to Indie'o'rama !)it was a truly good second opportunity to show that Beekyr for OUYA as a good shmup / shoot em up game.

It was very important what we had to fix its performance problems and implement the rest of updates we have been working on for the GooglePlay version. We had to fix it!

After a lot of talks with the OUYA guys during months, they realized that Beekyr hawas the kind of game that should be running at 60FPS easily but the didn't know how to do it with Adobe AIR. Air was not the problem, it was OUYA OS and its forced 1080p resolution .. In fact I didn't find the answer anywhere. I had to dig in Android forums till I found something that could work, the answer was for Android tablets and since OUYA is android...... It could work. There was a way to limit high-resolution screens, forcing the app to display at lowers resolution. We could use half the 1080p resolution with a very simple line on the descriptor XML file...

Are you ready? This solution is nowhere else!

<supports-screens android:smallScreens="false" android:normalScreens="false" android:xlargeScreens="false" android:largeScreens="true" android:anyDensity="false" />

That's it.

With that line we are forcing the OUYA to run at 960 x 540.
OK, we admit the graphics are not as sharp but the game runs super smooth even with the screen full of bullets and enemies! That's what we want: 60FPS!

We liked the performance so much we improved some other bits of the game and added full support for X-ARCADE.

We went to that fair and after almost 20.000 bugs killed in one day and about 40 people played non stop in the whole fair.... We have the feeling this game has future and everyone in the fair loved it!

How about you?

Go for it, get the game now! It's super cool.
In just a couple of days we have had more downloads than in the past 3 months together!

Enjoy the high-frame rate!