[breakdown] Shadow of the Colossus (PAL – PS2)

I’m a big fan of the game Shadow of the Colossus. It’s an important influence for my own projects today. I’m still amazed about how they were able to handle so impressive Colossi and environments on a console like the Playstation 2. I started some month ago to try to go deeper on how the game was made. I’m interested about the technical side only. If you are also interested about the story and the environments I recommend you to read the blog of Nomad.

So the following blog post is a breakdown of the game from my personal point of view (I don’t know at all how it was made originally). The purpose is educational and the work presented here go to their respective authors.

The Fur

The first thing which fascinated me in the game was of course the Colossi and especially the fur on them which give an incredible look to them. I have done some search on how to generate fur for real-time rendering and I found some papers here and here. And even if the making of Shadow of Colossus explain a bit how they have done this part of the Colossi, it is still a bit blurred in my mind. This is certainly the main reason why I wanted to extract and look inside the game : understand THEIR fur technique.

I’m amazed on how clever their technique is. (Note that they use a similar one for the grass ingame in certain areas.) So, how does the FUR work exactly ? The Colossi use 2 different techniques to display the Fur : a set of planar polygons and some tufts (single quads).

-The tufts are very simple to understand, they are just simple planes (a single quad grouped) to give the feeling of a tufts. While the tufts are cool to see, they are in a very limited number, they are mostly used the give a better transitions between the parts with and without fur.

-The Fur applied for the big parts of the Colossi are a set of polygon layers. 6 is the common number, but some Colossis can go higher (the first one has 8 layers for example). The layers are spaced with the equivalent of the height of the player’s hand (I know, that a strange reference). There is 1 single fur texture but in 3 versions : white, grey and one more darker (but not black). So the layers are divided in 3 groups, 2 layers use the same diffuse texture. The alpha texture used to blend the whole fur is maybe common and smaller, there is a 64×64 pixels texture used as the base for the fur which can be used as an alpha texture. These textures are only with shade of grey, the color of the fur comes with the vertex colors. The vertex colors are also used to blend the borders of the layers and smooth the transition of the fur with the skin.

Note that the vertex color are also used to give a natural Ambient Occlusion to the Colossi. Avion is a good example, he has a very nice blue shadow on his belly.


The Playstation 2 has a strong bandwidth to deal with the textures and the vRam (48gb per second, double of what the Playstation 3 have today). The PS2 has also an excellent fillrate which made the overdraw of the fur a not so big problem.

Yet, it’s really an heavy technique and combined with huge landscapes it’s not surprising that the game when it comes out was lagging/slow. Still, it’s a nice performance and was most of the time playable. Also : “[…] the PS2 could only sample a single texture, and either add or alpha blend with the screen.” (Source) This explain maybe why the fur is only composed with 2 distinctive alpha textures (one for the layers and one for the tufts). Note that even the PS3 version today is still slow sometimes (but the hardware is quite different so it’s hard to compare), take a look at the comparison by Eurogamer.

Since the number of textures is limited, the developers used some tricks to avoid boring and repetitive patterns on the Colossi. First, they flipped in some areas of the UVs, which make the texture to look like a mirror (see the image below). By thy ways they were able to make new directions for the fur while the texture is still the same. They have also worked the fur texture to be rotated by 180 degrees without worrying about the tilling errors.

They have also worked on the volume and the direction of the fur. For the volume, as explained a bit before, they used different luminosity of textures and layers to fake the depth. To increase this feeling they have subtly inflated each layer of polygons (see image above). Naturally, when you have a bunch of hairs, they rarely stay straight and most of the time they bend a bit : the inflate is made to give this feeling.

For the direction since my model extractor doesn’t keep the UVs I can’t be really sure, but here is my deductions : the geometry of each layer is not only inflated but also tweak to increase the edges direction. This way you increase the flow of the fur and give a direction. Note also that the texture is also giving a direction by itself (that’s why you can’t rotate the fur textures by 90 degrees). Some example of tests with layered fur often use only points superposed. I’m also wondering if they also tweak the UVs to increase even more the flow of the texture, but since I can’t see the UVs I can’t be sure.

Below is a test of the texture from the game with some plane that I have made myself. In the second screenshot I have slightly moved each plane away (there is 6 layers) which give a direction to the hairs :

By combining the geometry direction with the texture direction they have at the end a very believable fur.

