Build 10 classic Flash games and learn game development along the way with this ultra-fast paced game development course.

If you love this blog, this is the book for you.

Buy the book

Get the source code of 12 commercial Flash games, which have been loaded more than 50 million times!

Learn from real world successful examples.

Get it now

Box2D for Flash Games teaches you how to make Flash physics games from scratch with the most advanced features.

Create the new Flash game smashing hit.

Buy the book

The making of A Small Car, a 3D Flash game made with Flare3D

Do you want to know how to make a successful Flash 3D game? Christian Östman from a small game made a 15 million plays (and counting) game, and shares with us some interesting information.

If you have played A Small Car you know that it’s a 3D Flash Game where you drive a small car on winding levels in the sky. Since we released it in December 2010 it’s been played over 15 million times.

It was the first game made by me, Christian Östman (coding, gameplay) and Richard Åström (art,leveldesign, sound) under the “A Small Game” – name.

As there’s not that many 3D flash games around of this kind we thought it could be interesting for others to read about how we made the game and the workflow we used, especially with Molehill waiting around the corner.

The game was made in about 8 weeks, but neither of us spent full-time on it, so i would estimate that we spent around 2 weeks each full-time making the game. A while before we started working on the game i had experimented a bit with the Flare3D engine, which is a 3D engine for Flash.

Besides being very easy to use and being very good performance-wise it has an awesome integration with 3d Studio Max in the form of a plugin. With the plugin it’s possible to create 3D content and preview it directly in the Flash Player, without leaving 3d Studio Max. This would prove to be very important for the workflow we used to make the game (more on that later).

Physics

One of my first tests with the Flare3D engine was to try and integrate it with JiglibFlash, wich is a great 3D-physics engine that i’ve used before.

The way Jiglib works, as most physics-engines, is that you add physics-primitives and set their properties. While running the physics simulation you then use these primitives to correctly position your displayed objects.

After having JiglibFlash running with Flare3D i started thinkig about how nice it would be if you could edit the physics directly from 3D Studio instead of having to write it in code . This way you could eliminate basically all level-specific code which i knew from earlier projects could take a lot of time. To be able to edit the physics from 3D Studio i wrote a small AS-class called PhysicsParser.as. It uses a great feature in the Flare3D plugin called UserData.

User Data makes it possible to add any custom properties to your objects directly in 3DStudio Max, these properties are then read into Flare3D when you load your scene in flash. So what PhysicsParser does is parsing a Flare3D scene and looking for a User Data property called “jiglib”, if that exists it looks at the other properties on that object and creates a physics object and sets all the properties on it.
Some example properties includes: type (box,sphere,cylinder), movable, friction, restitution and so on. This is how setting userData on an object looks like in 3d studio Max:

Game Engine

With a physics engine that was editable from within 3dstudio max, it was time to start making a game.

Jiglibflash actually comes with a class that simulates a car, and i’ve been wanting to use it for a while in a game. So I made a quick test with the JiglibCar, added some keycontrols to it and used a car-model that Richard had made for another game we had been experimenting with. I made it so it loaded an external Flare3D scene called level.f3d and parsed it using physicsparser.

Then i could go directly in to 3D Studio, create a level and set the physicsproperties, and just export it as level.f3d. Then start the game.swf and the level would load, and you could drive around in the level directly. It’s even possible to animate stuff (which we ended up not using that much, but for example on the spinning Earth in the Bonus Level).

The flare3d plugin comes with a feature that makes this even nicer, called Custom Exporter, there you just define a swf that should start when you press export. So with this it was possible to make changes to the level and instantly try it out in the game. At this point i sent the swf to Richard and asked if he wanted to make the levels for the game.

Which he did, and it allowed me to focus only on the game-engine, and Richard could create all of the levels, without the need to write any code. Here are some screens of how the levels looked like in 3D Studio:

The rest

We added some more specific user data variables that was parsed for the game, like for example “goal” wich could be set on any object, making it a goal, and if the car would get in a certain range of a goal object the level would end. After all the levels was finished we embedded them all inside the game. Richard composed the soundtrack, and we added some menus and a titlescreen to the game. Finished!

For our new game INTRUDED we’re using a similar (identical) workflow, even though it’s a very different game, and not using Jiglib for the physics. We’ve made it so that almost everything in the game is editable from 3d Studio, making it very fun and easy to create different style of gameplay without writing any custom code.

Thanks for reading, and don’t hesitate to comment below if you have any questions. Also, don’t forget to check out the awesome Flare3D engine. Version 2.0 (using Molehill) is in pre-beta at the moment and looks very promising!

Rate this post: 1 Star2 Stars3 Stars4 Stars5 Stars (21 votes, average: 4.81 out of 5)
Loading ... Loading ...
Flash Templates provided by Template Monster are pre-made web design products developed using Flash technology.
They can be easily customized to meet the unique requirements of your project.
Be my fan on Facebook and follow me on Twitter! Exclusive content for my Facebook fans and Twitter followers

