Blog

Archive for: Tech Zone

Mozilla Festival – Mind Candy Game Jam!

As part of the Mozilla Festival, Mind Candy ran a 3 hour Game Jam using HTML5. The festival is all about everyone learning how to ‘make’ the web rather than just ‘use’ the web. We know how much fun it is to make a game and wanted to share that with everyone!

To that end we decided to use a JavaScript framework called Crafty.js which means you can make a game using only your web browser and a text editor. Fortunately almost all the Festival-goers were familiar with JavaScript already so we gave a half-hour introduction to Crafty and four starter games (RPG, shooter, platform and one-button) to start them off!

Several Mind Candy staff were on-hand to help the teams develop their games, answering questions on Crafty and game design. The combination of training, starter projects and help was a powerful one, leading to several finished games in only a couple of hours!

The games worked on included:

Ebony Lizard Fighter            https://github.com/PragTob/Ebony-Lizard-Fighter
Unicorn Super Blaster          https://github.com/stugoo/unicorn-super-blaster
Angry Zamboni Operative    https://github.com/sara89sgm/AngryZamboniOperatives
Soviet Flatulence Roundup  https://github.com/worzy/Soviet-Flatulence-Roundup
Lethal Spatula Heroes         https://github.com/darkyndy/Lethal-Spatula-Heroes
Scooby Doo and Exploding Nudist Zombies
Infinite Platform Experience
Crafty Space Invaders
Nyan Cat Destroyer

Several of them are available on github to play with and you can play Unicorn Super Blaster right here: http://stugoo.co.uk/unicornsuperblaster/

Not only did we all have a fun time and learned new ways to make games on the web, we at Mind Candy have also become somewhat of a fan of Crafty.js and will be using it more in the future – we’ve already contributed some bug fixes back and expect to have more Starter Games on github soon. If you want to get into game development, this is a great way to start!

For more information including links to the Presentation and Starter Games, see http://lanyrd.com/2012/mozilla-festival/szcbt/

Other useful links:

http://mozillafestival.org/

http://craftyjs.com/

- Guest Written by Mark Baker

Tax Break U-turn For UK’s Games Industry

Two years ago George Osborne dismissed games industry tax relief but in a surprising announcement today, it seems there has been a U-turn in his decision.

Videogame trade body TIGA have long campaigned for tax relief in the industry and have expressed its importance on many occasions. Canada, the USA, France and Singapore are just a few of the countries that have benefited from tax credits for games production. They have therefore appealed more strongly to investors and jobs seekers leaving the UK industry following behind.

Our CTO, Toby Moore is just one of those pleased to hear about the news. “We’re thrilled to hear about the forthcoming tax breaks for the UK gaming industry” he says. “The move will help smaller companies get off the ground and enable bigger studios to compete for top talent. Tax incentives will help keep local talent here in the UK when competing against other countries who’ve had a much more enticing offering to date. The Government’s recognition of the UK’s tech and creative industries and their potential to produce world class games is a promising step forward in fostering technology, innovation and creativity in the UK economy.”

George Osborne has said that the UK games development industry would help to turn Britain into Europe’s technology centre.

Toby continues, “It’s a great start but much more will need to be done to boost the economy and to really hold the UK up against countries with far greater incentives.”

Toby Moore - CTO, Mind Candy

 

Reducing the Size of SWF Files

Over here at Moshi HQ, we’ve spent a fair bit of time looking at how to reduce the size of the SWFs we publish to ensure that the game loads quicker for all our users (and to cut down on bandwidth cost!); here’s our quick checklist that we rattle through to get the most bang for our buck (or in this case, Kb)

Joa Ebert’s Apparat.
Joa is an ActionScript hero (in fact he won an award to prove it); one of his tools is Apparat – a Scala application which optimises SWFs by tinkering with the compression they use. Apparat is a real quick win as once you’ve integrated it into your build process you will immediately being reaping the rewards.

Sothink SWF Decompiler
Yes, number two on my list is a decompiler; this is not a mistake. Sothink SWF Decompiler is an essential part of the optimisation process as it allows you to explore all the assets, ActionScript classes, fonts, bitmaps, etc which are lurking around in your SWF – think of it like a visual Size Report for a SWF.

