• Moose


  • Content Count

  • Joined

  • Last Visited

About STomnibus

  • Rank
    Foot Soldier

Profile Information

  • Gender

Recent Profile Visitors

2,585 Profile Views
  1. Building and Rendering SimCity By Ryan Ingram, Maxis Graphics Developer Hi everyone – I’m Ryan Ingram, Graphics Developer on SimCity. I’m excited to present our building rendering technology, the part of the game I’ve personally poured my heart and soul into over the past few years. I’m proud of how it looks and I hope you’ll enjoy this peek into the mechanics of SimCity’s rendering. Here’s the building we’re going to look at – it’s a mansion that your high level wealth Sims might live in. How do we get there? Well, it all starts with triangles (http://stackoverflow.com/questions/6100528/why-are-there-always-triangles-used-in-a-3d-engine). One thousand, two hundred twenty triangles, to be specific. Not much to look at yet. Let’s fix that. Here are the texture pages that the art team put together for this class of building. They have all the architectural elements needed for a particular building style. To get the best performance, we re-use the same facade texture set on all the buildings of that style. This lets us render lots of buildings in the same batch, which is crucial given just how many buildings there might be in your city. The first texture is the color map. We use a palette on it. Palletizing is a technique that allows re-use of the same texture with all sorts of different colors. The colors can be changed on different buildings, or even on different parts of the same building. The second texture is a normal map (http://en.wikipedia.org/wiki/Normal_(geometry)). You can kind of see the shape of the texture in the normal map already, and it’s used for exactly that reason. Here’s how this building looks before and after it’s been colorized with one of its possible palettes: I use interior mapping for the insides of the buildings – you can see lots of examples of interior mapping in Creative Director Ocean Quigley’s night videos where the lights come on inside skyscrapers. The building is split into rooms and I render the appearance of the floor, ceiling, side walls, and rear walls into each room. The mushy grey areas are actually lots and lots of very tiny rooms – the art team didn’t tune those areas since they have no windows and aren’t visible. Putting this all together, a building finally emerges! A pretty flat looking one, but it’s starting to look recognizable. The next step is lighting. Using the normal map to figure out reflection angles, our light model gives us the contribution from the atmospheric light (moonlight, in this case), along with the lights on the building itself. This also includes our ambient occlusion and shadowing. Putting it all together, it’s starting to look kind of pretty: You can see a nice specular highlight on the windows from this angle. We weren’t satisfied with just this, though. The stairs felt flat, and the windows and doors are missing something. So if you are running on our recommended spec (“Medium” lighting or higher), it’s time to bring out the big guns: relief mapping. Here’s what I want to show: We didn’t want to store a high resolution mesh for every building though – for one thing, that’s a lot of vertex memory, and it’s wasteful to repeat that same mesh for bricks, stairs, windows, doors, and so on. Not only that, but storing highly detailed geometry makes it a lot harder to scale the memory use down for lower-spec machines. Instead, we kept all of that data in a texture so that a high-resolution mesh can be reconstructed on the fly. The flat low-polygon mesh is ray-traced into beautiful high-resolution geometry with hundreds of thousands of tiny virtual polygons. We have a debug mode that lets me take the texture and re-construct the 3D mesh it was originally exported from. Here I’ve taken the door on the bottom right of the original texture and turned it into a real 3D mesh: This isn’t just a lighting trick. For example, if we’re looking up at the door from the ground, you can see the underside of the doorframe: Here’s that earlier screenshot with relief mapping turned on. Notice that the building’s facade has actual surface relief. These two zoom boxes are showing exactly the same location relative to the camera and the building polygon. The center of the “flat” one shows the window, but with relief mapping you see past the recessed window to the edge of the door. So to find the target, we’re going to step along that ray from the viewpoint, asking the mesh “what do you look like here?” There’s a tradeoff, however – querying the mesh takes time, so we want to do it as few times as possible. To facilitate this, we pre-calculated a cone for every point in the mesh. We made the cone wide enough to intersect with the geometry around it, and maybe a little bit more. It’s a cone of “guaranteed coverage” because no ray coming down and going through the cone’s center-line can pass all the way through the surface mesh and come out on the other side without hitting the insides of the cone. In this case, the cone just barely intersects the surface. Of course, we want the widest cones that we can make – wider cones allow for bigger steps, making the technique more efficient. Big steps means fewer samples are required to find the target, making the shader less taxing on your graphics card. Once the ray goes inside the mesh, we have both our old point that’s on the outside and the new point that’s on the inside. Now we know that the mesh surface is somewhere between them. To find out exactly where that surface is, we use a Binary Search. With each step, we divided the space between the points in half, always keeping one point on the inside and the other one outside. This narrows down the space really fast; it only takes a few steps to get as close to the surface as we need to. This is what the whole process looks like: Zoomed in, notice that the center of the light blue cube is almost exactly on the edge of the surface: Now from the top, the target has been hit exactly at the right spot. Here’s another example – this time we run out of cone tests before quite reaching the edge, so we gave up at that point. This can lead to minor artifacts, but it’s not usually noticeable in-game. It’ll look like the surface curves towards the edge, instead of being a clean cut. The amazing thing is that your graphics card will do all this calculation for every single pixel of every building in the game, every frame. That’s it – I hope you enjoyed reading about how we render buildings in the game.
  2. I wanted to ask a question about the article "Making a Functional Landmark Lot" by SimGoober. Can you make a park lot functional???

  3. Article originally found in sc4ever.com Achieving such results as the title suggests is actually relatively simple, just plaster your city with trees. It's relatively inexpensive for what it does and will do all three things mentioned in the title. I started placing trees and all my manufacturing and dirty industries immediately converted to high-tech. And if you're feeling particularly lazy (as this process can be very tedious), then use that cheat to get full God mode back and use the tree tool. Note: If your High-Tech demand is still high, but the rest of your non-High-Tech industries aren't converting, then just keep plastering the area with trees, it seems the more active and intent you are on placing trees, the more likely it is that High-Tech industry will develop there. The increase in trees also server to expand the size of commercial and residential development as well, although the effect is not as profound as it is on the industrial sector.
  4. Article originally found in sc4ever.com If your trains don't appear when you place them, then you must be doing something wrong, right? Wrong. You just placed the stations in the wrong areas. See Simcity 4 is very realistic in the sense that if you don't place your passenger train stations where it's crowded, then you wont be receiving any people riding your trains. The same with freight, place them in the heart of your industrial...then you are sure to receive freight trains. If you don't know where the traffic is, just go to the traffic meter and it will show you, place stations only where the roads are deep red. But not too deep into residential, cause not even you would want a train riding past you while your sleeping right?
  5. Article originally found in sc4ever.com Toll booths are quite possibly the most unbalanced thing in SC4K. For a modest fee, you can get 20 cents per month for every car or bus passenger that travels through the toll. This can be abused to make massive amounts of money. I've had a city that made $10 000 profit per month on tolls alone. Toll booths are pretty simple. Your Sims usually travel from residential to industrial, or residential to commercial. If their route goes through a toll booth, they give you $.10/month. Toll booths add a few minutes to their trip, and give you money in the process. Build a ground highway to connect your residential and industrial zones. Make sure it's the only road connecting them. Place avenues at the ends of the highways, and connect them. Now, put toll booths all along the ground highway. Do the same thing between residential and commercial zones. Now wait a few months, and check your income. You should be making huge amounts of income from the tolls! As long as the sims have to take that highway to work, they'll pay a huge amount in tolls. A well set up network will give you more money from tolls, than you will get from residential taxes. (Sick, no?) Even Sims that take the bus have to pay the toll. But, busses don't make congestion like cars do, so they can drive around the toll more easily than cars. Make sure they can't, so you can get income from bus fares, and the toll. If the highway gets cramped, build another one, set up the tolls, and connect it to the same avenue. Build bus stations to reduce congestion, and make more money at the same time. Why ground highways? Ground highways are cheap. Highway toll booths handle the most amount of sims. Sims drive the fastest on highways, so more sims will be able to get to work. A good highway can have 8 tolls, giving you $1.60/month for every car or bus passenger that needs to travel on that highway. Sims pay 10 cents on the way to work, and 10 cents on the way back. Toll booths cost $5 a month to maintain. So, as long as you get 50 cars going through, you'll break even. One last word of caution: Toll booths add up to your commute time quickly. If your sims have a commute time more than 100 minutes, they'll start to lose their jobs, and leave your town. You'll still get bucketloads of cash, but a few buildings will rot. It's nothing to worry about on a small or medium map, but be careful in region play.
  6. Article originally found in sc4ever.com Most of you should know this by now that lots accept a little more than one would expect. You got someone riding your hiney about planting more trees. Plant em in people's yards, industrial lots, parks, etc. This works with both mayoral and god cheat tools. Now go clean up your air.
  7. Fantastic video, great quality. Nice job hal