This post has 22 comments

  1. Chris Moeller

    on April 18, 2011 at 11:45 pm

    Was the 15 million plays just from their website, or through a bunch of game portals, and if so, which ones?

  2. Pedro

    on April 19, 2011 at 2:06 am

    Should be exciting and really fun create levels with 3d studio. Thanks for the article!!

  3. Vlad

    on April 19, 2011 at 6:59 am

    Does this save all your models and everything into one final .swf file ?
    and/or can this be done ?

  4. Christian / Asmallgame.com

    on April 19, 2011 at 9:01 am

    Chris Moeller:
    The plays are from different portals, like minijuegos.com, gamesbutler.com, mochigames.com etc

    Vlad:
    From 3dstudio you can export the scene as a .f3d files containing all models, textures, animations etc. You can then embed these .f3d files inside your SWF, making the final game a single SWF.

  5. Juanjo

    on April 19, 2011 at 11:01 am

    Question about monetize.

    Of course i dont want to ask you about your earnings in mochimedia ads (its private). But in general… is this game a good business for you. I have games with 50k (i know its not much) plays and the business is not so good ;-)

    The good thing is that you have spent very little time (a normal coder would need more weeks to develop a game like this).

    Thanks.

  6. DJP

    on April 19, 2011 at 1:07 pm

    Great article. I was thinking of giving Flare3D a try and this really helps. I have seen A Small Car game on a bunch of sites but haven’t played it… until a couple of min ago :). It’s great to see more and more 3D games in Flash.

  7. Jorge

    on April 19, 2011 at 2:35 pm

    Simply awesome…

  8. JeremyOLED

    on April 19, 2011 at 6:50 pm

    Fantastic. You guys did a really a good job of not letting the development process get in the way of the actual development

  9. sliz

    on April 20, 2011 at 4:33 pm

    the sky box is so good.
    how do you do that?

  10. vega

    on April 21, 2011 at 12:34 pm

    Great article – didnt knew that the game was so succesfull – gz!

  11. Viza

    on April 23, 2011 at 4:17 pm

    I’m always confused with the definition of “plays”… Is 15million plays means 15 loads (i.e. counting in the preloader for example = 15 million views), or 15 million clicks on the “Play” button in the main menu, or 15 level played?

  12. butler

    on April 26, 2011 at 4:24 pm

    yeah from gamesbutler.com the game got stunning 21,579 Plays

  13. Christian / ASmallGame.com

    on April 28, 2011 at 3:07 pm

    Thanks for commenting!

    Juanjo: Ads is one of the ways to monetize a game, we also have sponsorship and sell sitelocks/branded versions of it.

    Sliz: It’s not a skybox, just a gradient background image really :)

    Viza: In this case a play is equal to a view, counted once every time the preloader finished.

  14. nikhil

    on April 29, 2011 at 12:40 am

    hey Christian ,

    loved the game.The simplicity of the game make it really attractive.Looking at it i was thinking that “its very easy to make complex games but very difficult to make a simple one”.But u did it really well.Kudos!!!

  15. Blinx

    on April 30, 2011 at 9:56 am

    Hi Chris, loved the physics. Is flare3d opensource?, Should I have to pay to make a sponsorship game using it

  16. Case study: Pixel City Skater, an iPhone game made with Flash

    on June 7, 2011 at 8:52 am

    [...] Do you remember Christian Östman and his Flash 3D game A Small Car? [...]

  17. Case study: Pixel City Skater, an iPhone game made with Flash - Emanuele Feronato

    on June 21, 2011 at 1:17 pm

    [...] Do you remember Christian Östman and his Flash 3D game A Small Car? [...]

  18. Amo Seenathy

    on July 22, 2011 at 9:47 pm

    i fell in love with this game cuz i search the internet 4 cool 3d games 2 play & tis is d best. thumvs up guys!!!! u should make a game where we cud create our own levels, that’s how much i love dis game.

  19. Dasun

    on April 20, 2012 at 7:26 pm

    Hi Christian,
    As I know how it’s difficult to get into the track of this latest technology, I wanna thank you both guys about this post to make us aware.Nice work and Good luck for you.

  20. Bala

    on January 23, 2013 at 6:59 am

    Great Work,

    Can you pls explain about distribution of SWF (release build)to any gaming sites.

    As game SWF should require a html page that needs to contain a tag like.

    So How you managed guy’s…
    you provided both html and SWF or just only SWF.
    How you make sure that tag is there in html that was used to embed small car SWF…?

    Normally we only give SWF file to clients.
    We are about to release a game.

    Thanks for helpful suggestions
    Bala

  21. Bala

    on January 23, 2013 at 7:01 am

    tag like.. param name=”wmode” value=”direct”

  22. Juan

    on March 25, 2013 at 8:11 pm

    Nice work.
    What are you thoughts on the future of flash? Have you looked into developing html5 games?
    Are there ready made physics engines you can incorporate into html5 games?
    I love games with good physics engines I just hope flash doesn’t die.