Making use of Run Time Shared Libraries
Flex developers seem very comfortable with Runtime Shared Libraries, but it’s something that most ActionScript dev’s aren’t so hot on. The MXMLC compiler provides a couple of ways to reduce the size of your published SWF by allowing you to automatically exclude duplicated class definitions across SWFs loaded at run time. The problem is a very simple one; you have a Main application which loads in a bunch of child “sub apps” into the same Application Domain; both of the SWFs end up with the same classes compiled into them (for example, you may be using famework elements in both) – because the Main application SWF has already loaded these classes there is no need to include them into the child swf as well.

The simplest MXMLC compiler flag you can use is, -runtime-shared-libraries, simply point it at the location of your Main SWF when compiling the subapps and it will do the rest for you. Alternatively, Those of you who worked in AS2 back in the day may recall the old exclude.xml; well it’s still alive and kicking with MXMLC, it just goes under the name of -link-report.

The process is pretty straight forward, compile your main application supplying the link-report flag, this will dump out an XML file. Next, compile all your subapps supplying the load-externs flag. Keith Peters goes into more detail on his blog.

Checking our Compiler Flags
This may seem pretty obvious, but it’s important to check; The MXMLC compiler which ships with the Flex SDK supports a crazy number of switches and options, the following options can impact on the size of the compiled SWF:

  • -debug – Pretty obvious, if you set the debug flag to true when compiling, MXMLC will embed a whole bunch of debugging information to your SWF, bloating out the filesize. The main thing to watch out for is that you don’t end up deploying SWFs compiled with the debug flag set to true on your live server. Sames goes for the -optimise and -verbose-stacktraces flags
  • -include-libraries – Make sure that you didn’t mean to use -library-path instead! include-libraries will compile the entire contents of a SWC into your final SWF file even if you never actually use any of it! Using library-path, on the other hand, results in only the classes which you import being compiled into the SWF

All of the above require no changes to our existing codebase, but combined have resulted in a massive reduction for the size, and loading time of our SWFs.

Scrum at Mind Candy

For a while now I’ve wanted to write a blog post about how the game development process works at Mind Candy. We use an Agile development process called Scrum, and it suits our business very well.

Over the course of 3 months we recorded an essential part of the Scrum process at Mind Candy: the movement of tasks over our 10 foot tall scrum boards. We have these boards at the back of the office for everyone to see, and it’s a great way for the whole company to get a feel for what features are currently being developed and how well they’re going.

I had originally envisioned a mammoth post going into great detail about how wonderful scrum is for a creative startup like Mind Candy, the benefits it brings our awesome developers and how, as a management team, knowing that we’re always working on the highest priority work to keep our millions of users growing and actively engaged is a great thing, but the irony is that I spent so long thinking about the post that I never actually wrote anything, and that’s what the heart of scrum is all about: releasing the minimal marketable feature as early as possible.

So here you have the first iteration of my post about scrum, as well as the first of hopefully many time-lapse videos of how our processes work at Mind Candy.

If working in a fast paced environment using a process that empowers everyone on the team to create amazing products interests you, then good news! We’re recruiting and we’d love to hear from you.

A reflection

So here I am, the last of my 12 weeks as a Flash programming intern at Mind Candy. I’d like to think I’ve brought a lot to the company. I programmed the Underground Disco for Moshi Monsters which went live recently, as well as a few small things that will hopefully pop up in future, but aside from that I’ve tried my best to take an active role in meetings and discussions, possibly to the frustration of my more experienced (but very patient!) colleages.
My main reason for coming here was to learn, to become more experienced in doing what I do in a working environment and as part of a team. I’m happy to say that I learnt a lot more than I expected to! I’m programming in a much more professional way, in a much more complicated but rewarding development environment (FDT in Eclipse). I’ve previously been quite uncomfortable having other people work with my code but here I was introduced to the joys of using an SVN repository which has been pretty painless and very useful for recovering old work. I’ve taken part in pair-programming too which was surprisingly productive and again something I’ve never been exposed to before.
I’ve been involved in all stages of a product cycle, from the wide-eyed aspiration of the initial design meetings to the gut-wrenching final moments before release. Working with designers, artists, animators, testers, and coders of various disciplines really highlights the importance of communication between disciplines, and that going that extra mile, or even inch, to make things easier for other people helps a lot in bringing a whole product together.
In two weeks I’ll be heading back to do the final year of my degree, where I will immediatly get myself an SVN repository set up and write better code than ever before. And hopefully will keep in touch with some of the great people that I’ve worked with. :)

