Home 3D Art Showcase & Critiques

Avengers Global Chaos: 2D Platformer build with Unity and Starling Flash

sublime tool
Offline / Send Message
renderhjs sublime tool
Note: This project was completely a while ago but it took a while for me to get an okay from to post about the development of this project. Its a pitty that it was done as a flash game in a time when the platform lost its glory. But I hope that you enjoy this write up and screenshot collection of behind the scenes as I think there are several unique techniques and ideas used for the development that I haven't come across myself before elsewhere.


18948906689_7f37b4ef91_o.jpg

Avengers: Age Of Ultron – Global Chaos is a puzzle/action platformer available online at: www.globalchaos.marveluniverse.com.au. This project turned out to be rather ambitious, which is why we want to share some behind-the-scenes info.

Development on Global Chaos lasted roughly two to three months and involved four people, almost the same team that worked on Gangster Squad, another ambitious Flash game Soap developed two years ago.

19138462131_3035592c3d_o.jpg

The game was built using the Starling framework. Nape physics was used for the engine, and Dragon Bones for the character animations. For the levels we used the Unity Editor that allowed us to export the levels into AS3 code, that would then compile into the game engine.
A special build of ShoeBox repacked Dragon Bones and level sprites into master sprite sheets.

The game features 13 Levels, 13 unique enemies, over 240 sounds effects, more than 170 lines of dialogue and about 250 painted sprites.


Concept

Soap initially pitched an idea to Marvel and V-Energy based on two Soap properties: Wolverine M.R.D. Escape and Tokyo Fury. Unlike these previous games, Global Chaos would feature four heroes from the upcoming Avengers movie as playable characters, and the gameplay would be divided between solving puzzles, battling enemies and exploring the levels.

18949964269_834330dd53_o.jpg

Early on in development we locked down some of the game’s elements: 12+ levels, enemy designs, boss battles and various level obstacles. Each of the Avengers were supposed to have special abilities that would allow them to overcome certain challenges throughout the levels. We also planned to have a single interaction key that would manipulate elements of the environment, such as doors, elevators and security systems.

19136105795_cf6cf98637_o.jpg


Characters

The game features four playable heroes: Captain America, Iron Man, Thor and Hulk. In the beginning we planned to have dynamic rim lighting for each character, but this idea was scrapped due to technical difficulties.

18949983669_f1e3792de5_o.jpg

The roster of enemies consists of Ultron Sentries, Hydra Guards, and a range of drones, cameras and turrets themed around Hydra and Stark Industries. The game also features three bosses – Ultron Prime, the villain Taskmaster, and the head of Hydra Baron Strucker.

18948525928_c4e26c0098_o.jpg

For some enemies we prepared special chunk sprites so that the units could explode into smaller pieces from their standard animation state.


Environments

All environment sprites were painted at two to three times the resolution compared to their final size. Since the perspective effect is only achieved within the engine, mockups like these were drawn in such a way that they would show the front and side pieces of an element.

18948424040_f5df9e545e_o.jpg

For the Avengers Tower levels we wanted to have lots of lights, transparent materials and reflective surfaces. Cameras and security systems were designed to fit within the theme.

19130419302_30dcf499de_o.jpg

The St James Station levels have a brown color palette and a large tiling texture to fill the edges around the map.

19130429482_ce45eb179e_o.jpg

As a special render pass in the engine we used light brushes to give the levels an atmospheric look. All brushes were saved as white sprites so they could be tinted using vertex colors in the engine.

19136171885_1d5beb92c8_o.jpg19136183485_6179214b26_o.jpg

Inside the engine a combination of two blend modes blend the light into the environment.

18515562453_13cf5f5b3b_o.jpg


to be continued with part 2...

