null on 25/2/2005 at 03:39
Hey --
So, this is a real time, per-pixel lighting engine. Performance can be a total nightmare, even on the PC.
1) Keep your spaces tight and twisty, lots of narrow apertures for double-portals. Two portals snapped to the geometry fairly close to each other (like on either side of a thick door frame) really help force the renderer to *only* render what you can actually physically see
2) Keep your number of true shadow-casting lights *low*, like 2 to 3 in a room. (You can change lights from shadow-casters to simple fills by altering the LightType property. You'll find it.)
3) Keep the radii of these as *low as you possibly can* because the larger they are, the more objects and BSP surfaces they strike. You want to minimize overlap between shadowcasters, as well, because almost nobody even sees the weaker shadow that an object casts, it's a big waste. Keeping the radii low is conducive to that purpose.
3) Supplement these with dim 'moonlight' lights that don't have a lot of effect on the light gem (LightType OmniNoShadow, I believe)
4) Static meshes, when placed in game, default to *not* cast a shadow. This is a very good thing, and will save you frame-rate. Once you've lit the space how you want it, then walk through it, and turn meshes that *must* cast a shadow on, one by one. Ignore the rest, as your players won't notice or care if some ugly sliver-shadow on a mostly-embedded wooden beam is missing. (you turn on mesh shadows by adding a property to the object, under the Render sub-head, as I recall.)
5) BSP, on the other hand, needs to have shadows manually toggled off for each surface. Fortunately, there's a select-all command, and a select-all-coplanar command, etc. I periodically selected all the BSP surfaces in my level, and turned shadowcasting off on all of them -- once again, walking through and fixing cases where it looked wrong, such as a surface that has a door cut into it, or a hatch, etc.
The reason you do this is that big BSP surfaces project MONSTROUS, WORLD INGESTING STENCIL SHADOWS into the void when struck by a shadowcasting light (one for each light!) even when you can't see them at all. That's one of the biggest performance hogs of all.
6) Fog is a separate rendering pass on everything. That can hurt. Some maps don't even need it. Use when you must, bail if you can make it look good. Horror experiences, for example, work better with pure-black contrasty shadows anyway, and fog washes them out.
7) Try to balance your polygon density (static meshes) in full knowledge of the fact that you're paying for *tons* of polygons worth of shadow volumes. Even on the PC, Thief maps won't be able to be chock-full of objects or architectural detail unless you literally plan to have no dynamic shadows.
8) Torch guards are a big investment. They can travel anywhere, adding a whole new rendering pass to any object struck by their torches. If you use them, keep their stomping grounds even more conservative, lighting-wise.
Good luck, all. Just thought I'd throw some of that out there to help prevent some of the the 'my god, I'm getting 5 FPS, and my map is only six rooms' posts we're likely to see.
- Ø
SlyFoxx on 25/2/2005 at 03:56
In other words. Take it easy you crazy taffers least ye tear out all your hair and crush your keyboard with your skull!
Hey null...I don't know how may FM's you've tried. But could frobber build his cathedral with this engine? ("The Innsurrection") Could be useful in dertermining some engine limitations. ;)
:sly:
Karkianman on 25/2/2005 at 04:44
soooooo... wait until next gen cards and proccessors before we go go all fritzy and stuff? once i get the editor working, i'll keep that in mind ;)
Durinda D'Bry on 25/2/2005 at 13:08
aha... now we know why game name is Deadly Shadows:)
jtr7 on 27/2/2005 at 21:36
Thanks, Null!
Hit Deity on 1/3/2005 at 06:05
I can barely move inside a very small level I've built. Playing it through the editor, so maybe that's the problem, but just a dozen very small rooms and the game bogs down to almost unplayability. Don't know what's doing it, but I don't have any AI, very few lights that have had their radii cut down drastically, and no other objects at all and it runs at about 5-10fps. Terrible!! :(
The Nay-Sayer on 1/3/2005 at 06:13
Quote Posted by Hit Deity
I can barely move inside a very small level I've built. Playing it through the editor, so maybe that's the problem, but just a dozen very small rooms and the game bogs down to almost unplayability. Don't know what's doing it, but I don't have any AI, very few lights that have had their radii cut down drastically, and no other objects at all and it runs at about 5-10fps. Terrible!! :(
You also have to break it down into zones (using portals) so that the game doesn't render the whole level at once... just go looking for some UT tutorials...
Ideally anything you can't see shouldn't be rendered.
Hit Deity on 1/3/2005 at 06:14
You're kidding, right? :wot:
Ok, thanks. I hadn't seen that yet.
The Nay-Sayer on 1/3/2005 at 06:39
Quote Posted by Hit Deity
You're kidding, right? :wot:
Ok, thanks. I hadn't seen that yet.
It's not like loading portals... it's purely to get better performance and (if done properly) it's unnoticable during play. It's a common part of all modern games. If they had to render all of their levels simultaneously they wouldn't work.
I recommend taking a look at a completed level and you'll see that probably most rooms or hallways are blocked off by portals.
SubJeff on 1/3/2005 at 11:21
Funny how you're here now isn't it? :tsktsk: