January 21, 2004
Let There be Clouds!
Fast, Realistic Cloud-Rendering in
Microsoft Flight Simulator 2004: A Century of Flight
You're standing on rolling hills beneath a brilliant blue sky. You look up and see huge spherical white blobs suspended a few thousand feet in the air. What's wrong with this picture? Perhaps you could use a better cloud-rendering system.
In videogames that simulate outdoor reality, realistic clouds can be one of the most compelling aspects of the scene. Clouds can also set the mood - dark thunderheads for an ominous scene, light puffy clouds for a happy mood. Michelangelo spent years perfecting the heavens on the ceiling of the Sistine Chapel, but we need to render realistic clouds in milliseconds. Fortunately, we have more advanced tools to work with. This article describes the cloud modeling and rendering system that ships with Microsoft Flight Simulator 2004: A Century of Flight.

Microsoft Flight Simulator 2004:
A Century of Flight
Clouds in the real world consist of many types, such as altocumulus, stratus, and cumulonimbus, and cloud coverages ranging from a few sparse clouds to a dense, overcast sky. Our cloud system models this range of cloud types and coverages. Microsoft Flight Simulator allows users to download real-world weather and see current weather conditions reflected in the game graphics, which means we need to generate compelling visuals to match any scenario that could occur in the real world.
The interactive nature of games necessitates that clouds must look realistic whether the camera is far away, next to the cloud, or traveling through the cloud. Another requirement is that we need to render at high framerates. Microsoft Flight Simulator supports a wide range of machines, from the latest PCs to those dating back several years, and the performance must scale to this spectrum of machines.
Clouds need to be shaded appropriately to emulate both sunlight and light reflected from the sky, especially for games such as Microsoft Flight Simulator, which take place over the course of day, spanning dawn, midday, dusk, and night. We model the dynamic aspect of clouds by introducing a method to form and dissipate them over time.
Previous Work
Over the past 20 years, graphics researchers have modeled clouds in many ways, including cellular automata, voxels, and metaballs. They also modeled cloud animation via fluid dynamics. There are two reasons that these research techniques have not been widely adopted by games. The first is performance. Many of these systems produced screenshots that were gorgeous but required multiple seconds to render. The second is lack of artistic control. Imagine that you create a cloud by running a set of fluid dynamics equations. You examine the results and decide you would like a wispier top on the cloud. You must then iterate through cycles of adjusting variables such as air humidity and temperature, and recomputing the equations, which can require hours and still may not produce the visual effect you had in mind.
Realistic results in cloud shading have been achieved by simulating the scattering of light by particles as it passes through the cloud, known as anisotropic scattering. This produces accurate self-shadowing and interesting effects such as the halo when the cloud lies between the camera and the sun. We created a simple shading model for our system, forgoing these effects in exchange for fewer computations and higher artistic control.
Many flight simulation games have featured clouds, recent examples being Flight Simulator 2002, IL-2 Sturmovik, and Combat Flight Simulator III. A common approach is to paint clouds onto the skybox texture, which has minimal performance overhead, but such clouds look two-dimensional and never get closer as the camera moves toward them. A better solution is to draw each cloud as a single facing sprite. This solution looks realistic from a stationary camera but produces anomalies as the camera rotates around it. A few recent games use clusters of textured particles, similar to our system. Some use unique textures for every cloud, which has a high video memory cost as the number of clouds in the scene increases. Other systems use small blurry textures, which results in clouds that look volumetric but lack definition. All of these systems also lack the ability to form and dissipate clouds.
Our system was inspired after hearing a GDC talk by Mark Harris, who developed Skyworks, a real-time system that created volumetric clouds from sprites. Harris dynamically generated an impostor for every cloud and achieved speeds of 1 to 500 frames per second. He also modeled the fluid motion behind cloud animation. The limitation of his system is that it cannot render large clouds, such as cumulonimbus, or dense scenes of overcast clouds, due to the prohibitively high video memory cost of generating large impostors. Our system is able to address this limitation. In addition, we tackle the problem of scaling to multiple cloud types.
Cloud Modeling
Given that we want immediate visual feedback and full control over the final result, how can we design the artistic pipeline for modeling clouds? We model each cloud as five to 400 alpha-blended textured sprites. The sprites face the camera during rendering and together comprise a three-dimensional volume. We render them back-to-front based on distance to the camera.
We wrote a plug-in for 3DS Max that creates cloud sprites based on a 3D model composed of boxes. The artist denotes a cloud shape by creating and placing a series of boxes, using default 3DS Max functionality. The artist can create any number of boxes of any size and can choose to overlap the boxes.

