MGS4 3D engine post mortem [translation needed]

So here's my summary of the Game Watch article for one of the MGS4 sessions at CEDEC 2008.
http://www.watch.impress.co.jp/game/docs/20080912/cedec_mgs.htm

First this pic
http://www.watch.impress.co.jp/game/docs/20080912/mgs04.htm
from another MGS4 session about its artistic design workflow.
Light, ambience

The experiment in the TGS 2005 trailer
  • Light maps for 3 vectors
  • Shadow volume
  • High-poly/hi-res models
    • 0.8 million polygons (background only)
    • Around 300MB textures (total)
However... ---------------- Failure... (red text) --------------

  • 3 light maps were stressing the VRAM, couldn't achieve enough resolution...
  • The specification of shadow volume was revoked...
  • Anyway they couldn't be put on memory...
This session on another day is covered by other articles such as
http://www.gpara.com/article/cms_show.php?c_id=9335&c_num=56
http://www.famitsu.com/game/news/1217941_1124.html
According to them, MGS4's art was produced by 100 Konami employees and other exterior staff. 30 people for motion, 20 for maps, 20 for mechs, and others. 1 map consists of 0.25-0.35 million polygons for the final version (0.8 million in the 2005 trailer). Characters are 5,000 - 10,000 polygons (Snake is 14,000 polygons) and main characters have 115 bones on average. Also characters have 5 shaders on average such as eye, hair, skin. Plus they have normal maps and facial rigs.

OK back to the Game Watch article.

MGS4 adopted HDR lighting for the first time in the series to represent the mix of the light and the dark more realistically
http://www.watch.impress.co.jp/game/docs/20080912/mgs05.htm
or to make blur and DOF look better.

At first they did it with FP16 but they eventually abandoned FP16 and adopted 32bit/pixel HDR encoding since MSAA can't coexist with FP16 on PS3 due to memory restriction. To render alpha with this HDR method, they used mini blend-buffer.

HDR encoding buffer and tone-mapped color buffer
http://www.watch.impress.co.jp/game/docs/20080912/mgs06.htm
non-opaque buffer rendered by HDR encoding and non-HDR blend buffer
http://www.watch.impress.co.jp/game/docs/20080912/mgs07.htm
HDR non-opaque buffer, blend buffer for efects, mini blend buffer for effects
http://www.watch.impress.co.jp/game/docs/20080912/mgs08.htm

As for lighting, a character has
  • Parallel light (w/ shadow)
  • 2 parallel lights
  • Ambient light
  • Rim light
  • 2 point/spot lights
For the background
  • Parallel light (w/ shadow)
  • Prebaked ambient light (baked by XSI)
  • Separated pre-lighting (baked by PS3)
  • 2 point/spot lights
http://www.watch.impress.co.jp/game/docs/20080912/mgs09.htm

Ambient light in MGS4 is hemisphere lighting and can be controlled by artists.
http://www.watch.impress.co.jp/game/docs/20080912/mgs10.htm
http://www.watch.impress.co.jp/game/docs/20080912/mgs11.htm
http://www.watch.impress.co.jp/game/docs/20080912/mgs12.htm

"Separated pre-lighting" is their moniker for radiosity normal mapping which was also used in HL2:EP1. Its merit is that it consumes less textures and can be adjusted dynamically. But it's not the most optimal method for RSX, so it requires additional culling and LOD.

Separated pre-lighting works for both direct lights and ambient-occlusion-like effects
http://www.watch.impress.co.jp/game/docs/20080912/mgs13.htm
http://www.watch.impress.co.jp/game/docs/20080912/mgs14.htm
http://www.watch.impress.co.jp/game/docs/20080912/mgs15.htm

Effects in MGS4 were done by the same old method as in MGS3, changing vertex colors, due to texture size restroction.
http://www.watch.impress.co.jp/game/docs/20080912/cedec_mgs.htm
(Apparently it was surprising for most devs in the room and induced some laughs) But Snake has some special effects and the specular level changes when he's wet.