So here I am, the last of my 12 weeks as a Flash programming intern at Mind Candy. I’d like to think I’ve brought a lot to the company. I programmed the Underground Disco for Moshi Monsters which went live recently, as well as a few small things that will hopefully pop up in the future, but aside from that I’ve tried my best to take an active role in meetings and discussions, possibly to the frustration of my more experienced (but very patient!) colleages.

My main reason for coming here was to learn, to become more experienced in doing what I do in a working environment and as part of a team. I’m happy to say that I learnt a lot more than I expected to! I’m programming in a much more professional way, in a much more complicated but rewarding development environment (FDT in Eclipse). I’ve previously been quite uncomfortable having other people work with my code but here I was introduced to the joys of using an SVN repository which has been pretty painless and very useful for recovering old work. I’ve taken part in pair-programming too which was surprisingly productive and again something I’ve never been exposed to before.

I’ve been involved in all stages of a product cycle, from the wide-eyed aspiration of the initial design meetings to the gut-wrenching final moments before release. Working with designers, artists, animators, testers, and coders of various disciplines really highlights the importance of communication between disciplines, and that going that extra mile, or even inch, to make things easier for other people helps a lot in bringing a whole product together.

In two weeks I’ll be heading back to do the final year of my degree, where I will immediatly get myself an SVN repository set up and write better code than ever before; and hopefully will keep in touch with some of the great people that I’ve worked with. :)

Flash on the Beach 2008

Tuesday Write Up

I went down to the Flash on the Beach 08 conference yesterday, here’s some of the notes that I wrote up on the train back:

Creating The Next Generation Happy Meal Toy

Julain Dolce

Julian is lead Developer for Fuel Industies, a creative agency that worked on a large scale campaign for the fast food chain McDonalds. The project was a rich multimedia experience centred on magical fairies and dragons. The application was delivered on CD which was bundled with Happy Meals. The campaign proved very successful pushing over 80 million units in 30 countries. He began his presentation with a brief overview of the product (marred somewhat by the fact the projector was not playing ball and he had to show it to the audience from the screen of his 15” Macbook).

Julian’s project had several key requirements which were taken into consideration during the initial planning stage:

  • App. must be Cross Platform (Win32 and Mac OS)
  • Installed from a CD, with no internet access required
  • Handle multiple windows (for performance) and alpha transparency

This ruled out Adobe Air 1.0 as it can’t be installed solely from a CD, it also has issues with full frame transparency. As a result they settled on a mixture of MDM Zinc 3 and mProjector. They also used Install Builder, which is a Cross Platform (Win32, Linux and Mac) installation creator. Their main Flash tools were FDT and Eclipse, they made use of SVN and constructed a couple of custom tools in C# using WPF on Win32