The Colossi – Polycount and Modeling

The colossi are made with tiling textures mostly, it’s the cheapest way to add variety with a little memory footprint. You can also see that the textures are very, very sharp (a lot a bright pixels in them) mostly to counteract the bilinear filtering and the mip-map blurring when you are ingame.

To see the images in full size, click on a thumbnail then right click on the image and chose “View Image” (with the middle mouse button to open it in a new tab).

——–

1# – minotaur_A.nmo (Valus)
Polycount : 19144 triangles (25642 vertices and 3249 strips)
Number of textures : 26 (6 are 64×64, 20 are 128×128)
Number of bones : 39 (5 for the beard, 16 per hand)

Notice the triangle floating in front of his beard : this triangle is hidden by the texture ingame but if you look at the bones, you will see that this triangle is used to be skinned to the chain of bones. This is because the bones were probably used to attach something (which is not the case in the final game). Since a 3d package doesn’t export bones that are not skinned, they used a dummy geometry (here the triangle) and hided it. You will see with that specific skeleton used on other Colossi, which explain why some Colossi don’t use alpha the bones available.

Additional mesh :
-minotaur_A_hiza.nmo (armor protection)
-minotaur_A_weapon.nmo (the club)


2# – boss_A.nmo (Quadratus)
Polycount : 15945 triangles (22411 vertices and 3239 strips)
Number of textures : 23 (1 is 16×16, 6 are 64×64, 1 is 256×256, 15 are 128×128)
Number of bones : 19 (1 is used for the bottom of the neck)

There is one thing that’s perturbs me about this colossus : why do they use a 256×256 texture ? The texture is not even used on big parts of the mesh, only for broken “bones” on his back. In SotC the camera is in third person and while you are climbing the Colossus it take some steps back to give you an overall look. So using a 256×256 textures is a bit weird, you don’t gain details with it. But since there is the mip-map system, with the distance of the camera in-game, I don’t think you get a problem of performance.


#3 – knight_A.nmo (Gaius)
Polycount : 20773 triangles (27367 vertices and 3297 strips)
Number of textures : 24 (3 are 64×64, 21 are 128×128)
Number of bones : 20 (4 per leg, 4 per arm)

On this colossus, I’m intrigued about why there is an extra bone for the legs. Why do they needed a toe bone when for the first two Colossi they didn’t ? Maybe different animators and then different needs, so the rigs of the Colossi where personalized per animator ?



4# – kirin_A.nmo (Phaedra)
Polycount : 20629 triangles (28019 vertices and 3695 strips)
Number of textures : 23 (1 is 16×16, 3 are 64×64, 19 are 128×128)
Number of bones : 24 (2 for the physics at the back, 3 for the physics in the front) | +4×2 for the head’s chains. (Total of 32 bones)

The chains which are attached to the head in the game are in external files. They have there own bones which are attached to the main bone of the head later in-game.


Additional mesh :
-kirin_A_hashigo_l.nmo (left chain)
-kirin_A_hashigo_r.nmo (right chain)


5# – bird_A.nmo (Avion)
Polycount : 17704 triangles (23246 vertices and 2771 strips)
Number of textures : 16 (1 is 16×16, 2 are 64×64, 13 are 128×128)
Number of bones : 52 (11 for the tail, 11 per leg, 5 per wing)

Avion has a lot of bones, mostly because he fly and need smooth animations.