For snow, it computes how much snow is on every vertex in a snow-cover model and bakes it as an alpha, then kills pixels when polygon's alpha doesn't surpass texture luminance as a threashold for pixel appearance.
http://www.watch.impress.co.jp/game/docs/20080912/mgs17.htm
http://www.watch.impress.co.jp/game/docs/20080912/mgs18.htm
http://www.watch.impress.co.jp/game/docs/20080912/mgs19.htm

For water, they tested simulation but it was not looking good. Instead they end up using pseudo effects that look cooler.
http://www.watch.impress.co.jp/game/docs/20080912/mgs20.htm
http://www.watch.impress.co.jp/game/docs/20080912/mgs21.htm
http://www.watch.impress.co.jp/game/docs/20080912/mgs22.htm

For depth of field, they used 19-point sampling by shader or a lite version of it with less processing load scene by scene.

Fog effects (sand/snow) in front of camera was present in MGS3 too but they did it with full-screen smoke textures on PS2 since alpha was not available. On PS3, they used a 1/16-size buffer for shader effects and adjusted density and brightness while seeing depth when synthesizing it with a frame buffer.
http://www.watch.impress.co.jp/game/docs/20080912/mgs23.htm
http://www.watch.impress.co.jp/game/docs/20080912/mgs24.htm
http://www.watch.impress.co.jp/game/docs/20080912/mgs25.htm

Finally the "polygon demo" system aka realtime movies. The realtime cutscene system first appeared in MGS 1. Realtime cutscenes are called "polydemo" among Konami developers.
http://www.watch.impress.co.jp/game/docs/20080912/mgs26.htm

As merits of realtime movies, the Konami developer cited smaller size, long playback time, interactivity, seamlessness, and faster reaction to dynamic design changes. In MGS4, realtime movie data are compressed by the chronological order and packetized per frame. After subtitles and sound are added, all of them are encoded into a special stream format. With an in-house 3dsMax plugin designers can modify it. Preview on PS3 is also possible. To suppress data-size explosion of next-gen assets, far-camera character data are more compressed. (In the Q&A time one of questions was about what on the Blu-ray disc is taking that much size, but Konami developers didn't disclose it at the event.)

2D movies are also realtime to suppress data size. It's on a 2D animation system that is data-compatible with Adobe Flash (but it doesn't have ActionScript and other advanced functions). This system was also used in MGS games on PSP and DS. They could use professional Flash authoring tools to save development time and cost.

As the last words, the Konami developer suggested the PS3 spec was still fluid when they started MGS4 development. The difficulties they encountered in this "porting" job to the final PS3 even include the scope the coordinate system can express, or unsupported functions. So it's not your typical "RSX vs 7800" discussion.
 
Last edited by a moderator:
If they're forcing a mandatory install, they could just use some ultra compression scheme (lossless for data, lossy for images). Say LZH compression for the data, JPEG for textures or some such. Files could either be kept in a packed form and take advantage of the extra available free memory, harddrive, and when lacking an install option, the faster disc speed, on the 360 (streaming archives in as needed) and decompressing/converting on the fly. Think Live CD. Even better if they have some cpu power left over specifically for the streaming and such. Then again, if they weren't able to find things to multithread, they're probably not going to be looking into exotic archival schemes.
Zip would probably be a better compression format than LZH though. The lossless stuff isn't going to compress that much more with one over the other, and I believe zip allows for an archive to be mounted and read part by part whereas I think most more advanced compression algorithms need the whole thing loaded in. Or do they? How do live cds do it, they certainly don't load all 4GB of data into memory, or even the 700MB image file, so they must be decompressing on the fly.

Alternatively, everything could be compressed on the disk and just decompressed for the install. Think...just about every PC game these days. They would need to do the same installation per act thing as the PS3 version though, and at that point why not just split into multiple disks? The cost of a few extra disks might be comparable to the cost of man hours for figuring out how to compress or strip things down to fit. It's not just paying people to figure out how to make the game fit, that's also taking them away from other potential work.
 
Finally the "polygon demo" system aka realtime movies. The realtime cutscene system first appeared in MGS 1. Realtime cutscenes are called "polydemo" among Konami developers.
http://www.watch.impress.co.jp/game/...0912/mgs26.htm