Julian’s team ended up building most of their application in ActionScript 2, Julain cited this was because of a lack of a mature ActionScript 3 development environment when the project was started in the summer of 2007. They used SVN to keep code versioned, Mantis to track bugs and took advantage of an automated build process to get the builds out to testers. They also kept Excel spreadsheets for each library asset which detailed file locations, settings (offsets, alpha, and compression ratios for all Cell animations, sounds and linkageid’s, etc.

The team made use of JSFL, which can be used to create custom scripts inside Adobe CS Applications – one such example was the ability to apply an affect to the selected symbols in the Document’s Library.

Their major testing problem was performance bound – using fullscreen alpha transparency bought things to a crawl and meant click events went unnoticed on slower machines – as a result they split the animations down into separate transparent windows which moved across the stage (the user’s desktop). They used LocalConnection calls to get these panels to talk to each other and sync up.

Although the project appeared to go smoothly and was obviously successful, Julian did admit to one major failing. In the time between sending the CD’s off for pressing in China and the returned product – Mac OS X 10.5 shipped – and unfortunately, their application did not work on it – whoops.

Adobe Town Hall Meeting

Richard Galvan, Mike Downey, Paul Betlem, Lee Brimelow and Matt Millar.

The second talk of the day consisted of 5 members of the Adobe Team – 3 platform evangelists and two Flash Player engineers. The group asked questions asked by the audience. I managed to ask a question in the session:

“The company I work for are currently porting a large scale AS2 project to AS3 and were disheartened by the lack of support and tools made available by Adobe to assist in this. By using the Proxy class we have managed to create shims for most the intrinsic AS2 classes, but I Would like to know why Adobe did not do this and release it to the community.”

Their reply wasn’t what I was hoping for (but was to be expected). I was told that Actionscript 3 was designed to target new customers and that they wanted to add as many features as possible to the language. I’m not quite sure what to infer from this seeing as AS2 obviously had a massive user base. The group did, however, acknowledge that the lack of community support in the transition from AS2 to AS3 was a problem (although, again, made no indication that any tools would be forthcoming) . They rounded off my question by assuring that ASVM1 Content (AS1 and 2 SWFs) would continue to be usable in Flash Player releases in the future.

Another interesting question that was asked was about the support for Dynamic Runtime Languages to script the published flash applications and allow greater control at runtime. The team responded by saying that a new project – FLACC (FLAsh C++) is in the works which will allows C++ code to run natively inside the Flash Player. This could lead to other language interpreters being made available and will prove a very powerful tool for ActionScript developers.

Adobe also confirmed that Flash 10 is being worked on for the iPhone – but Apple has not confirmed it will be approved. Flash Player 10 will include the new unloadAndStop() method to help with Garbage Collection when unloading external content in the Player and that there is no AS4 on the cards – instead they will work on improving AS3 whilst pushing ECMAScript 4 forwards (they hinted that Private Constructors might be coming back)

After the Session I spoke to an Adobe Flash Player engineer, Matt Millar. I told him about our Library Linkage Problem where Child Objects placed on the stage in frame 2 (or greater) are not linked to the Display Chain on the first tick. Whilst I was asking this question, another developer stepped in and claimed it was a major problem for his team. I gave Matt my business card and the told me he would be in touch – I’m hoping that this will be fixed before FP 10 is released, but I am not holding my breath!

Grant Skinner

Things every ActionScript developer should know.

Grant is a well revered programmer in the ActionScript community, his Blog provides an excellent resource and he heads up his own development team. Grant’s talk was aimed at developers of all skill levels, but focused mainly on the grass roots. Grant gave an interesting presentation which, in his words, he wished someone had given to him 5 years ago – I’m not sure I can agree it was as life changing as Grant made out – but that may be in part due to the best practices which Mind Candy’s dev team strives towards ;)

Grant started off by assuring the audience that were no right answers in programming – don’t be driven to fake absolutes, although there are no definitive right answers there are plenty of wrong ones! Code is art, Grant stressed, learn the rules before you can start to break them and don’t get hooked on Design Patterns – they’re not the answer to everything.

Grant then proceeded to lay down some programming fundamentals – Enforce code standards as it makes inheriting files easier. Think of code like Lego, not Playdoh. If you are building a space ship in Playdoh and want to change the engine you have to pull it all apart – with Lego you can take apart and reassemble with ease – your code should be like this too. Code flows down in specialisation – at the very top of the Object stack is the Main Application Controller which includes very specific logic for this one particular app – however as you move outwards, objects should become more generic and reusable. When working with reusable code, remember inside looking out – prefer composition and event dispatching over tight coupling and inheritance.

Grant also recommended the use of Service delegates to act as a layer between Server Side logic and Controller Logic in Flash, that way, the server side logic can change with only the one class needing modification on the Flash side.

