Game Development Community

The Inner working of the Undercity Demo

by Logan Foster · in Torque 3D Professional · 04/08/2009 (9:02 am) · 38 replies

As some of you may, or possibly may not know, MaxGaming built an entirely 'interior' based level for GarageGames to show off with Torque3D at GDC that would not only show off some of the new and cool lighting features of Torque3D, but also be a rather nifty multi-player deathmatch type environment. Unfortunately Adrian was not around when they were doing the video recording sessions, but Matt Fairfax gave me the OK this week to show off what the Undercity is to you guys here (since he said you guys were all so awesome for pre-ordering T3D).

So what I am going to do for you guys is update this thread throughout the next few days (sorry I dont quite have enough time to make a massive post at one time) posting more information about the level and how it was made (my mad logic) so that you guys can get a good sampling of what's in store when you guys first start working with it.

fosters.realmwarsgame.com/undercity/ucity00_sml.jpg
Click Here for larger version

Some basic info about the project...

[u]Timeline: [/u]
2 weeks (just before GDC) to discuss, plan and implement the whole thing.

[u]Objectives: [/u]
Show off the lighting; Make an entirely interior based level; Make it deathmatch capable

[u]Design logic: [/u]
The idea here was really to create a victorian inspired sewer system with lots of twist and turns. The tunnels would eventually enter into a large cistern room where all the fun really happens (aka. horrible death). I also really wanted to step aside from the tupical hard edged look you see in Torque and go with a lot of curved surfaces to accentuate the lighting.

[u]Some Fun Facts:[/u]
- There are 45 dynamic lights in the scene. Unlike the old SG light system which relied on datablocks (which were a pain to access and adjust), the new system allows you to unique control the RGB value of the light, its radius/emission ranges, shadowcasting abilities. Best of all changes update in real-time in front of your eye, making for a very visual tool that allows your creativity to flow.
- Aside from the player model and weapon (which were provided by GG) all of the art in the level was created by scratch for the demo (I will go into more detail later about how it was created). It's slightly heavier in polygon count than one would typically use, but hey it's a demo :)
- There are 100 TSStatic shapes in the scene and no DIF/BSP shapes, it's all ColladaDTS and regular old DTS. This includes the 'interior' shape, various barrels and crates (whats a FPS without these?), pipes, guard rails, stairs, pipe drains and light fixtures (to name but a few).
- Placing everything in the scene was definately no where near as painful or annoying as it was back with TGEA.
- Aside from the lights being dynamic and real-time, one of the other cool things I have to talk about as an artist is the fact that T3D updates everything real-time, so you don't need to restart the app or run a script to regenerate the materials. This helped simplify tweaking or fixing problems with the art or other visuals.


In my next update I will post a bit about the how cool the dynamic lights are (with likely a video) but in the mean time here are a couple of other images...

fosters.realmwarsgame.com/undercity/ucity01_sml.jpg
Click Here for larger version

fosters.realmwarsgame.com/undercity/ucity02_sml.jpg
Click Here for larger version

Edit: Fixed some of the formatting. Also if you have questions just ask.
Page «Previous 1 2
#1
04/08/2009 (9:18 am)
I do like the curved surfaces, makes it feel much more organic than lots of flat, rectangular walls.

How much of a performance hit does the dynamic lighting give?
#2
04/08/2009 (9:48 am)
Hehe, I saw that demo come together, and you guys did a great job on that level! You should definitely show the light and shadows being affected by the overhead fan.
#3
04/08/2009 (10:42 am)
@Steve, the lights themselves have very little performance impact. Having them cast shadows is typically what ends up costing you, but there are a bunch of options for what type of shadow map it can use, and the shadows have LOD so that if you're out of range or the like, they won't update (if I remember correctly).
#4
04/08/2009 (10:54 am)
Beautiful screenshots. One question on the 02 screenshot, the purpleish stuff on the ground near the camera. Are those decals or part of the texture?
#5
04/08/2009 (11:05 am)
Awesome!
Can't wait to see some video.
#6
04/08/2009 (6:46 pm)
Hey Logan,