As merits of realtime movies, the Konami developer cited smaller size, long playback time, interactivity, seamlessness, and faster reaction to dynamic design changes. In MGS4, realtime movie data are compressed by the chronological order and packetized per frame. After subtitles and sound are added, all of them are encoded into a special stream format. With an in-house 3dsMax plugin designers can modify it. Preview on PS3 is also possible. To suppress data-size explosion of next-gen assets, far-camera character data are more compressed. (In the Q&A time one of questions was about what on the Blu-ray disc is taking that much size, but Konami developers didn't disclose it at the event.)

This part, to me, suggests that there's a lot more going on in the huge demo.dat than just a bunch of audio that can easily be compressed further.
 
I remember reading somewhere that MGS4 was using LPCM 7.1 uncompressed sound. At the times, I was surprised at them not using a lossless codec.
If this rumor is true, then squeezing the game into a few dvds should be easier as you can gain somehow around 50% by using lossless compression, and even more with lossy.
 
I don't know why people are so willing to believe Kojima Productions's programming team is incompetent.

Compressed assets (textures, geometry, audio) have been a defacto standard for a long time now. This is not something new or revolutionary. Of course it was compressed.

The whole uncompressed audio thing was misinformation and frankly quite a ridiculous notion.
 
I remember reading somewhere that MGS4 was using LPCM 7.1 uncompressed sound. At the times, I was surprised at them not using a lossless codec.
If this rumor is true, then squeezing the game into a few dvds should be easier as you can gain somehow around 50% by using lossless compression, and even more with lossy.

There is a lot of BS information floating around out there. You will read lots of misinformation about MGS4.

There is no 7.1 mix in MGS4 at all. The game only supports 5.1 Dolby Digital. I don't know why people keep insisting it is stored uncompressed on disc and in memory since it won't even output uncompressed audio.

It's 5.1 DD period.
 
This part, to me, suggests that there's a lot more going on in the huge demo.dat than just a bunch of audio that can easily be compressed further.
You know, it makes sense that demo.dat is the cutscenes, as it's by far and away the largest file, and by far and away the majority of MGS 4 is cutscene :devilish:. If so, that'd make those far harder to split up/compress.
 
You know, it makes sense that demo.dat is the cutscenes, as it's by far and away the largest file, and by far and away the majority of MGS 4 is cutscene :devilish:. If so, that'd make those far harder to split up/compress.

Why is it difficult to split?

And for those who think MGS460 will require install, please get real.
 
And for those who think MGS460 will require install, please get real.

At the same time, let's also not forget the 4GB game cache that is already reserved on HDDs. Although it certainly would be pain to swap games (cache overwrite) and then have to go through the cache-streaming all over again, it's not like it didn't occur in Xbox days; Doom 3, FarCry Instincts, and Team Ninja games etc made you sit through an intro video of some sort before letting you go to the main menu. Even Halo 2 streamed 2GB's worth of content over any time it was able to do so without the user really experiencing a wait.
 
I don't know why people are so willing to believe Kojima Productions's programming team is incompetent.

Compressed assets (textures, geometry, audio) have been a defacto standard for a long time now. This is not something new or revolutionary. Of course it was compressed.

The whole uncompressed audio thing was misinformation and frankly quite a ridiculous notion.

It is not that far-fetched when you consider that some blu-ray movies do contain uncompressed audio for their sound tracks (I haven't checked if it's 7.1 or 5.1 only). So as the specs allow it, maybe they thought 'we got plenty of storage space to spare, let's skip compression on audio'.

Now, if DD5.1 has been confirmed, let's forget this silly subject.
 
So here's my summary of the Game Watch article for one of the MGS4 sessions at CEDEC 2008.

Thanks for that summary. It's interesting that they vary the depth of field samples on a case by case basis, I guess the cutscenes really run at the performance edge. I don't even recall noticing a change in the depth of field look across different cutscenes so I guess that's a reasonable thing to do. Has there been any indication of what MGS4 does with the spus?
 
It is not that far-fetched when you consider that some blu-ray movies do contain uncompressed audio for their sound tracks (I haven't checked if it's 7.1 or 5.1 only). So as the specs allow it, maybe they thought 'we got plenty of storage space to spare, let's skip compression on audio'.

Now, if DD5.1 has been confirmed, let's forget this silly subject.

I played MGS4 in 5.1 PCM with my PS3 connected to my receiver via HDMI. It was not in encoded in Dolby Digital when I played it.

I think the confusion comes from people assuming that there is no compression on the sounds just because there is not a codec being used in the sound delivery to the pre-amp. Just because there wasn't a codec being used doesn't mean the sounds on the disc aren't compressed in some form - perhaps less on a Blu-ray than a DVD-9, but there are still runtime and memory considerations present in a game that aren't in a linear movie presentation.
 
Exactly, how the sound is stored on the disc is of no consequence to how it is output from the system. The sound effects, dialogue, music, etc, are mixed in real time and then encoded to whatever format is required by your audio set-up. HDMI to the receiver will allow uncompressed PCM, if your audio is through the optical output it could be DD or DTS, if you use the analog stereo output you're looking at Dolby Pro Logic II.

And Blu-ray movie specs have no bearing whatsoever on PS3 games.
 
Exactly, how the sound is stored on the disc is of no consequence to how it is output from the system.

Sorry, but if you store your sound compressed on disk, you have no interest to output it uncompressed (speaking of PCM)… you have lost quality sound by the compressed stockage (all right only few people can made the difference)
So if you want uncompressed sound output, you need uncompressed sound stockage…
The only reason to store compressed sound and to proclaim to have uncompressed output is a marketing reason, but it's BS.
 
Sorry, but if you store your sound compressed on disk, you have no interest to output it uncompressed (speaking of PCM)… you have lost quality sound by the compressed stockage (all right only few people can made the difference)
So if you want uncompressed sound output, you need uncompressed sound stockage…
The only reason to store compressed sound and to proclaim to have uncompressed output is a marketing reason, but it's BS.

All in all, I agree with the "only marketing" and "only few people" parts. But technically, after all the sound processing is done inside the game - spatial positioning, effects, reverb etc. - the sound is pretty far from what was stored on the disk, the decision whether to output it in 7.1 LPCM (as the PS3 allows virtually for free AFAIK) or only in 5.1 DD can be made separately from the decision of whether to compress it in the first place.

To make an analogy with visuals: even if a game uses compressed textures, this doesn't mean it's OK for all purposes to use only JPEG screenshots. For pixel-counters (and audiophiles, which are roughly the same, but with thicker wallets) uncompressed is still better.
 
Sorry, but if you store your sound compressed on disk, you have no interest to output it uncompressed (speaking of PCM)… you have lost quality sound by the compressed stockage (all right only few people can made the difference)
So if you want uncompressed sound output, you need uncompressed sound stockage…
The only reason to store compressed sound and to proclaim to have uncompressed output is a marketing reason, but it's BS.

I'm not saying anything about marketing claims, only correcting a misconception that how a file is stored on the disk means it will necessarily be output in the same format. Your uncompressed sound files could ultimately reach the player via a lossy Dolby Digital bitstream and, likewise, your highly compressed MP3 audio files on disk could end up being delivered as an uncompressed multichannel PCM stream.
 
Sorry, but if you store your sound compressed on disk, you have no interest to output it uncompressed (speaking of PCM)… you have lost quality sound by the compressed stockage (all right only few people can made the difference)
So if you want uncompressed sound output, you need uncompressed sound stockage…
The only reason to store compressed sound and to proclaim to have uncompressed output is a marketing reason, but it's BS.

What about lossless compression? :smile:
 
Thanks for that summary. It's interesting that they vary the depth of field samples on a case by case basis, I guess the cutscenes really run at the performance edge. I don't even recall noticing a change in the depth of field look across different cutscenes so I guess that's a reasonable thing to do. Has there been any indication of what MGS4 does with the spus?
Nothing more about actual hardware usage, if it had such info I'd have put the summary much earlier :smile:
 
Doesn't MSG4 contain multiple audio languages? Or is that only true of Europe? I'm sure if needed, they can drop multi-language feature...
 
Back
Top