World in Conflict Interview with Massive EntertainmentPhysics engineYouGamers: Do you utilize a custom physics engine, or are you using a commercial physics API? Westberg: The vehicles [hundreds of tanks moving simultaneously] I mentioned, they have a custom-made system and that is ours, and we have wires between lightpoles - that's also our custom system. For all other dynamic objects in the game world, we use Havok, because it's to us just the best engine available. For all dynamic props, big buildings falling to pieces and so on, it's Havok. To some degree, we also use animation, so when there's a building falling down and it looks like it's [done using] physics, probably about half of it would be pre-animated objects. It's just easier for an animator to make sure something falls in a cool way than it is for a physics engine - if I drop something on this table I can't be sure that it falls in a cool way. Karlson: And coolness is important! [laughs] Westberg: It's all about coolness. So we animate some of it, and we simulate some of it to get it to look cool and still be dynamic.
Westberg: [We did], so we've been changing our tactics back and forth, but with the Havok engine it works very well. That engine is very, very fast. The custom [physics] we designed for vehicles helps a lot, since there are so many of them. So physics actually isn't really a problem.
Westberg: We actually use stencil shadows, which is the old-school way, but that's to make the game work with older hardware. With shadow buffers, the newer technology that a lot of people use, you see a lot of jagged edges, shaking and all that. Because of all these problems, it's really hard to do a good, proper shadow buffer implementation and not get those artifacts, especially on older hardware where you can't just trust the CPU to be so fast that you can do all the passes you need to. So we decided to go with stencil volumes, but with a twist. We kind of do them twice, and we get the area between shadow and no shadow, and we soften it depending on distance between the light source and the shadow caster. So if you have a building, you'll see the shadow being quite sharp near the building, and then getting softer [further away]. Our shadows look quite soft and nice, and they don't have that jagged look.
Westberg: We have LOD [level of detail] and scaling on pretty much everything. There's not going to be an easy way out, because we have the free camera. We can't really do cheating - we don't even have occlusion culling, because [the player] can put the camera in a position where nothing is occluded. That's the worst case scenario, and also why occlusion culling doesn't work for us. What we do have is lots of LODs for everything. We have artists that work very hard to make very low-poly objects that we switch in the distance, and they also have detail layers - if you have a big building that has flowerpots on a balcony and you go up close, you'll see the flowerpots and the balcony. If you move away, those will fade out until we can remove them from the scene, because you won't really be able to see them from the distance. That decreases the number of draw calls, and the number of triangles we need to draw. Other than that, it's hard work by very good coders who've been doing a lot of profiling and analyzing to figure out what is the bottleneck, and then go optimize it. I'd say it's 75% trying to analyze what's taking [CPU or GPU] time and figuring out what to do, and 25% the fun part - actually doing it. You can sit there all day optimizing the wrong thing, and nothing's going to happen. You need to analyze to figure out what's taking time, and it's usually not what you thought it would be, it'll be something strange, and you can make just this little tune, little change to make it go a lot faster. We've had two-week iterations where we've improved every two weeks for two years time now. We actually had the first version of the game running two years ago, fully playable in a multiplayer, 8 vs. 8 game. Now we've had that for two years, playing it every two weeks, and improving on gameplay, balancing and optimizations. I'd say that's the secret, it's a lot of work. We also have custom-made systems for grass, trees, bushes, water, clouds - everything has a special render path that is optimized for that case.
Related StuffTags |
|||||||||||||||||||||||||||||
![]() |