Figure 1. A custom tool within 3DS Max allows the artist to set properties and generate cloud sprites.
The plug-in UI contains an edit field to specify the number of sprites to generate. To create denser clouds, the artist would set a number which is proportionately higher than the size of boxes in the model. Wispier clouds would be created by setting a lower number. There are generally 20 to 200 boxes for each 16-square-kilometer section of clouds, and the number of sprites per box can vary between 1 to 100, depending on the density. The UI also allows the artist to specify a range for the width and height of each sprite, and choose between categories (such as stratus and solid cumulus) that determine the textures that will be automatically placed by the tool onto the sprites. Figure 1 shows a screenshot of the tool UI.
The artist presses a button in the plug-in UI to generate the cloud sprites. The plug-in creates a list of randomly placed sprite centers, then traverses the list and eliminates any sprite whose 3D distance to another sprite is less than a threshold value (the "cull distance"). This process reduces overdraw in the final rendering and also eliminates redundant sprites created from overlapping boxes. We have found that a cull radius of 1/3 of the sprite height works well for typical clouds, and 1/5 to 1/6 of the sprite height yields dense clouds. Figure 2 shows screenshots of a cloud model made of boxes and its corresponding sprites.
The plug-in creates an initial model of sprites, and the artist can now edit them within 3DS Max. Having achieved the desired visual look, the artist uses a custom-written exporter to create a binary file containing the sprite center locations, rotations, width, and height, along with texture and shading information. These files are loaded during game execution and rendered.
Textures
To create a dozen distinct cloud types, we mix and match 16 32-bit textures for both color and alpha (see Figure 3). The flat-bottomed texture in the upper right-hand corner is used to create flat bottoms in cumulus clouds. The three foggy textures in the top row are used heavily in stratus clouds and have a subtle bluish-gray tinge. The six puffy textures in the bottom two rows give interesting nuances to cumulus clouds, and the remaining six are wispy sprites that are used across all cloud types.