Moving towards Flash Player specifics, Grant told the audience to always keep learning – read every API you can – you don’t have to specialise but at least know what FP10 is capable of. Also remember that AS3 needs you to be very particular about Garbage Collection – always create destructors in your AS3 objects to handle this in one place.

Grant bought up the concept of using Timeline based Event dispatching. His example was a simple graphical dialogue box (like we use in Moshi), where the box just dispatches events when it finished tweening in / out – that way Classes using this Timeline code / Library Linage just need to register for its events removing any form of tight coupling. Grant proceeded to talk about he makes use of JSFL to create custom Panels and “Graphical Objects” – a single click from the command line laid out all the frames, labels and AS3 timeline code for creating a Graphical Button (including the Linkage name!)

Finally, Grant reminded the audience that we are blessed to have the Flash IDE – we can create prototype and concepts in seconds – get out there an experiment!

You can view Grant’s slides for his presentation over on his site – note that you will need Flash Player 10 beta installed as he makes use of the new 3D features present

Platform Jujitsu

Lee Brimelow

Lee (who runs theflashblog.com) came back in the afternoon to evangelise about the new CS4 platform, showing us some of the new features available across the entire product line (Flash CS4, Flex Builder 4 and Flash Player 10). He started off his speech by outlining that Flash Developers much be proficient in 5 main areas:

  • Motion and Video
  • Visual Design (using Photoshop and Illustrator)
  • Object Orientated ActionScript
  • Flash and Flash IDE’s
  • Server Side Integration

With the introduction out of the way, Lee went on to talk about some of the new features in Flash Player 10. First up was native 3D – this provides full antialiased 3D inside with AS3, and, as it’s intrinsic to the player, it’s very fast! Lee stressed that this was meant to compliment, not replace more mature and capable 3D engines like PaperVision (but mentioned that there were plenty of new API’s that those guys would be hooking in to to speed things up). To accompany this, the drawing API has received an overhaul to allow drawing and manipulating programmatically generated 3D Objects

Next up was Adobe’s Advanced Text Engine – this is in the form of an AS3 API which Lee described as bewildering to anyone except “Text Nerds” – he said it provided an incredible amount of control – so much so that they were planning to release a CS4 component shortly after release which would allow “normal people” to harness it’s power – he did however say that this component would not ship with CS4.

Flash Player 10 will incorporate a host of “tweaks” including true Hardware Acceleration which will improve the speed of Video and Bitmap Manipulation (Filters, Pixel Bender operations). Local file access will be included (but will require user prompts), the previously mentioned unloadAndStop() method will be added and the new Vector datatype for strongly typed Arrays.

One of the new features that Lee was getting excited about was Pixel Bender – this allows image processing with shaders and filters and looked very interesting. Lee showed a custom demo where he created his own filter in HLSL (High Level Shader Language – which looked a bit like C#). One of the most exciting things about Pixel Bender is the fact that it is threaded separately from Flash Player – Lee said that complex calculations could be passed off to the Pixel Bener to allow for Mutli Threading in Flash Applications – if this is true, and it’s as easy as Lee hinted then this will be a major break through for Flash Player and will be immensely useful for complex Flash Apps.

Lee proceeded to talk about Adobe Air 1.5 and Flex Builder 4, neither of which sounded very exciting – alough Flex 4 will feature (yet another) XML based language for handling graphics in Flex.

Finally, Lee showed us some of the features of the new Flash CS4 IDE including live previews of 3d Images. The Flash Properties Panel now includes a new Z property alongside the traditional x and y which allows you to move symbols in space (away from the camera) – he whipped up a simple, live demonstration of this which was very impressive, however, he insisted the really cold 3D features would only be available via AS3 scripting. He wrapped up his Flash CS4 presentation by mentioning that the Flash IDE ActionScript Panel had not been touched in this release – in his own words – fail.

The Best 8 to 12 Hours of My Life

Robert Hodgin

The day ended with a visual presentation by Robert Hodgin who specialises in Audio Visualisation code – whilst not ActionScript based, his visuals provided some inspiring ideas and concepts along with a recommendation that the audience branch out and try a hit of ‘cid if they haven’t had the privilege.

Back to top ↑4