Replies

  • renderhjs
    Offline / Send Message
    renderhjs sublime tool
    Animations

    We used Dragon Bones to animate inside Flash, but exported the animations to a GPU-friendly set of textures and skeleton files. One of the many advantages of this method is that it allowed us to blend any animation clip with another, with the results displaying at a smooth 60 fps.

    19131485592_4a4b752615_o.gif18948536130_3c6043532e_o.gif

    When preparing the animation rigs we noticed that tracing the painted characters as vector graphics made them easier to manage inside Flash. For example, when there was a need to apply additional volume to body parts to assist with animation, we could simply paint inside Flash using vector brushes.

    19139710601_da015fdb7a_o.jpg

    For the engine we placed events on a timeline combined with labels to trigger animations and scripts that wait for an event before continuing certain elements. This allowed us to sync footstep sound effects with character walking animations, and made it easy to link the release of Captain America’s shield to the exact frame of the animation that fires the event.

    19110158946_1a2df71c32_o.gif

    Each character has free look controls that override the moving body parts driven by Dragon Bones. This helps to communicate where the player is aiming. For the enemies, we programmed the animations to track the head of the player location, allowing them to dynamically follow the heroes around the screen.

    19130612392_7b23a8d353_o.gif18948751278_590fe7df3f_o.gif

    When you put everything together you get very smooth animations that blend nicely when triggering different states. With traditional Flash technology and MovieClips this would not be possible.


    Story

    Marvel wrote a story synopsis for the game that featured boss battles, humorous moments and plenty of opportunities for puzzles and battles. We used the synopsis to work out level layouts and enemy designs. The synopsis was then developed into character dialogue, which was entered into a spreadsheet.

    19110199116_66989304a3_o.jpg

    Custom in-house tools convert the spreadsheet data into C# and AS3 code, making it simple to test dialogue changes quickly inside the game. We placed trigger zones in levels that initiated specific dialogue exchanges. Some lines of the dialogue data are actually commands that instruct the engine to pan to a specific location or end a level.


    Levels

    Before we commenced with level design we created a list of items that we wanted to introduce to the player and use throughout the levels. This gave us a rough idea of level structure, allowing us to block out levels in a very low pixel art style.

    18513849374_e3fe87f9b7_o.jpg

    A Unity script would then build them into playable levels with the click of a button, allowing for quick iteration of new layout changes.

    18513858874_bcd2fef2a0_o.jpg

    Once happy with the direction we would start building the real level using path objects, which in turn would be used to create colliders, profiles and 3D surfaces. Next we placed enemies, triggers and prefabs – such as elevators, doors or hackable terminals – throughout the levels. A lot of the complex objects were prefabs that just needed to be dragged into the level.

    18950253649_2e50ca25c5_o.jpg

    The last stage involved adding all the additional decoration, lights, and AI nodes.


    to be continued with part 23...
  • renderhjs
    Offline / Send Message
    renderhjs sublime tool
    Technology

    At the beginning of the project we looked into existing engines for Flash, including a technology developed at Soap for an unreleased game called Ninja-X, and the Citrus Engine, which is built on top of Starling and two physics engines. Neither engine turned out to be suitable for the game’s need. Citrus was initially promising and the first prototypes were built using it, but the framework seemed more targeted to simple games, making it difficult to really modify or change some of the more advanced elements for Global Chaos.

    19139821411_fac49d705f_o.jpg

    One of the first tests for the engine was to parse level data from Unity and a dynamic trigger system that allows to create doors, moving platforms and switches. After we had a prototype that demonstrated the trigger system we abandoned Citrus Engine as it was not the right fit, focussing instead on developing a system that allowed rendering of 3D elements and custom character handling.

    In the end we combined several well-known libraries such as Starling for the framework base, Nape for the physics, Dragon Bones for the character animations, as3libwebp for the texture compressions and SoundAs for the audio manager.

    19137224485_8af5ace436_o.gif18949632588_4a4882ccc5_o.gif

    Inside the Unity Editor we were able to place, move and create 3D elements easily. Most elements in the engine are 2D sprites at different parallax depths. For the slopes and 3D faces we used a custom object in Unity that creates a path based slope. Inside Starling we hacked into the sprite rendering classes to support trapezoid distortions of quadrilateral surfaces..

    18949554850_03fe4b2166_o.gif18516653903_105686c95e_o.gif

    One unique element of the engine is how it separates render passes into layers and composites them into a final result. The Dragon Bone characters are placed like a sandwich between the 3D rendered layers. Additionally there is a light pass that uses two blend modes to create an atmospheric look.

    18951154149_90db1a802e_o.gif

    Performance was a big concern as Global Chaos wasn’t always running smoothly on older Apple systems that don’t support certain hardware accelerated features. One optimisation trick was adding Quad Trees that dramatically improved engine speeds in the larger levels.

    18951164599_fbc06429c5_o.jpg

    Beyond that we added support for variable framerates which meant that even when the game slows down to just 15 fps all projectiles and movements still respond as smoothly as they do at 60 fps.

    We added a node editor to manage the A.I., using nodes to define the rooms through which enemy bots can travel. To randomize the movement patterns circular volumes for each node location were used.

    18514784734_b3806b9d34_o.jpg

    We used a modified version of the library SoundAs that supports random playback from an array of sounds. The sound file identifiers would have a common prefix like ironman_hit_{1-8}, and every time an event triggered ‘ironman_hit_’ it would pick randomly from eight variations of the sound.

    Another modification was to add spatial sound so that sounds from elevators, explosions and guards give the player a sense of their physical location in the world.

    19111150056_7b13de59fc_o.jpg


    Tools

    The most crucial tool for this project was the level editor – a panel inside Unity that allowed us to convert level data into engine-specific AS3 code, and display or hide specific engine elements.

    19111159996_f77d3f75ba_o.jpg

    The triggers can be edited visually and no programming is required to set up events, buttons or certain actions. There are about 12 different trigger types and 6 different actions a trigger can initiate. Through a debug mode in the engine we were able to see the triggersoperate in real-time while playtesting.

    19137338375_c5693b2cd6_o.gif19137498595_46ab68599b_o.gif

    The profiles and 3D surfaces were built in Unity with a path editor. A node editor allowed us to place and connect A.I. nodes throughout the levels.

    editor_path_editor.gifeditor_node_editor.gif

    We used a special version of ShoeBox-M for the sprite packing and compression. This new version can read sub-directories and atlases, which it then combines with everything else. Another new feature of ShoeBox-M is the WebP image format. With WebP compression we were able to reduce the PNG file sizes to just 20% of the originals.

    19137995695_d4b6a1af52_o.jpg
  • iLKke
    Offline / Send Message
    iLKke polycounter lvl 7
    Thanks for going through the massive effort to compile this.
    Hopefully peeps find it useful!
  • AsaNYC
    Offline / Send Message
    AsaNYC polycounter lvl 15
    Where others would have left a promotional art dump, RenderHJS brings a gamasutra article. Illuminating and fascinating like all of your posts. Thank you for taking the time and effort to present this. Excellent look into the workflow for making something like this in only three months.

    You've already shared so much, but is there anything you would do differently if you had to do a sequel or a similar (ninja) game to follow this?
  • renderhjs
    Offline / Send Message
    renderhjs sublime tool
    @AsaNYC: Thanks, your response made my day.
    AsaNYC wrote: »
    ...
    You've already shared so much, but is there anything you would do differently if you had to do a sequel or a similar (ninja) game to follow this?

    The flash target platform was decided higher up to maximize compatibility with the game in the browser (higher reach).
    But personally I would have preferred to have the whole game development inside Unity and in C#. I grew up with Flash development from the early days but these days Adobe doesn't innovate at all and so their tools and pipeline are quite outdated. Unity on the other hand is having spring time and doing many things right - in particular their IDE is great for game development.



    Things that I would like to have added

    There were a couple of features that never made it into the game such as an advanced AI communication system. At the base the bots already had 4 states that they would communicate with the player
    19065383250_b39a67dd62_o.jpg
    But what I wanted on top of that was to place description tags inside the level and then have the bots dynamically generate phrases where they would communicate with the player that they knew where something moved, that they saw a particular character.
    For example if you played the Hulk character and just got seen by a weak bot, the bot would say to other bots something like "Run! its a green monster". Or if you were spotted next to an elevator the bot might say something like "I know that you are near the elevator".

    This screenshot shows some of the red nodes that were supposed to be AI sentence nodes.
    19226903966_bbe21f3583_o.jpg

    A spreadsheet with data with its own syntax would then generate sentences based on the condition the bot interacted with the player, e.g. confirmed the player, or is trying to flee or taunting the player.
    19258241481_c098b5018d_o.jpg
    When all put together, the bots would be able to to have highly contextual phrases (which player, location, repetition,..) that they would throw at the player.



    The levels in hindsight took a lot of time to build, and training for the level editor should have started earlier. Since I wrote the editor I knew all the features in and out (and I had the most expierence in Unity which is used as a base for the editor). But I also depended on others to help with the level designs and I think in the end the workflow for the level design should have been much more automated. Like we already used the pixel layouts for the design, I think a single button solution to build the detailed levels would have speed up the process and solidified the design and approach on how to make levels.

    A single level has a lot of dedicated elements that have to placed, linked and setup.
    19252962045_6f9ded48fa_o.jpg
    But at a level design core level all it often is just a pixel layout like these
    19256788801_52ffb59a5d_b.jpg

    And so dressing up each level took a lot of time and for the amount of levels that we promised to the client I think this could have been streamlined more.
  • AsaNYC
    Offline / Send Message
    AsaNYC polycounter lvl 15
    I'm trying to figure out how to make a level editor of my own so this is all useful info even though my game isn't similar. But I always learned a lot from your posts over the years so thanks again.

    As a fan of dynamic dialogue systems and comics in particular that would've been neat. Oh well, there's always your next game!
  • JasonLavoie
    Offline / Send Message
    JasonLavoie polycounter lvl 18
    Bah render... dude this is incredible! I've bookmarked it and excited to dig in and re-read it, lots of incredible info here.

    Thank ya so much once again for the knowledge dump! Congrats!
Sign In or Register to comment.