Figure 2. Artists use boxes to build the shapes of clouds (left), and then let a custom tool in 3DS Max populate the boxes with sprites (right).
By creating interesting features inside the textures that resemble eddies and wisps, we are able to create more realistic looking clouds with fewer sprites. We place all 16 textures on a single 512x512 texture sheet, which spared the cost of switching textures between drawing calls to the video card. We automatically generate mip-map levels for this texture from 512x512 down to 32x32. To create more variations from these 16 textures, the artist specifies a minimum and maximum range of rotation for each sprite. When the binary file is loaded into the game, the sprite is given a random rotation within the range.
In-Cloud Experience
We would like a seamless in-cloud experience that looks consistent with the cloud's appearance as viewed from the outside, which does not often come with the commonly used technique of playing a canned in-cloud animation. In our system, as the camera passes through a sprite, it immediately disappears from view. We encountered a problem because the sprites rotated to face the camera, and during the in-cloud experience, the camera was so close to the sprite center that small movements in the camera position caused large rotations of the cloud sprite. This resulted in a "parting of the Red Sea" effect as sprites moved out of the way of the oncoming camera.
We locked the facing angle of the sprite when the camera came within half of the sprite radius. This removed the Red Sea effect but caused sprites to be seen edge-on if they locked and the camera then pivoted around them. Our solution was to detect the angle between the sprite's locked orientation and the vector to the camera, and to adjust the transparency of the sprite. The negative side effect is that the section of the cloud near the camera appears less opaque.
What Evil Lurks in the Hearts of NPCs?
By Ernest Adams
Gamasutra
[Author's Bio]
January 16, 2004

Although I don't agree with his conclusion, I still agree with his analyse for the 3d & 2d Character designing, especially the Bond stuff. It really make the idea clear by using these examples.
BTW, have you guys played Postal? Fiasco Character.
==================================================
What Evil Lurks in the Hearts of NPCs?
I haven't designed many characters over the years - certainly not action characters. In an action game, the avatar character's appearance is all-important, because he or she will be in front of the player 99% of the time. Whether it's someone tough like Lara Croft, cute like Mario, goofy like Crash Bandicoot - or a mixture of all three, like Ratchet - the visual design of the character dominates other considerations. Toby Gard has written an excellent introduction to the subject in his Gamasutra article "Building Character". Non-player characters (NPCs) tend to get similar, but less detailed, treatment - their visual appearance is tied to their role, and their role is usually either hostile or helpful, with nothing in between.
Steve Meretzky, too, has written an excellent Gamasutra article on character creation. His article, called "Building Character: An Analysis of Character Creation" discusses visual appearance and motivation as well. He offers a useful list of questions to which you should have answers if you want to create a character with a background, a person who seems to have some depth.

That guy in Postal.
There's something of an open question about how detailed an avatar character should be, because the avatar is, after all, a stand-in for the player. Most of the time they only do what the player tells them to, so their decisions are the player's decisions. Avatars have to be at least reasonably likeable, and somebody that you want to keep alive rather than actually kill off yourself (like, say, the guy in Postal). Avatars used to be a complete cipher with no personality at all, but lately they've been getting more detailed, and players don't seem to be complaining. But the place where we really have freedom to explore characterization is in the design of non-player characters. That's where the player will notice it most, and that's what I'll concentrate on in this column.
I want to take Meretzky's discussion a little farther. We often speak of characters in fiction as possessing "dimensions" - "I didn't like that movie, the characters were completely two-dimensional," and so on. What do we actually mean by this? Not spatial dimensions, obviously. Rather, we mean that the characters are lacking in some quality that would make them seem more human. I believe that the quality lacking is variety: intellectual, behavioral, and above all, emotional variety.
I'm going to propose a system for classifying characters according to their "dimensionality." It hinges upon the idea of emotional variety. Rather than try to give a formal definition, I'll use examples from the James Bond universe that I think will illuminate the idea.
Zero-Dimensional
A zero-dimensional character is one who exists in fixed emotional states, without any variability. In the Bond world, any of the Big Bad Guy's nameless henchmen is a zero-dimensional character. Ordinarily they're only alive for about five seconds, from the time it takes them to see Bond and shoot at him, to the time it takes him to shoot back and kill them. Their only emotion - if you can even call it an emotion - is a desire to kill Bond. Occasionally, for comedic effect, Bond turns the tables on them in some clever way and causes them all to run away in panic. They have no sliding scale of feelings; they just have a "hate state" and a "fear state."
In a video game these NPCs are usually found as enemies in simple action games like platformers. Not only do the characters have fixed emotional states, but those states are only relevant to the player. They have no affection or enmity towards anyone else; they don't help their buddies or even grieve when they die. In fact, they're usually not aware of them at all. The only thing they know about is the player.
One-Dimensional
A one-dimensional character has a sliding scale of emotional expression. We use this a lot in games: an affinity relationship characterized by a single variable. With one number, you can define an emotional state that runs from hate to neutrality to love, like this:

Figure 1: The emotional state of a one-dimensional character is easy to understand and predict.
In a Bond movie, this is the Big Bad Guy's love interest. She's innocent but deluded. Somehow the Big Bad Guy has managed to keep his army of ninjas, hidden missile base, and plans for world domination secret from her. (BBGs seem to prefer girlfriends who aren't too bright.) She loves the Big Bad Guy, or at least likes him enough to hang around with him, and she dislikes Bond because he's a cocky show-off. Eventually Bond is able to prove to her what scum the Big Bad Guy is. Her affection for Bond goes up, and her love for the Big Bad Guy slides down to hate. (This make's Bond's eventual triumph sexual as well as mortal - not only does Bond kill the BBG, but takes away his girlfriend too.)
Bond girls are not subtle; certainly not fully human, but they're marginally more interesting than a 0D character. They occasionally show a little anger or pride, and they quite often show fear, but their only meaningful emotion is a sliding scale between love (combined with loyalty) and hate. They have two of scales, one for Bond and one for the BBG, and they usually work in direct inverse proportion. No Bond girl ever regrets the loss of her relationship with the Big Bad Guy - the good times they used to have together, their hopes of starting a family, and so on. That would add an additional dimension that Bond movies don't explore.
This is about the level of the more sophisticated adventure game or RPG characters. Each character has an array of single-valued affinity relationships, one with the player and one each with the other NPCs in the game. The player's actions can cause that value to change, and this is reflected in the character's behavior. Less often, the other NPCs can also act to change their affinity relationships with each other as well. However, most NPCs are not designed with a desire to be liked. They don't make much effort to improve other NPCs' opinions of them.
Two-Dimensional
Now we're beginning to get somewhere. A two-dimensional character is capable of feeling a variety of emotions along a variety of scales, as long as they don't conflict with each other. In the Bond world, this is Bond himself. Bond enjoys a great many things: good food and wine; driving fast cars; taking great risks; promiscuous sex. He dislikes the KGB, drug barons, and megalomaniacs. He has a sense of duty, but not much of honor or patriotism. He feels a vague obligation to rescue his bed partners when they get taken hostage, but that's as far as his commitment goes. He only occasionally loses his temper, mostly when someone tries especially hard to kill him. (It doesn't bother Bond when someone tries to kill him once or twice. It's perseverance that really annoys him.)
The important point about Bond's various emotions is that they are never inconsistent, because they don't interfere with each other. Bond is never of two minds about anything; never uncertain what to do; never faced with a moral dilemma. If he does have a conflict of emotions (having to kill a woman that he has slept with, for example), he has a clear rule for resolving the problem: duty trumps love (or lust), and he never mourns about it afterwards. All that Bond really faces are challenges to be overcome one after another, like - ah-ha! - a player in a video game. They're mostly physical challenges, rather than emotional or intellectual challenges, anyway. Bond's emotional mechanisms are quite adequate to deal with the types of problems that he encounters.
Many years ago I had a job in which I had two bosses. One was honest but thoroughly unpleasant; the other, friendly but a bit of a scam artist. It was a weird situation. But there's nothing that says honesty must accompanied by good manners. We consider them both to be virtuous and so we expect them to go together, but they don't have to. Although these qualities are not emotions, it's a good example of a pair of variables that don't interact with each other.
Figure 2: A two-dimensional character's various personality attributes don't necessarily need to be in synch with each other-a good or bad guy could be quite dishonest, yet sickly sweet and polite at the same time.
In the world of videogames, The Sims is probably the game that most closely approximates 2D characters. The behavior of each Sim is governed by a variety of feelings and needs. Not having seen the code, I don't know exactly what mechanisms are in use, but I can tell by observation that the Sims are capable of feeling affectionate, jealous, angry, bored and so on. If they do experience contradictory emotions, there's a rule that determines which one governs their behavior at the moment. Unfortunately, their animation is not sophisticated enough to reflect a complex internal state. You can't tell the difference between a Sim who's cooking dinner while feeling jealous and one who's cooking dinner while feeling bored. Only the double cone over their heads gives a clue to their mental state, and it merely displays a univariate "happiness" value between red and green. (If Maxis had wanted to, they could have used the entire RGB color space, and displayed three values in the same mechanism; but that would have required the player to remember that blue means sleepy while yellow means alert, or whatever.)
Three-Dimensional
For a three-dimensional character we have to leave the Bond universe entirely--because it doesn't contain any. A fully three-dimensional character has the complex hodgepodge of emotions that we all feel, including some that are directly contradictory. A 3D character can love and hate at the same time. Children abused by their parents often experience this condition, which does bad things to their heads.

Figure 3: A three-dimensional character is much more human like than those discussed earlier, and adds realism to the gameplay.
This is an extreme example, however. Three-dimensionality doesn't mean that people are psychotic; it just means that they have a wide range of emotions and, if the circumstances are right, they can occasionally be faced with conflicting impulses. This happens all the time in real life: a person can be honest but greedy, find a lot of money, and have to deal with the contradictory emotions this creates.
I'm a big fan of the sea-novels written by Patrick O'Brian, two of which were recently made into the Peter Weir film Master and Commander: The Far Side of the World. The books are set in the British Royal Navy of the Napoleonic Wars. They're filled with high adventure, but also a great deal of 19th-century science and culture. Most important, however, is the interaction between the two protagonists. Captain Jack Aubrey is bluff, cheerful, and politically conservative, a brilliant military tactician whose eye for the ladies and financial naïveté tends to land him in hot water ashore. Dr. Stephen Maturin, the ship's surgeon, is irritable, perceptive, an enlightened liberal (he believes in radical ideas like democracy, of all things), a hopeless landlubber, and an opium addict. In spite of all this they are great friends, lovers of good food and good music, and vigorous opponents of Napoleon - Aubrey from his sense of duty as a military man, Maturin out of personal conviction. Over the course of 20 novels, we come to know them very well indeed. Their strengths are sufficient to lift them above the mass of humanity and make them admirable subjects for a series of novels; their weaknesses are sufficient to have a profound impact on their lives, but not so severe as to make them unlikable or pitiful.
Part of the key to the richness of their characters is their variability. Like real humans, they are not always consistent. Though you can predict what they will say on a certain topics (Stephen bitterly opposes slavery; Jack is a firm believer in monarchy) they have good days and bad days, times when they are warm-hearted and generous and others when they are sour and intolerant. Jack, though usually jovial, suffers from occasional bouts of depression, especially after a battle. Stephen's irascibility seems to evaporate when he is around children. Their emotions don't simply change as part of the plot, like a Bond girl's. They also change for other reasons and sometimes for no reason at all, moving tidally like the restless sea with which they live.
Unfortunately, my example demonstrates one of the fundamental limitations of visual media. Words are an excellent way of illustrating internal states of mind; pictures are not. The Master and Commander movie, good as it was, displayed only a fraction of these two men's emotional ranges. A film director simply can't convey in a two-hour movie what an author can in 20 novels, or even in one if it's highly introspective. And ultimately this limitation applies to us in the game industry as well. We won't be able to conduct extended character studies in video games. Fortunately, it's unlikely that we'll need to. Video games are about interactivity, and that is where we should devote most of our attention.
That doesn't mean, however, that all our non-player characters should be the equivalent of Mario's turtles or Sonic's piranhas. There is merit in striving even for what you cannot reach, so long as you continue to get closer to it. I believe we should go on working towards the goal of creating three-dimensional characters in our games, firstly because advancing the state of the art is a worthwhile aim in itself, and secondly because it will enable us to make new games for new markets: people who are tired of cardboard characters.
In Fahrenheit 451, Ray Bradbury imagined what he thought of as a dreadful scenario, a future in which people don't read books, but participate in interactive soap operas through wall-sized television sets. Well, people aren't going to stop reading books, because as I've shown, books can do things that other entertainment media can't. But I would like to make the other part of Ray Bradbury's nightmare come true: the interactive soap operas. And that will require characters that we want to care about--characters that we believe are real.
January 17, 2004
spaceship design
Spaceship Concept

I'm keep training my painting skill recently. I pick some of them out here.
Give me some reviews.
Fiasco5

Lost Sabre

January 6, 2004
My Unreal Project



Hwew~~, during this Christmas, my ambitious project is not finished eventually.
Partly done, don't be pissed of by the scrapped sky. I'm still focusing on the environment building up. After that, I'll start my game-play coding stuff.
Welcome to anybody who have interests in my project.
Tired Jenova
