Jump to content
The Dark Mod Forums

Best Practices For Large Areas?


Ratty

Recommended Posts

Picture this, a dark forest. The canopy disappears into mist and darkness above, the forest floor is invisible in the mists below. All you see are trunks. Huge vast trunks, several with large multilevel treehouse dwellings wrapped around them like wooden donuts. The trunks fade away into the distant mist and darkness.

 

The only sources of detail are the low polygon trunks and high polygon treehouse trunk dwellings, but the space they occupy is necessarily vast. Still we can make do with skyboxes and other magic to extend the illusion.

 

In Dromed there were things you could do, like for instance increasing the texture size for the sky, being clever about breaking up long lines of sight, using textures instead of brushes for distant objects you'd never get very close to. Are there similar "best practices" for Doom 3? Particularly in regards to lighting, but any other tips would be appreciated.

Link to comment
Share on other sites

Love these types of discussions: performance optimization! Well, aside from the normal/obvious (occlusion with mountains or walls, etc.), two things right off the top of my head:

 

1. Portals which close courtesy of thick enough fog (from Gildoran - I didn't know it was possible previously). Lay a really thick fog down and you can "square off" sections of the playspace with portals to the sky (as long as a framing structure supports them). They'll close with distance when the fog is thick enough.

 

2. In TDM, there is an optimization trigger which toggles the drawing of an object based on distance. So you could have a tree model or static which simply isn't drawn if the player is X distance away. Or, use that or a scripted trigger to douse a light when you're far enough away. With a complex enough setup, you could make it so when far enough away, true shadow casting light is turned off and replaced by a simple ambient light, until the player is close enough. Hey... that's not a bad idea. :huh: There are also many other possibilities like this with the scripting language. Hell, you could just script a light to turn off shadow casting at a distance. There's really a lot of power under the hood.

 

Edit: 3. Knew I was forgetting something. Related to both 1. and 2., TDM also has portals which can be forcibly closed or opened based on distance.

 

4. LOD (level of detail) control? Further away objects use lower detail models. Not in TDM at this time, but who knows? It shouldn't be too hard for anyone else to script anyway, based on the principles in 2. and 3.

 

Gil might have more suggestions. He's done wacky stuff with skyboxes.

Link to comment
Share on other sites

A lot of the same stuff will probably still apply. Splitting up line of sight to produce separated areas that you can portalize is still an important optimising trick, for example. And the less polygons the better, in any engine, so faking distant objects is still a good idea.

 

As for lighting: Shadows are more expensive than they used to be, and the more polygons that cast them the more expensive they are. Using non-shadow-casting lights where possible will help. Obviously this is a stealth game, so you can't turn all the shadows off, but you can usually get away with having only one or two shadow-casting lights in an area without creating any problems (or even zero if it's a low-light area). The more lights you have, the less useful the shadows are for hiding in anyway, so it's not really a bad thing.

 

You might be able to do a great big grid of portals all over the map (decently spaced out of course) and use the portal distance check to forcibly close them when they're a long way away. Combine that with a fog effect to hide the portals when they open/close, and you've got your forest map. B)

 

OTOH, too many portals and it starts running slower, so you'd have to do some experimentation to see how well it works and to find the optimal distance between portals. But I reckon it's definitely doable.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

For a forest I would avoid real shadows entirely. You could do quite well enough with projected lights that simulated the shadows of branches up above, since nobody would actually compare the shadow with the trees to ensure they matched.

 

With huge trunks it would also be pretty easy to portalise the forest. Rather than a single open area with trees in it, you could map it as a series of interconnected chambers surrounded by "trunks" (which are actually walls).

Link to comment
Share on other sites

You guys can look to the "Trail of blood" mission in the original T2 missions for an exact example of this. In fact I assumed you were inspired by this?

 

The way they walled things off was with huge stones, or cliffs made of stone, like large rock formations. But the areas were so wide you never really saw them till you were close up, because it was so dark, and they could get away with the huge areas because the geometry was so simple - flat areas of ground with a few cylinders here and there for trees, but they never had tops - they just dissapeared into the darkness above, and there was no visible skybox, just pitch black above (the trunks faded into the darkness above) so you couldn't see the tops of the trees sillhouetted against the sky, it was meant to be that you couln't see the sky through the tops of the trees I guess. And they had branch objects stuck on the trunks high up just within the limits of the light, to make it look like the tree foliage begun there and continued on into the darkness.

Link to comment
Share on other sites

You guys can look to the "Trail of blood" mission in the original T2 missions for an exact example of this. In fact I assumed you were inspired by this?

Actually it's a Star Wars Endor ripoff more than trail of blood (although it *is* in the "Maw"). There's no ground at all, that's way down deep in darkness. I'm still playing around with the canopy but simple blackness gives me the mood I want--an isolated universe of infinitely long trunks floating in blackness--though it's a tad boring, I'm still looking into branches, maybe a a real canopy with hints of the starry night sky peaking through ... I can't decide! I'll probably run bpth version past a few people when I've gotten far enough to get a better opinion.

 

