Assassin's Creed vs. PlayStation Vita
The behind-the-scenes story on squeezing the AC3 engine into Sony's handheld.
In a continuing series exploring the power of the PlayStation Vita, Digital Foundry talks to Ubisoft Sofia - developers of Assassin's Creed 3: Liberation. This Vita-exclusive title is a remarkable piece of work, successfully translating the full Assassin's Creed experience and the AnvilNext engine that powers it onto a mobile platform.
It's a fascinating game for many reasons - not least of which is Ubisoft's commitment to producing an all-new franchise title built from the ground-up for the handheld, with brand new locations and a fresh cast of characters. Where other studios have downsized their Xbox 360 and PlayStation 3 titles to run on Vita, Ubisoft Sofia made the most of a remarkable opportunity - to shape their game entirely around the strengths and weaknesses of the Sony hardware, at the same time giving PS3 AC3 owners a companion purchase entirely separate and distinct from the main game.
That's not to say that the game is an unmitigated triumph, as the Eurogamer review explored. Resolution takes a hit, there's no anti-aliasing and frame-rate is highly variable to say the least - as you'll see in our video assets below. From a conceptual standpoint, it's also safe to say that some of the ideas - including multiple "guises" for heroine Aveline - misfire somewhat. In a game but relies so much on its free-running traversal mechanic, large sections of gameplay become a little frustrating when the parkour is taken away from you. But where it matters, this is indeed a core Assassin's Creed game and despite its faults, it remains one of our favourite Vita titles.
In this deep dive interview, Ubisoft Sofia technical directors Mikhail Lozanov, Ivan Azmanov and Stefan Dyulagerov along with lead artists Biser Parashkevov and Borislav Bogdanov talk us through the creation of one of the most technologically ambitious mobile games on the market today.
Sony did a great job extracting performance from mobile hardware, with well-written software. Performance improvements from their libraries were substantial compared to other mobile vendors running on similar hardware.
At the start of the project we tested the Vita with a version of Anvil used in a previously released Assassin's Creed title, but soon realised that AnvilNext from AC3 presented far greater capabilities and opportunities when combined with the Vita's hardware. Thus we switched to that engine at the earliest possible moment.
"Direct access to the hardware stimulates developers to create a unique look and feel for their games - it could be compared to the early days of demo-scene - create what is thought to be impossible."
Clearly the CPU is slower than the current generation of home consoles but the internal architecture of the engine benefits from having multiple cores. However, not being able to access the fourth core affected the way we submitted the tasks to those cores - we had to introduce new algorithmic optimisations and SIMD-ify some parts. The biggest optimisations came from saving some unnecessary calculations or at least not performing them so frequently.
One of the bigger challenges we faced was in the simulation of city life. Initially we were not sure how many characters we could process on the Vita, but by using the CPU's out-of-order execution the AI code executed very efficiently. We had to optimise some portions of the code and slightly reduce the number of characters, but with some clever game and level design tricks we were able to replicate the core definition of the Assassin's Creed brand - living, breathing cities with numerous characters interacting with each other.
PS Vita is a truly dedicated gaming console. It has precise controls and powerful hardware. It is true that some smartphones and tablets have more powerful hardware, but you cannot use them to their full capacity because those devices must do all sorts of other tasks than gaming - answer phone calls, receive emails etc.
The PS Vita OS is very light and does not interfere with your title. Direct access to the hardware guarantees that developers can get creative on how to use the memory, shaders, and do some tricks to get faster and better-looking lighting while on iOS and Android you have to go use the drivers provided to you. Unfortunately there is no other option so this can be very limiting in regards to the features which you can implement and also introduces another layer which again reduces performance while introducing standardised APIs to access different hardware.
Direct access to the hardware stimulates developers to create a unique look and feel for their games - it could be compared to the early days of demo-scene - create what is thought to be impossible. In our case this affected the internal architecture of the graphics parts which would not be possible on Android or iOS.
The AC Engine and tool set are solid - we used everything barring a few exceptions. There were the usual customisations, but all of them were directly connected to Vita's specific hardware - touch screen, different texture formats, GPU shader code.
"We never looked at Liberation as a port of its bigger brother - it was designed from the ground up to fit the Vita's features and the console itself."
Porting AC3 on Vita could be compared to putting an elephant in a matchbox. It is a huge game. One of the problems that we would have face is the sheer number of NPCs visible on the screen where AC3 broke some technical ground. There would just be no way to show so many on Vita as on the home console versions.
Another problem would have been the lighting and special effects - a big chunk of the game's look is defined by them and it would be impossible to match the same quality. Last but not least of course is the game data size. There is no game card with a capability of a Blu-ray (at least not yet) so how do you fit so much data on a Vita game card?
We were mandated to deliver a full "AC experience" on a portable console, and this can sound downright scary taking into account how complex Assassin's Creed is. However, we never looked at Liberation as a port of its bigger brother - it was always designed from the ground up to fit the Vita's features and the console itself. Because we were in a pretty unique position - an all-new title with a new heroine, new era and in a never before experienced setting in the brand - that gave us an opportunity to introduce technical decisions that had obvious implications on game design and subsequently on gameplay. It allowed us to plan ahead on where the CPU and GPU ticks were going to be spent, plan how and what to optimise, design and introduce technical solutions which would match the hardware.
Since we started from the AnvilNext engine, which has been designed and created for home consoles, we faced a number of challenges in level and character creation. However because we were building an Assassin's Creed title from the ground up, it gave us the scope to design around those potential issues.
For the game world, New Orleans was specially designed to work with the hardware specifications of the Vita. For example, if we had ported Boston from AC3, the layout would have had to be modified to such an extent that it would lose the whole idea of huge wide boulevards. The narrow streets of New Orleans were a perfect fit for this and subsequently specially designed to properly occlude the assets and thus allowing us to put in a much higher graphical and population density. Each house and prop was designed, modeled and textured to make the most effective use of the Vita hardware, for example using atlas maps to combine textures to achieve high quality and process efficient visuals. The collisions were created with a very optimal shape that ensured fluid movement of Aveline around the city and the swamp. The shaders were also especially tailored for optimal usage of the GPU and without sacrifices to visual quality.
On the character creation side, most of the technical improvements were based on the need to compensate optimisations of an already existing technology and at the same time achieve a high level of realisation and visual quality. The small screen required a new approach to details so we were required to work around the idea to achieve nice detailed characters with good readability and at the same time fit into the poly count budgets. To achieve this, we dropped the usage of alphas in the textures to free performance and trade it for geometry, meaning that all details that we were used to creating with the help of alpha channel before were now modeled and integrated in one piece of geometry.
Another big improvement that enhanced the visual quality of the characters was implementation of rim light into the characters shader in order to bring more details and integrate the characters into the environments while achieving visual consistency. This approach gave us the freedom to further light the characters on the top of global lightning. In the field of rigging and skinning, we also optimised the number of bones used per character and created specially designed rigs to achieve realistic cloth simulation.
"New Orleans was specially designed to work with the hardware specifications of the Vita."
Using deferred rendering was actually more efficient and improved the game's overall performance, allowing us to dedicate more processing power to the gameplay, city life and all the other elements that are core to a full Assassin's Creed title.
Liberation is graphically very demanding - the amount of work the GPU has to do is much more demanding on the hardware resources compared to typical iOS and Android titles. So in order to achieve and maintain the highest overall quality we decided to reduce the resolution to 720x384. We also lowered the GPU frequency to extend the battery life and enable long play time for players on the move.
Since we didn't have as much power as the home consoles, we had to be very selective and efficient with regards to optimisation. Some of the areas and techniques we focused on included optimising critical parts of the engine for the Vita CPU (Neon), redistributing tasks between the cores, and distributing calculations between frames.
Fights are the most stressful element on the CPU and GPU, and given the open world nature of an Assassin's Creed game there were occasions where some trade-offs of the frame-rate needed to be made during combat. However, we considered this a more acceptable compromise compared to cutting other elements - such as having a city devoid of NPCs.
We also used a dynamic loading system which sometimes caused drops in the frame-rate, but this was unfortunately inevitable given the amount of graphical detail and data in Liberation.
Mobile gaming hardware is growing very fast, but there are still only two dedicated portable gaming devices out there. The Vita is in a very good position because it sports all the good features from home consoles combined with cool features like touch screens and GPS. We also think that the Playstation Network plays a huge part of the Vita's position on the market and that Sony is doing an amazing job with it. Taking into account the recent price drop, a huge backlog of PSP, PSN and Playstation Mobile titles as well as support from AAA games, which have already appeared on the console, it is not hard to see that Vita has a nice future ahead.