Tuesday, August 1, 2017

Inti-Creates: A Look at the Evolution of the Mega Man Zero engine

Introduction

In 1996, Japanese video game company Inti Creates was formed. Created by ex-Capcom employees, Inti Creates started out by making games exclusively for Sony's PlayStation, being funded by Sony Music. In 1998, they released Speed Power Gunbike, a third person action game. In 1999, they released Love & Destroy. Both of these games did not turn a profit, and soon after, Sony cut ties with the company. In 2000, company vice president Yoshihisa Tsuda spoke to Keiji Inafune, the producer and "father" of the Mega Man series, voicing an interest in making a Mega Man game of their own. Soon after, development of Mega Man Zero began, being made for Nintendo's new portable, the Game Boy Advance.

The game was a success. Video game review sites such as IGN gave the game a 8.8 out of 10. In the first week of its release, the game sold over 66,000 units in Japan. By the end of 2002, it sold over 250,000 units in Japan alone. The sales of the game warranted a sequel, and in less a year, Mega Man Zero 2 was released. This would continue for years, with a new Mega Man Zero game releasing every year. In 2006, Mega Man ZX was released, a new game series that takes place 200 years after the events of Mega Man Zero 4. This game was released for the then brand new Nintendo DS.

If it is not already clear, I adore the Mega Man Zero and Mega Man ZX games. This blog post will cover the technical aspects of the engine which makes these games possible, and what changes were made with each title.

Mega Man Zero 1


Hardware


Mega Man Zero began development not long after the release of Mega Man X5. X5 was developed on the Playstation, as was many Mega Man titles during that time period. Allowing for CD-quality audio, a high resolution 320x240 display, and a considerable amount of video memory for storing graphics, the Playstation hardware was considerably more powerful than the GBA. Because of this, certain compromises were made while developing Zero 1.

The screen resolution of the GBA was only 240x160 pixels. To avoid screen crunch, an issue where on-screen objects take up too much screen space, the resolution of game objects had to be reduced. The GBA relied on cartridges, which had considerably less storage than the CD-ROMs of the PlayStation. Where Mega Man X5 could take advantage of over 300 megabytes of data, Zero 1 was limited to only 8 megabytes. As such, full motion video, Redbook music, and voice acting all had to be excluded. For music, MMZ makes use of sequenced "MIDI" tracks, and short, low quality ADPCM audio clips for instrument samples and sound effects. The PlayStation had 1 megabyte of video memory, where the GBA only had 96 kilobytes. The GBA also only had a little over 256 kilobytes of main memory, where the PlayStation had 2 megabytes. With less than a tenth of the memory of the PlayStation, Mega Man Zero 1 opted for less complex graphics. Levels would consist of small, repeating, backgrounds. This would reduce the amount of necessary memory but would lower the overall detail of scenery.

Graphics


Most sprite data is stored as 4 bits per pixel images. All of this data is stored at the end of the ROM, packed together like a sprite sheet. Depending on the intended use of the graphics data, it may be organized in tiles of varying sizes. For example, stage tiles would typically be stored as 8x8 tiles. A table stored in the stage file would take four of these tiles and create a 16x16 "meta-tile", which would be used to represent a portion of the stage.

Some data is compressed using the LZ77 algorithm. The GBA provides relatively high-performance routines for decompressing LZ77 data, stored inside the BIOS. However, a majority of the graphics data is left uncompressed. This is an odd choice, as with the very limited storage on cartridges, taking advantage of compression seems only logical. One could argue that the extra CPU resources required to decompress the data would be too much for a real time environment. While this may be true, there is plenty of data which does not need to be decompressed every frame. Enemy and stage graphics are loaded all at once. Decompressing this data should not cause performance issues. Furthermore, Mega Man Zero 1 makes use of almost all of the 8 megabyte cartridge. With only a handful of kilobytes left unused, it baffles me that they would not make use of compression when they certainly needed it.

Audio