Few questions and nitpicks, first do you have anisotropic filtering on? The textures seem to get very muddy after a few feet. The second image also has a strange blurring of the floor texture right at the bottom any idea what this is about? Also I notice the shadows mostly go to full black, does this demo support some kind of ambient lighting system so we don't have to have this happen? Also I'm happy to hear the amount of .dts models in the scene it sounds promising, any idea how many textures, and what the average resolution is? Lastly, I noticed you said that there was no use of .diff/bsp brushes, why did you decide to go this route? Wouldn't building atleast the base level out of bsp have many benefits, or does T3D work better with .dts models?
#7
04/09/2009 (4:27 am)
And how about visibility culling without BSP? How is it working?
#8
04/09/2009 (5:39 am)
Hi, Logan Foster, Where you get the Torque3D, I have purchased it, but nothing is available in my account.It there a beta one already available for T3D owner?
#9
04/09/2009 (7:19 am)
@Huan: The beta is not yet available.
#10
04/09/2009 (7:25 am)
GG gave out several copies to key peeps call "TORQUE3D HANDS ON PREVIEW" it shows up on some peoples mini-profile.
#11
04/09/2009 (7:40 am)
*wipes drool off mouth* ... Wow. :)
#12
04/09/2009 (9:39 am)
Sorry for the delay in posting any responses/updates I got caught yesterday finishing some work for Lore Aftermath and didn't have a chance to look at capturing any video until much later in the evening.

With that said here is a quick video I took and pulled together of the environment. The first half just quickly shows off how dynamic the lights are updating in real-time as the light's position and color change as well as how it reacts to animated objects in the scene such as the fan blades, the player model or the spinning healthkit item. The second half of the video is just me walking around some of the environment to show it off a bit more.


Note: I had to capture the video with Camtasia so the framerate isn't great. Also I am posting this while the video is being processed by Vimeo so there might be a 30 minute delay until its ready.
#13
04/09/2009 (10:10 am)
@Steve

A few lights don't cause too much of a performance hit, but using a lot of lights like we did, and I will fully admit in a careless manner too since the goal was to just make it look nice and not optimal, will cause degredation. So with that said it's something you really need to use intelligently if you want to hit a wide range of PC without hindering performance.

In a perfect world however a person would actually use lightmaps to handle most of the lighting on this level (since the lighting is fairly static) and have only a few dynamic lights which cast shadows onto everything else.

@Michael

Thanks.

@JC

Purplish stuff? That might be the treadplate on the stairs that you are refering to picking up the blue and green lighting that in that scene, however it shouldnt be appearing purplish (unless you are talking like a real faint purple hue).

@Brian

I am unsure if antisotropic filter is on or not... but probably not.

With regards to the Ambient lighting, there is only the faintest of ambient lighting in the scene (I am personally not a fan of pitch black darkness). There are two reasons for this. The first is that ambient lighting is a vicious lighting hack from back in the days when games couldn't do more than just a directional light and we needed a way to fake how the light rays bounce and fill light throughout your scene (ie. radiosity). The big issues with it is that it casts the same even amount of light from all directions which can cause depth and form to be lost and depending on the system can make your scene look washed out. The other reason for not using much ambient is that we really just wanted to show that this scene was being lite solely by rays from the lights, there were/are no hacks or cheats involved. Here is a really good article posted by one of the guys who develops Mental Ray, discussing the problems with Ambient Lighting (and how to best correct them, but in a higher end radiosity solutions).

With regards to textures I belive there are about 20 textures in use in this scene (most are about 512x512) including normal maps.

With regards to DIFs, GG informed us when we started this that the DIF format is basicly going to be considered as a deprecated format for T3D and we should use Collada instead. This made me very happy, though it worried Adrian a little bit initially since hes familiar with BSP. While I know that there are some benefits to DIF, from an artistic standpoint it's a pain in the ass to work with and slows down productivity. There is no possible way I could have built such a scene like I did as a BSP, nevermind do all the necessary tweaks and adjustments to it in real-time. Plus there's the fact that if you really want to make things look next-gen its not just a matter of having high resolution bitmaps and per-pixel effects that sells the look, its also in a large part having nice smooth looking geometry whose faces don't meet at hard edges. Another thing to keep in mind too is that most game engines out there have moved away from BSP and instead use a variety of methods to simply prevent non-visible or occluded polygons from rendering (Unreal goes this route). Someone from GG would have to tell you the method they use, I just push pixels :)

@Andrea

Hopefully someone from GG that isn't swamped with getting T3D ready to release will have a moment to post some information on what they are doing.

@All

One thing to keep in mind with lighting too is that at best shaders are written to handle up to 4 lights being cast on them. I could be wrong on this but I believe that most of the stuff in TGEA (and possibly T3D but I will let someone with knowledge on this correct or confirm it) only handles 2 lights. So you really don't want to try to cram too many lights into a small area. But with that said, normal bump maps really shine when you can put at least 2 light onto the model since it gives the math 2 sets of lighting vectors to calculate from.
#14
04/09/2009 (11:07 am)
@Logan, well, with the deferred renderer, you don't really get the exponential hit for lights that you used to with the forward renderer (since instead of rendering a certain object up to 4 times, it only has to render X lights into the light buffer, then sample from that one light buffer texture when rendering the regular geometry). So the main thing that will cause performance hits with the lights now is if you have them casting shadows.
#15
04/09/2009 (11:48 am)
Since I am no longer under NDA to Autodesk for Max 2010 I can show some screenshots of the primary level shape/object that the Undercity demo uses.