6# – minotaur_B.nmo (Barba)
Polycount : 18953 triangles (25533 vertices and 3290 strips) | beard (1605 vertices, 226 strips)
Number of textures : 26 (see Colossus #1)
Number of bones : 39 (see Colossus #1)

Quite similar to the first Colossus (they share the same geometry for the legs and the arms) this one doesn’t wear fur on his legs but he has a physics beard. He also share exactly the same texture set as the first Colossus. They also have the same skeleton, which mean the same numbers of bones and the same hidden triangle. They certainly made 1 skeleton for the 3 minotaur. This explain why there is 5 bones for the beard but not used on every Colossi. They also share some animations between the 3 minotaurs (walk, shake, etc).

However, I don’t understand why they needed to put these 5 bones for the beard on this skeleton when you compare to the 4th Colossus. For the 4th the bones are in external files which were enough, so why double the bones for the minotaur since the beard file already have its own bones ?


Additional mesh :
-minotaur_B_hige.nmo (beard)


7# – eel_B.nmo (Hydrus)
Polycount : 17633 triangles (25147 vertices and 3757 strips)
Number of textures : 24 (1 is 16×16, 2 are 64×64, 21 are 128×128)
Number of bones : 49 (3 per fin, 5 for the front barbels)

A lot of bones for this one but again it’s logical. As for the 5th Colossus (Avion) you need here smooth animations which require a lot of bones. The electric pulse are simply made with two plane which interpenetrate themselves.


Additional mesh :
eel_pulse_lightning.nmo (Electric field, local)
eel_pulse_glory.nmo (???)
eel_pulse_lightning_upper_water.nmo (Electric field, group)


8# – yamori_B.nmo (Kuromori)
Polycount : 17403 triangles (24067 vertices and 3332 strips)
Number of textures : 26 (1 is 256×256, 2 are 16×16, 7 are 64×64, 17 are 128×128)
Number of bones : 62 (32 per foot, 3 for the head)


Additional mesh :
yamori_B_footmark.nmo (footprint for the ground, decal)
yamori_b_breath_ball.nmo (Plasma bullet, when the colossus fire on you)


9# – kame_A.nmo (Basaran)
Polycount : 17601 triangles (24675 vertices and 3537 strips)
Number of textures : 23 (1 is 16×16, 2 are 64×64, 1 is 256×256, 19 are 128×128)
Number of bones : 22 (4 per legs)



10# – narga_A.nmo (Dirge)
Polycount : 10346 triangles (14332 vertices and 1993 strips) | Head 3915 triangles (5623 vertices and 854 strips)
Number of textures : 17 (1 is 16×16, 2 are 64×64, 14 are 128×128) | Head 11 (8 are 128×128, 1 is 16×16, 2 are 64×64)
Number of bones : 25 (20 for the body, 5 for the head).

What a curious process for this one. I really don’t understand why they put the head in another mesh instead of making only one mesh like for Hydrus (7th Colossus). Maybe they hide/cull the head when he is underground ? (Remember the fight, he is a sand snake and run after you in a cave.) Anyway, on the body you can notice the same dummy triangle polygon as for the minotaurs : it is used to skin the bone of the head.


Additional mesh :
narga_A_head.nmo (Head)


11# – leo_A.nmo (Celosia)
Polycount : 12150 triangles (16796 vertices and 2323 strips) -> The armor is not counted
Number of textures : 16 (12 are 128×128, 3 are 64×64, 1 is 16×16)
Number of bones : 29 (6 per front leg, 5 per back leg)

This Colossus has small color difference in his textures. The fur textures doesn’t have a difference of brightness, they are also colored in orange/yellow. Same thing for the tufts. Compared to the other Colossi, the brick/rock textures are also colored a bit, there is a subtle orange tone in them. The armor parts are in external files for obvious reasons : since this Colossus lost these parts during the fight, it’s logical to not integrate them in the main body.


Additional mesh :
leo_A_koura1_1.nmo (Armor protection)
leo_A_koura1_2.nmo (Armor protection)
leo_A_koura2_1.nmo (Armor protection)
leo_A_koura2_2.nmo (Armor protection)
leo_A_koura3_1.nmo (Armor protection)
leo_A_koura3_2.nmo (Armor protection)
leo_A_koura4_1.nmo (Armor protection)

leo_A_koura1.nmo (Armor protection)
leo_A_koura2.nmo (Armor protection)
leo_A_koura3.nmo (Armor protection)
leo_A_koura4.nmo (Armor protection)


12# – poseidon_A.nmo (Pelagia)
Polycount : 18409 triangles (24653 vertices and 3122 strips)
Number of textures : 21 (16 are 128×128, 3 are 64×64, 2 are 256×256)
Number of bones : 20 (3 per leg)



13# – snake_C.nmo (Phalanx)
Polycount : 19476 triangles (26730 vertices and 3627 strips)
Number of textures : 25 (17 are 128×128, 1 is 16×16, 7 are 64×64)
Number of bones : 114

This Colossus use a lot of bones, especially for the balloons on his belly. This Colossus is one of the most impressive technically : very big, a lot of bones used and yet still under the polycount of 20 000 triangles. During the fight there is also a lot of dust particles. Probably one of the heaviest Colossus for the game.



14# – cerberus_A.nmo (Cenosia)
Polycount : 6321 triangles (8559 vertices and 1119 strips) | Head 2448 triangles (3075 vertices, 313 stripes)
Number of textures : 11 (5 are 128×128, 5 are 64×64, 1 is 16×16)
Number of bones : 27 (5 per leg)

The body and the head share the same set of textures, however the head don’t use all of them (of course not the fur). The head doesn’t have any bones, I guess she is fixed on the body without any skinning. This Colossus use the same skeleton as for the 11th. They share some animations during the game.


Additional mesh :
cerberus_eye_in.nmo (eyeball)
cerberus_eye_mabuta.nmo (eyeball)
cerberus_eye_R_pos.nmo (eyeball)
cerberus_eye_L_pos.nmo (eyeball)
null_cerberus_armor_before_head.nmo (Colossus’ head)
null_cerberus_armor_before_neck1.nmo (Neck armor)
null_cerberus_armor_before_neck2.nmo (Neck armor)
null_cerberus_armor_before_back.nmo (Back armor)
null_cerberus_armor_before_kata_l.nmo (Leg armor)
null_cerberus_armor_before_kata_r.nmo (Leg armor)
null_cerberus_armor_after_head.nmo (Colossus’ head – Broken)
null_cerberus_armor_after_kata_l.nmo (Broken leg armor)
null_cerberus_armor_after_kata_r.nmo (Broken leg armor)


15# – minotaur_C.nmo (Argus)
Polycount : 21256 triangles (27600 vertices and 3172 strips)
Number of textures : 26 (see Colossus #1)
Number of bones : 39 (see Colossus #1)

As for the two previous minotaur, this one have exactly the same skeleton (and also use some common animations). You have here too the dummy triangle.


Additional mesh :
minotaur_C_weapon.nmo (sword/cut)
minotaur_C_hiza.nmo (knee armor, same as for the 1st Colossus)


16# – buddha_A.nmo (Malus)
Polycount : 11066 triangles (14540 vertices and 1737 strips)
Number of textures : 29 (1 is 16×16, 2 are 64×64, 26 are 128×128)
Number of bones : 85 (22 per hand)

A lot of parts of this Colossus are in external files, probably for hiding/culling them during the fight (since at the end of the fight you focus yourself on the head, you probably don’t have to worry about the dress ?).


Additional mesh :
buddha_A_kao.nmo (horn + eye)
buddha_A_kosi.nmo (dress part)
buddha_A_jowan_r.nmo (left arm armor)
buddha_A_jowan_l.nmo (right arm armor)
buddha_A_ude_r.nmo (left fire/power armor)
buddha_A_ude_l.nmo (left fire/power armor)
buddha_A_momo.nmo (armor)
buddha_A_sune.nmo (armor)

The Colossi – Animations

I will not go too much in depth about the animations, you can see most of them blended nicely in the game. The following video is focused about Avion. The purpose was to see without the game environment how the animations handle the feeling of power and weight that we can have when the Colossi move (with a limited amount of bones).

The environments

In shadow of the Colossus, the environments benefit a strong LOD system combined with a streaming data system. Both system allow the player to run around the world without any loading time (or almost none). A said in the making of, the landscape of the game is divided in parts of 100×100 meters. These parts are named like this :

d7_d7_p03_m01_lyr0.nmo
e7_e7_m03_m01_lyr0.nmo
e7_e7_m02_m01_lyr0.nmo
e7_e7_m01_m01_lyr0.nmo

And so on…

Do you remember what the map of the game looks like ?

Now, you can notice that the 2 first letters of the filenames are probably the same letters as the one used on the map. Which mean if I try to locate the temple… For example with the mesh slow_f4_parts.nmo :

From what I have opened and from my understanding of the nomenclature, every mesh which begin with “slow_” is the maximum distant LOD. So the castle here is a very far distant LOD.
The nomenclature also contain the keyword “lyrX” where X is a number (I have only seen 0 and 1). I guess they are simply “layers” used to organize the meshes (with priorities maybe ?). Often the layers “0” are simply grounds and cliffs, and layers “1” are the sea/water or even architectures.

The nomenclature helps, but it looks like it’s not always a “rule”, a lot of meshes are also named regarding the situation where they are used. It’s still a bit hard to find some specifics locations because the ingame name doesn’t often match with the filenames (same thing for the Colossi by the way).

Above is an example of environment that you can find in the game. What you can see is :
-The lighting which show a nice blue ambient color is saved inside the vertex color.
-The polycount is pretty high for an area like this (especially for the rocks).
-A lot of tiling textures made with 256×256 pixels (compared to the Colossi which use 128×128 most of the time).
-The borders are not regular, it looks like the were spitted with an automatic tool


I will not show more than this, because the global index file is very HUGE (almost 30 000 lines in total, which means 30 000 different files) and reading it without knowing what I’m looking for is very tiring.

Notes and Tools

I have tried and used a bunch of tools to be able to look inside the game. Unfortunately I’m not a good programmer and I’m not able to do good reverse engineering.

This is why I have almost no textures to show since I was unable to extract most of them. Most of the time I use Texmod to read the memory of my computer and test/extratc the texture. Unfortunately, using texmod with Shadow of Colossus is hard. It’s even harder when you read the memory of an emulated game. Shadow of the Colossus use a streaming system which load and unload the textures and meshes in memory when needed.

In the making of the game, the developers said that the memory can become fragmented with the time and the game try to reorganize it. I think this is the reason why Texmod doesn’t work : when you play the textures move in the memory (their address always change) and Texmod can’t follow this (this is why the texture counter of texmod increase like if you had a memory leak). It could be usable, unfortunately the textures move very fast, it’s very hard to highlight a textures more than 5 seconds. Also Texmod doesn’t like the emulator which make the textures extracted very weird (256×1 pixels for most of the textures that I have extracted).

I used the following tools :
“Dormin” – http://www.youtube.com/watch?v=aDhOx3fMFEE
“glxtractor” – http://members.chello.at/alexan/

I believe that the source code of Dormin allow an enough skilled person to wrote a game extractor and a game file converter. Unfortunately, I’m not this person. 🙂
Anyway, I would like to thank you a lot the creator of the program “Dormin”, without it I wouldn’t have been able to analyze the game.

Conclusion

Best game ever ? From a technical point : absolutely. The game comes out when the Playstation 2 reached the end of its life. It present techniques which are still used today (bloom, fur, and so on). It’s a magnificent achievement and a good example to follow.

I recommend you to read these two documents in complementary of my blog post :
Real-Time rendering of Fur by Gary Sheppard (May 2004)
The Making of Shadow of the Colossus (December 2005)

I hope you enjoyed the reading ! 😉

7 responses to [breakdown] Shadow of the Colossus (PAL – PS2)

  1. Helder Carvalho says:

    Excellent post,it was good to learn more about the technical part of this game.

    And about the textures…

    This version of dormin can open them,they are the ‘.nto’ files in the index.
    But instead of typing ‘dormin’ to open it,you must use ‘imgv’,like this:

    imgv map_all.nto

    (but probably I just mistook what you really meant lol)

    • Froyok says:

       Yeah I quickly understood that “nto” files were the texture but I didn’t known that I could open them with the “imgv” command. Thanks, that’s good to know ! 🙂

  2. John McElmurray says:

    I really enjoyed your post! Thank you for sharing the link to Dormin and all of your analysis – it was very insightful and Makes me excited to try to code a hair shader.

    Sincerely,

    John

  3. Victor Botelho says:

    Great post! Do you know what they use to blend textures? I’m a noob developer curious about the field & grass textures.

    Thanks!

    • Froyok says:

      Regarding the PS2 hardware, I believe they simply used the vertex alpha color to blend two textures. R, G and B were used for the lighting, and the Alpha to blend from one texture to one another.

  4. Nomad Colossus says:

    Well done! I’ve meant to say how impressed I am about this post before but just didn’t get around to it – my bad 🙁 I’ve always had problems with the Dormin model viewer, although with some help I’ve managed to get it working again recently. Sad there were no hidden colossi in he program code, but I’m sure there are still some undiscovered objects we could uncover. For instance, the watermelons from Ico are in the code, but I want to find a way to load them into Shadow of the Colossus! That would be cool xD.

    • Froyok says:

      Thanks (and sorry for the delay) !
      I wish I had the time to explore the game as you do. I love you blog and your discoveries. 🙂

Pingbacks & Trackbacks

Comments are closed.