Da Viking Code, one year of freelancing!

Hey guys, happy new year (better late than never!)!!

We’re already in 2014… and now I worked more than one year as a freelancer and it’s still awesome! I’ve detailed most of the projects made on this blog and my personnal website. Give them a look!

So what is coming up?
Now, I’ve a company name, Da Viking Code (you probably got the joke), and a new website! Thank you my friends at Curious Label for this awesome logo & design!

An other very exciting news: Tamsen aka Gsynuh joins me on Da Viking Code’s crew in February!! He’s the best Citrus Engine’s contributor and it will be awesome to work together daily at the same place!

So now we’re two freelancers for your services, playing with AS3/AIR, Unity and Canvas/WebGL technologies!

Best wishes for 2014 and see you between two lines of code!

Working with multi-resolutions assets

When we’re making mobile apps we have to support lots of resolution from 480 x 320 to 2048 x 1536 if you only target iOS. Adding Android support you have to extend it to 2560 x 1600 (for the Nexus 10)!

If your graphic designer made its design into a vector format, it will be easy to fit exactly to your screen size, and you will only fight with the different ratios format.
However if your design is made with bitmaps, you have to, firstly, be sure they have been made for the highest resolution you would like to support! When this is done, you will use a SpriteSheet to have all of your assets in one (or a little more) place.

In this blog post we will see how to manage multi-resolutions assets based on a Starling app.

Continue reading Working with multi-resolutions assets

Belle et Sébastien, fighting Android’s APK 50mb limit

It’s already time for a new app, Belle et Sébastien!

IMG_0067IMG_0068Belle et Sébastien is a famous old french book and there was a TV series. A movie is planned for the end of the year.
In this mobile application, we discover B&S’ world: an album introduce the characters and relates several informations based on elements existing in the movie: Génépi, snow, WWII, wolf, sheeps…
There is also a game, a kind of Where’s Wally?. Through pictures from the movie, you’ve to search hidden characters, animals, objects, etc.

Android’s APK 50mb limit
The development was going great until we had to release the application for Android. The app is 90mb, we wanted to be sure that it could be downloaded via 3G on mobile phone for iOS devices (limited to 100mb). When we uploaded the Android’s APK it fails because of its size: an APK can’t exceed 50mb!
I didn’t know that, what a mess! Quickly, I heard about APK expansion files. Apart form the APK, we’re able to upload two obb files, each file could be up to 2Gb! I can’t understand why Google is limiting APK to 50mb when the final application could be up to 4.05Gb. Anyway, that was the way to go. Note that you can also download yourself a zip and save the its content on disk to be used in your application, but it sounds so much user friendly to have everything downloaded at one time!

The issue finally was: how to use this obb file with AS3/AIR? I discovered this Actionscript Native Extension: Android APK expansion files, and everything worked like a charm!

To generate an obb file (don’t forget to add .obb extension to the file):

./jobb -pn air.com.europaapps.BelleEtSebastien -pv 1 -o /Users/Aymeric/Documents/Workspace/Flash/2013/Europa\ Apps/BelleEtSebastien/obbToUpload/air.com.europaapps.BelleEtSebastien/main.1001001.air.com.europaapps.BelleEtSebastien -d /Users/Aymeric/Documents/Workspace/Flash/2013/Europa\ Apps/BelleEtSebastien/bin/images

More informations there.

Available on iOS and Android, gives Belle et Sébastien a try! Note that translations are coming 😉

Assassination Classroom, back in love with the web!

Hey guys, it has been a long time since I didn’t make a project for the web. Some years ago, I decided to go away from my web training and learnt native languages (Objective-C) and focus on cross platform tools (Flash/AIR, Unity and Haxe NME which is become OpenFL). You will say that HTML5/JS is the most cross platform tool which exist, that’s right. However as a developer, I thought it wouldn’t improve my skills like Objective-C or even Unity using C-Sharp did. And that’s always true! JS isn’t a smart language, and it isn’t very interesting to deal with it (no interface…).

However some weeks ago, someone offered me a game project using HTML5 technology, and I said yes! Why the hell, I said yes? Because web has evolved. It is far to be perfect right now, but I think the road is the good one. It’s amazing to be able to play your game in any browser on your computer and your smartphone! No apps to download, just go to an URL.
Also on a technology part Canvas performances are improved “each month”, and WebGL support climbs. JavaScript is still a piece of shit but we have many meta languages (Haxe, TypeScript, Dart, CoffeeScript) doing a great job. On an other part I heard about pixi.js some months ago, a WebGL rendering engine with a Canvas fallback and I wanted to give it a try.

Continue reading Assassination Classroom, back in love with the web!

Monsieur Bear’s ABC and the myth of not being able to run SWF vector graphics on mobile

I’m glad to present a new application I’ve developed: Monsieur Bear’s ABC. Available for iOS and Android.

Monsieur Bear’s ABC
mb1A funny animated alphabet book designed by the talented Virgo!

Virginie Aracil aka Virgo is back in the app world for a new adventure! Now, she comes with an alphabet book, Monsieur Bear’s ABC! This cute little bear will help your child discover the letters, the sounds and words in an original and acidulous universe. With hilarious animations, cartoon sound effets and a French Touch style, this application will give hours of fun to your child!