fosters.realmwarsgame.com/undercity/ucity04_sml.jpg
Click here to see larger version.

As I mentioned before all of the objects that we created for Undercity are either DTS or Collada, depending on what we needed from the object. Since I was helping to test 3DS Max 2010 at the time I figured I would use it to do all the Collada export and Max 2009 to do the DTS work (since I dont have an exporter for 2010 that does DTS).

The Collada shapes were exported using the standard Filmbox plugin that most of the Autodesk software ships with, then loaded into Torque. Collision is handled by the new polysoup options (that you have probably seen demoed before). For the most part Polysoup works great out of the box, there are a few small caveats such as dont have faces on your model smaller than 0.1 units in size (the collision fails and will stop the player model dead in its tracks) but for brainless collision generation you cannot really complain :)

Some basic info on shape:
- Its almost 35,000 polygons all broken up into various different nodes.
- Smoothing groups are used to hide a lot of edges. Only when a texture changed did we consider allowing the smoothing group to form a hard edge. A lot of the detail comes from the camfering of edges which helps reduce that hard 90 degree angle you see while allowing the smoothign to properly blend between faces.
- The tunnels were made originall as straight segments and then I simply used various modifiers like Bend to give them their rounded corners.Everything was kept as an editable poly since it allows for a person to quickly add or take away edge loops quickly, much like you would when character modeling.
- The rooms were added to as time went on to make them more detailed. A lot of the shapes were dupilicated, slightly modified and reused to help fill the scene up. Other detail was quickly modelled into the room via simple modeling techinques. Basicly all of this was done to create more form to vary up the rooms as well as create more shapes for the lighting to work with to cast shadows.
- Basicly it was all very iterative. As soon as I had the basic shape setp and working, it allowed Adrian to go in and start to place stuff. Since Torque3D updates art changes on the fly, it was pretty simple for one of us to work on making the level art changes and another place it without disrupting work flow.

fosters.realmwarsgame.com/undercity/ucity06_sml.jpg
Click here to see larger version.

fosters.realmwarsgame.com/undercity/ucity07_sml.jpg
Click here to see larger version.

fosters.realmwarsgame.com/undercity/ucity08_sml.jpg
Click here to see larger version.

fosters.realmwarsgame.com/undercity/ucity09_sml.jpg
Click here to see larger version.

fosters.realmwarsgame.com/undercity/ucity03_sml.jpg
Click here to see larger version.

fosters.realmwarsgame.com/undercity/ucity05_sml.jpg
Click here to see larger version.
#16
04/10/2009 (8:34 am)
Another thing to mention is that alot of the optimization for Torque 3D lighting has not occured yet.

So with 45 lights the system is working pretty damn sweet already.

I just commited shadow LOD into the trunk yesterday... that should improve the Undercity level to some extent (i haven't tested it).

Also as i write this i just considered that we can easily use the brand spanking new GFXOcclusionQuery object to further optimize shadow updates for tight levels like this one.
#17
04/10/2009 (10:10 am)
@Logan: The purpleish stuff I was referring to was upon viewing the video a shadow cast by the overhead fan I believe. Wasn't purple after all, was just the tint in the shot. The fan and moving the lights around while placing gave a good demonstration of the lighting BTW.

For now I'll soak in the last sentence of Tom's post and let my mind wonder. =)
#18
04/11/2009 (12:17 pm)
So a little follow up... GFXOcclusionQuery rules.

I've cut down shadow updates in Undercity by more than half just with that. Places where it wanted to update 15-20 shadows to render the frame... its now updating 7 or 9 shadows. Frame rate is stable in debug builds in most areas of the map.

I'm now looking at a little smarter prioritization of shadow updates and adding a shadow render time budget. This should allow it to scale much better.

Did i mention that we haven't even really started optimizing things? ;)
#19
04/11/2009 (3:32 pm)
Great work Tom, you guys sure are whipping up and appetite for Torque 3D
#20
04/12/2009 (5:45 am)
Are there potential performance problems to expect from occlusion queries in SLI / CF scenarios with alternate frame rendering?
Page «Previous 1 2