As was the case with many games on the GBA, Mega Man Zero makes use of the Nintendo M4A (Music For Advanced Game Boy) audio library. This library was included with the official GBA software development kit. Not only is music handled with M4A, but also sound effects. The GBA has two channels specifically for PCM audio, Direct Sound 1 and Direct Sound 2. M4A takes all sounds that are playing and mixes them down, before sending them to these channels. Oddly enough, MMZ only makes use of Direct Sound 1. This could be due to the amount of CPU resources necessary for M4A to run. Unlike other audio solutions of the time, M4A runs purely in software. No special hardware exists to assist in the synthesis of audio. This has the unfortanate side effect of limiting the amount of audio samples that can be mixed in a given frame. If too many samples are present, M4A will not be able to mix them all in time, and the audio which is outputted to the GBA will be distorted. Due to these limitations, in-game music uses only a few channels for instruments. Additionally, ambient sounds, such as wind in an outdoor area, are not used.

Text

Text data is embedded in the ROM, uncompressed, in a giant table. All text pieces are packed side by side, making it very easy to dump the text for analysis. However, unlike the PlayStation Mega Man games, text is not encoded in ASCII. Instead, text uses a custom encoding that is tailored towards how the game's font is loaded into the GBA's video memory. This encoding is a stripped down version of ASCII, only containing uppercase letters, lowercase letters, and a few characters for punctuation.

Stages/Levels


Much like other Mega Man titles, stages consist of scenes shown from a side perspective. The Game Boy Advance provides four different background layers. MMZ uses one for the HUD, and the other three for stage components. Most stages make use of parallax scrolling, where different background layers scroll at different speeds to give the illusion of depth. Due to the limited number of background layers, there can only be two parallax backgrounds. Of the four available layers, one is reserved for the HUD, and another is always used for foreground tiles, which make up the layout of the stage.

Mega Man Zero 2, 3, and 4

After the success of Zero 1, Inti Creates made 3 more Zero games. Each one of these games was built in no more than a year, and as such, not much was changed from each title. In fact, all of these games run on the same engine, with only minor changes being made from title to title. For this reason, I will mainly cover gameplay changes.

Mega Man Zero 2 released in 2003. Taking off a year where Zero 1 left off, it features new levels, abilities, and bosses. Zero 2 is built off of the Zero 1 engine. As such, the systems from the prior game are practically identical in this one.

In Zero 2, a new multiplayer mode is added. In such mode, you compete against another player to get the highest score within a time limit. This mode makes use of the Link Cable, an addon for the GBA which allows two systems to be connected to each other.

Zero 3 removes the multiplayer mode, but adds a set of mini games, which are unlocked when the player completes the main game. Not much more can be said about this title.

Zero 4 is by far the most unique of the titles. As it was the last Zero game, Inti Creates opted to work with a 16 megabyte cartridge, doubling the available storage. The game takes full advantage of this. More instrument samples are incorporated for songs, scenery in stages are more detailed, and overall the game feels more polished. It seems that Inti Creates wished to end the series with a bang, and to that end they did not fail.



Mega Man ZX


By the time that Mega Man Zero 4 came out, the GBA was reaching the end of its life cycle. Nintendo had moved on to their new handheld, the Nintendo DS. For these reasons, Inti-Creates migrated to the new hardware, and they brought the Mega Man Zero engine with them. Mega Man ZX takes the MMZ engine and updates it to make full use of the DS hardware. Subsequently, the game has a familiar yet fresh feel to it.

One of the first changes one will notice when playing ZX is the screen size. The DS supports a native resolution of 256x192, compared to the GBA's 240x160. This allows for more objects to be visible on the screen at once.

The audio system in the game also received an upgrade. While sounds are still synthesized by the CPU, the DS comes with two processors, both of which are more powerful than the single one on the GBA. Furthermore, the DS has more bandwidth than the GBA, allowing for more data to be transferred from one system component to another. These factors allow for considerably superior audio quality compared to the GBA. Not only are higher quality samples used, but more audio channels are available, allowing for more complex music and sound effects.

Mega Man ZX Advent


Much like the MMZ sequels, not much was changed with ZX Advent, with one major exception. Where the first game rendered game objects as sprites, Advent throws away this system in favor of a 3D renderer. While the game for the most part is still 2D, sprites are rendered as 3D "quads", which always face the game camera, giving the illusion that they are flat. This was done for multiple reasons. For one, the "2D engine" present on the DS can only render up to 128 sprites, while the "3D engine" can render up 1,536 sprites. Furthermore, ZX Advent makes use of 3D effects in numerous parts of the game. For example, when a boss is defeated, a three-dimensional, spherical explosion is rendered on screen.

No comments:

Post a Comment