Sims 3 Engine Toughts

Yesterday I played Sims 3 by a friend. Beside that you understand more or less the whole game in one hour, I was more interested at the engine. With best possible graphics settings, more than one thing is not that nice implemented. E.g. the water shader blurs its colors onto pixels, where there is no water at all. In the day/night cycle shadows are popping out of the nothing. Besides this deficiencies I think the most impressive thing is, that you can change more or less everything on the fly (a big sandbox).

  1. On more or less everything you can modify the texture. Each texture consists of a pattern of ca. up to 4 colors (if I remeber correctly). You can’t change the pattern, but all colors in a given pattern.

  2. You can build a house out of simple walls (that means, without optimizations tons of geoms, too much I would say).

  3. Each geom can have it’s own texture (that means tons of textures on one screen).

  4. On the height map you can draw textures. You can choose more than 50 different textures, and paint with all of them at the same time.

I wonder how they exactly implemented this things. Here are my ideas:

  1. The R, G, B and A components of a texture are not colors, they mean, how much of color 1, color 2, … is mixed into the final image.

Given: Color1, Color2, Color3, Color4, PatternTexture
Solution: FinalColor = PT.rC1 + PT.gC2 + PT.bC3 + PT.aC4

  1. In wireframe mode you can see that each wall component is in the final house a wall component (they do not merge adjacent walls into one polyon). Sure, they can merge all wall components into one large triangle list, but the problem is the next question.

  2. Tons of textures. They can’t switch the renderstate for each wall component I think, therfore they have to assign all textures in one step or maybe using texture arrays. But I don’t know how well this scales (how much texture can you assign today?).

  3. Same problem as before. I looks like a single pixel can consist of an infinite amount of textures. I see two possibilites. 1. You bind all 50 texture, then draw the heightmap with another 50 textures, each includeing the contribution of all base textures. 2. Multipass solution. For each texture (or maybe 3 or 4 textures) you draw the heightmap once more, blending them together.

  1. Thats not new. Second life etc…

  2. They can mash all geoms into a single one.

  3. Lots of textures are less of a problem then too much of a texture memory foot print.

  4. Terrain drawing is not new.

  5. Why stop at RGBA, they can have N mask components and N texture attached.

  6. Poly count is not a big problem. Number of geoms , overdraw and fillrate are your enemies. I am sure they mash the goems together, polygons in the geoms can stay as is.

  7. Again you can have N mask components and N texture components. Walls that you look like different texture might be masked differently but still same texture.

  8. Its probably the first. They just bind 50 textures, you can do so using the 3d stacked texture. I think you can bind 2048+ texture stack with that.

Never said that it is new. I only was impressed by the sheer amount of textures on one screen and how they manage them. Polycount was fairly low (characters were most complex).

Don’t you risk to much artifacts with a 3D texture (colors bleeding from one layer to another), an array doesn’t have this effect.

Then the question about the mask. Sure they use masks. But I don’t know how the masks are created (after all it should be fast on slow computers as well, especially for Sims 3, I think will run on old computers). They could as well generate a texture on the CPU (with whatever algorithm they like), but that means even more textures.