– An alphabet book completely animated !
– Cute drawings !
– Discover Monsieur Bear, the bear made by Virgo !
– Original animations and fun sound effets !
– Available in French and English !

Technology?
mb2Like Sophie la Girafe, Monsieur Bear’s ABC is built using AS3/AIR technology with the Citrus Engine framework on top of the display list.
I won’t explain the choice of the display list and the gpu mode, it’s well described in Sophie la girafe’s article (here we have the same problematic).
However behind this catchy title, it reveals a strong reality: no one think we’re able to run correctly swf on mobile. Please have a look on this thread on Starling‘s forum. I know it’s Starling forum, it’s normal that everyone recommend the Starling’s way. But common’ guys, if you tried this app how the hell would you be able to make it running with Starling? The DragonBones framework, would be a way… but it won’t correspond to many animations, and it will be so long to do all the animations for it!
Here no one think it would be possible to make this project on the display list. At first, I tried to just run the swf animations but it was crap then tried using the rasterize process but it wasn’t good too. I was in a blind alley. Then I remember that I’ve already been able to run many SWFs correctly on the display list (again the goal isn’t to target 60 fps with particles, blur etc), so why I’m not able to run correctly this swf? I contacted the graphic designer: each model is made in Illustrator. I grabbed ond of them, it has so many points: 500 000! Everything became obvious… There are optimizations in code, there are also optimizations on graphics!! And obviously it should be done before code optimization 😉

Using directly SWF format, I was able to rescale everything to the perfect screen dimensions and it’s priceless! Also the final weight for all the animations is 7Mo. This is just impossible to achieve using the spritesheet way.

AddFrameScript magic
It’s very a common way to make vectors animation with Flash Pro. For example Tiny Thief is a beautiful game using vector graphics (that’s very easy to rescale everything!!). However they used Scaleform technology to export on mobile, and not Adobe AIR.
With iOS (using AIR) we’re not able to reload SWF which has code in them (a simple stop() on the timeline is considered as ABC code). It means if a SWF has AS3 code, you won’t be able to dispose it and reload it. It will always stay in memory. When you’ve more than 300 SWFs that’s a big deal 😀 So obviously the solution is to not add any code in this SWF, but how are we able to stop animations easily or do other operations? Using the undocumented addFrameScript method:

_currentAnim.addFrameScript(_currentAnim.totalFrames - 1, _animCompleted);
 
function _animCompleted():void {
      _currentAnim.stopAllMovieClips();
}

That was a very simple example. Using this method you’re able to inject code to a specific frame of a MovieClip. And it won’t cause any problem to be unloaded and reloaded! Obviously it is a bit harder to manage because the code isn’t directly in the swf, and so if you change your animations don’t forget to change the addFrameScript code too. But if your code is well organized, it shouldn’t be a big deal!

Rdrct.it
Now let’s follow this link: http://rdrct.it/monsieurbearsabc. Depending on your OS you will be redirected:
– on a website for all the computers.
– on Google Play for Android.
– on the App Store for iOS.

That’s a very convenient way to share a link, isn’t it? There is also a powerful feature, if you open it on your mobile and you already have the application installed, it will open it! Don’t wait anymore, give a try to rdrct.it too!

Resize icons for mobile apps

There are things which take times, they could easily be automated but there aren’t. One of this task is to generate all the icons for a mobile application. You have to resize the same image into 10 different sizes, for Android and iOS (29, 36, 48, 50, 57, 58, 72, 100, 114, 512, 1024).

Why Apple doesn’t only require an image size of 1024 and automatically generate the smaller picture when the app is exported for the publication? There may be a good reason for that. Anyway, go to this Github and grab the php script to generate app icons for Android & iOS in all requested resolutions.

Now the quick dev story: at first, I thought it was a good small project to get back into some ruby dev. I didn’t practice it since several years ago. So I started with Sparrow’s samples, but quickly I went into library & version nightmare, and I wasn’t able to remember a single line of ruby! So I get back to php very quickly and discover that we may use it with a CLI (why couldn’t we?). It’s very quick & powerful, be ready for some script for renaming 😀

Edit:
Find some scripts for renaming files and delete others one based on a string name: https://github.com/alamboley/AssetsOperations

Live Coding in AS3 using COLT

Hey guys,

I hope many of you have seen this amazing video made by Bret Victor: Inventing on Principle. This is one of the best introduction to live coding if you never heard about it.

Recently, Code Orchestra, released an amazing tool named COLT. It enables live coding in AS3, you will find many great video examples on their page. You can use the tool with a free trial during 15 days, don’t hesitate! It comes with many examples to help you understand the basis, oh and there is one running with the Citrus Engine 😉

Continue reading Live Coding in AS3 using COLT

Alef is out!

Hey there,

It has been a long time since I wrote my first game, Kinessia, with the Citrus Engine (and start contributing), one and a half year. Less than one year ago, I made an other one, Tribus, using a Citrus Engine’s port in Objective-C. That was my first project in Objective-C so the source code of the port shall not be very clean, that’s why I’ve never released it officially.

We all know the problem making a framework / library and never use in real context project. That’s why I started my carreer as a freelancer 4 months ago, to be able to make applications / games for companies and show what can be done with the Citrus Engine. And now I’m proud to add a new reference to the engine: Alef.

Continue reading Alef is out!