It's mostly eye-candy. The player doesn't move around in it much more than looking out over it from their balcony so that makes things a lot easier. I don't think there would be a need to close off portals based on foggy distance since the player will be constrained to a relatively small area (though there will be other foresty areas that the player can move around in but these need not be so vast. Such a technique might come in handy there though). Everything will be lit with non-shadow casting lights--that's a good tip. Only a small area needs to have realistic lighting.

 

What texture should go on the distant walls? (The space is just an enormous cube) Since the effect is for everything to disappear into the blackness would plain black work just fine? Any other things as far as the texture goes that i should keep in mind?

Link to comment
Share on other sites

Since the effect is for everything to disappear into the blackness would plain black work just fine?

Yeah. Well I imagine you'd have several trees, and the light you place in the level won't be strong enough to reach beyond the last trees and hit the wall, so it should fade into blackness that way.

 

Doom 3 has some "dark holes" and other places that go infinitely dark at the bottom, so that even if you shine your torch down it, it stays black. It's cause they used black textures I think.

Link to comment
Share on other sites

For things fading to black, I'd recommend either using a fog (e.g. a pitfog) or using a filter blendlight.

 

Filter blendlights can also be used to slightly simulate soft-shadowing under eaves, behind support beams or behind bushes if you use them lightly and carefully. They're not perfect for shadows though, since lights shined into them won't brighten the area up, but that might not be noticable if the blendlight isn't very dark.

Link to comment
Share on other sites

I'd say "negative light" is sort of innaccurate; you're applying a multiplicative render pass to the surrounding area rather than subtracting light. (so no matter how much light you add, it'll still stay dark) But I guess the effect would be much the same to the player and I'm pretty sure the lightgem would be effected by it. Something to note is that it would darken the frob highlight, so it'd be a bad idea to use intense filter blendlights; if you used a dark-arrow or something to create a spot of pitch black, frob highlights wouldn't show up in the pitch black area at all.

 

You can see a poorly implemented example of what I'm talking about with the soft-shadowing under the beam in this post. (in a real map, it'd probably be lighter and softer) To add such a thing to your map, just place a light and change its type to filter_blendlight (or something like that - it should be near the top). The brighter you make it, the more it darkens the area; a white light will be perfectly black at the center.

 

Note to the curious: As far as I know, no "dark-arrows" are planned for TDM, but I seem to remember SneaksieDave wanting to implement something like that for his maps.

Link to comment
Share on other sites

Now that would be cool. :) Might make it too easy to hide from him though.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

  • 4 weeks later...

Now that would be handy, a higher than normal levelinfo type light value, for an outdoor area. Then some negative light so the dark corners can still be dark.

 

I guess you could always fill corners and holes with dark textures and with scripts that darken the lightgem when you are in them.

Link to comment
Share on other sites

Can somebody help me visualize negative light?

Well, you can't, that's sort of the point. :P

 

It would just make the surrounding area darker, in the same way that normal lights make the surrounding area lighter. Physically it's a pretty silly concept, but for game worlds it could be quite useful, especially when fine control over shadows is useful (as in stealth games).

 

SneaksieDave - I don't think Thief 3 can do that, though I could be wrong. I wouldn't be surprised if the Dark engine could do it though, since it bakes its lightmaps. A dynamic lighting system would have more trouble with negative light, given the way in which lights are usually rendered in such an engine (using multiple additive passes). You'd have to do the "darkening" passes separately, and they probably wouldn't interact with the rest of the lighting very well.

My games | Public Service Announcement: TDM is not set in the Thief universe. The city in which it takes place is not the City from Thief. The player character is not called Garrett. Any person who contradicts these facts will be subjected to disapproving stares.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recent Status Updates

    • nbohr1more

      Was checking out old translation packs and decided to fire up TDM 1.07. Rightful Property with sub-20 FPS areas yay! ( same areas run at 180FPS with cranked eye candy on 2.12 )
      · 2 replies
    • taffernicus

      i am so euphoric to see new FMs keep coming out and I am keen to try it out in my leisure time, then suddenly my PC is spouting a couple of S.M.A.R.T errors...
      tbf i cannot afford myself to miss my network emulator image file&progress, important ebooks, hyper-v checkpoint & hyper-v export and the precious thief & TDM gamesaves. Don't fall yourself into & lay your hands on crappy SSD
       
      · 5 replies
    • OrbWeaver

      Does anyone actually use the Normalise button in the Surface inspector? Even after looking at the code I'm not quite sure what it's for.
      · 7 replies
    • Ansome

      Turns out my 15th anniversary mission idea has already been done once or twice before! I've been beaten to the punch once again, but I suppose that's to be expected when there's over 170 FMs out there, eh? I'm not complaining though, I love learning new tricks and taking inspiration from past FMs. Best of luck on your own fan missions!
      · 4 replies
    • The Black Arrow

      I wanna play Doom 3, but fhDoom has much better features than dhewm3, yet fhDoom is old, outdated and probably not supported. Damn!
      Makes me think that TDM engine for Doom 3 itself would actually be perfect.
      · 6 replies
×
×
  • Create New...