Jump to content
The Dark Mod Forums

Advantages of Func_Static


Capela

Recommended Posts

In short:

 

Brushes and patches (also models) that are func_static (not worldspawn) do NOT:

 

Intersect other brushes. They can keep triangle count down by not "cutting up" geometry.

Seal areas. For this you need brushes with a sealing material (caulk or normal textures).

Effect AI pathfinding. You have to "monsterclip" them.

 

it makes 4 Brush in to one so i can push the limit of objects
There's no limit for the number of brushes in a map. If by object you mean entity then they count against this. Func_statics are entities.

 

They can also improve performance by disabling shadow casting on them (with the "noshadows" spawnarg set to 1).

 

There's more but these are the important points.

Link to comment
Share on other sites

One other downside to func_statics is that they can't be cut in half by visportals. If you have a big func_static and have a visportal running through it, the full func_static will be rendered even if the visportal is turned off. This could affect performance.

But you should walk having internal dignity. Be a wonderful person who can dance pleasantly to the rhythm of the universe.

-Sun Myung Moon

 

My work blog: gfleisher.blogspot.com

Link to comment
Share on other sites

They won't cut up terrain:

Good- fewer tris. Though the engine can push a lot of tris.

Bad- they DON'T cut up tris.

 

example, you have a really huge wall. All the details are func_statics so the wall is just 2 tris. Sounds good right? Well, imagine you have 4 lights outside that all hit one or both of these tris. Then you have 4 lights inside that extend through the wall and also touch these 2 tris. That's 8 lights and that is going to hit your performance.

Would be better to leave some details that touch the wall as worldspwan so the wall is cut up into more tris.

Now the wall and details make up 60 tris, but they are small so no more than 3 lights ever hit any tris. Will perform better.

 

Also, func_statics DO cut up tris. They cut up touching brushes within their func_static. and unlike worldspawn those tris don't get culled. So if possible it's best to do that work on your own and caulk hidden faces.

And I know some people will argue that it's only a few tris and you don't need to caulk them, but the detail of one building could have 50-300 tris, and they are all being hit by lights. They are effecting performance in some way even if minimal (much less so if the f_s is noshadows 1). It really is best to caulk unseen faces.

You can also split func_statics into two. say you have a grid of beams. Make all the horizontal beams one func_static, all the vertical another. that way they don't slice each other up and triple the tri count on themselves.

 

They will leak, but a simple caulk brush behind them can seal.

 

Spanning portals can be bad or good. Also spanning caulk. You can make visportals smaller by running a caulk wall through an angled roof (so it's straight up from the building side). Then make the roof a func_statics and the caulk wall running through it won't cut up the roof and leave a weird hole.

 

-------

But you're right, when combining them you can have quite a few brushes into one f_s instead of having a bunch of f_s's.

------

Player can walk on them, ai can't.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

A big plus of func_statics is that they do not interfer with brushes. This is quite useful for rooftops for example. You can place the func_static directly inside a caulk brush and it is drawn fully. This makes visportalizing outdoor areas quite handy. It is also useful for decorations, trim etc., again especially in areas you need to visportalize.

 

If you need something several times, like windows, trim and so one, func_static provides the benefit that they are only loaded once. This helps decreasing load time. Making them non solid and using simple clip brushes instead can also help performance a bit, but is only necessary in areas with lots of details.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

I mostly use them as a "grouping" alternative, so I can manage working with loads of small geometries that are supposed to be a whole object (say, a complex wall). You can select a func_static and hit Tab to jump from one part of the group to another if you want to edit something in particular. Or you can revert to worldspawn, deselect the piece you want to edit in detail, and func_static the rest of the group again; after the editing, select the missing piece and merge it.

Edited by RPGista
Link to comment
Share on other sites

Keep in mind though that in the latest version Darkradiant there is a bug where moving around sloped func_statics will cause them to change their shape, so be wary of that.

But you should walk having internal dignity. Be a wonderful person who can dance pleasantly to the rhythm of the universe.

-Sun Myung Moon

 

My work blog: gfleisher.blogspot.com

Link to comment
Share on other sites

As I recall, some FS that was running between several (vertical) stories of the main building in Crystal Grave was collecting light count like

a bug-zapper. Correcting that problem doubled the FPS (or more) in affected areas.

 

Lesson: Make sure that you account for all (XYZ) directions when optimizing worldspawn vs func_static and splits.

Please visit TDM's IndieDB site and help promote the mod:

 

http://www.indiedb.com/mods/the-dark-mod

 

(Yeah, shameless promotion... but traffic is traffic folks...)

Link to comment
Share on other sites

  • 3 weeks later...

example, you have a really huge wall. All the details are func_statics so the wall is just 2 tris. Sounds good right? Well, imagine you have 4 lights outside that all hit one or both of these tris. Then you have 4 lights inside that extend through the wall and also touch these 2 tris. That's 8 lights and that is going to hit your performance.

 

Is there some way to tell the engine (in the future) to prevent processing lights, that are not visible? Say they are in a closed vis_portal or they are outside the house, where the vis portal doesn't even show up.

Why I ask is because if you build a bigger manor, then you'll have many light radius who cut themselfs many times and affect many tris at the same time.

post-3542-0-73136400-1362139599_thumb.jpg

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

You could use some scripting (zones for example) to improve this behaviour. Although I thought lights in not rendered rooms aren't rendered anyways. :unsure:

You could, for example turn the shadow-casting off if the player is far away enough. This helps performance and shouldn't look odd. If the lights are in different rooms, you can turn them off. (Would be a bit tricky to set up though).

 

I guess the easiest way is to avoid excessive overlapping. ;)

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

If every light would check every frame if it should be rendered or not, it could maybe need a big amount of ressources (?) So maybe if the visportal would be able to say: "I'm now visible, and so are all lights in my range" and "I'm now switched to closed so all lights are out now" (?)

Don't know :wacko:

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

You could probably script lights to turn off at a distance, or by triggers so if you know the player will never see the actual light from a source it will turn off.

 

probably more trouble than it's worth. And probably only worth doing a few lights if they really need it. Could get pretty complicated having tons of triggers around.

 

Also that pic above is 'wrong'. Lights appear to have a radius because of the shader textures on them. But all lights are square so they'd actually overlap more than that.

-------

Even if you leave a portal area the lights are still on, while they may not be cast on tris that are no longer rendered they can still be hitting tris through a wall and effecting performance. Best just to try and minimize that, smart light placement.

 

And also NOT optimizing terrain too much, so you have smaller tris that won't be hit by as many lights (balance between making them small but not making too many small ones).

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Best just to try and minimize that, smart light placement.

 

So to lit a room I woudl use many lights with short radius, or few lights with bigger radius?

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

I've built two manors (KM, PB) thus far and I feel that for a manor interior you can place lights in almost any way you want. Those areas are simple to compartmentalize, so in my opinion you do not need to worry the light placement or light radiuses too much. Just make small unimportant and frequent objects noshadows and you will be fine. In other words, keep everything noshadows, except large important things, furniture and objects that generate shadows large enough to have a gameplay effect.

 

 

So to lit a room I woudl use many lights with short radius, or few lights with bigger radius?

 

Just do what you want. Some rooms might be lit romantically with many small candles. Some rooms might have only one big light. Some rooms might have one big and a few smaller lights. Just do it so that it looks good to yourself, but with the limitation that do not make lights in the same room overlap a lot. Some overlap is fine: three or less overlapping radiuses per room are fine. Remember to keep the missions as a "sea of light with islands of shadow."

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Some overlap is fine: three or less overlapping radiuses per room are fine.

 

Okay, but if you look at the image above you can see that only three overlaps is almost impossible as the floor lights are cutting in the rooms and the lights of the other rooms are intersecting too!

 

Heh, I don't want to argue about this - I just want to get around my concerns of building a manor now.. :blush:

Edited by SeriousToni

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

Well, that pic is completely random, are those correct room sizes? light volumes, etc...?

 

We have a lot of indoor type maps and they all seem to perform pretty well, and i don't think any of the authors compromised on lighting too much.

 

It's just something you have to work with a bit to get best perf. Maybe slide a torch down the wall a couple units, cut up a brush somehow so it's tris are smaller... But that stuff only if you are starting to see a big drop in perf.

Dark is the sway that mows like a harvest

Link to comment
Share on other sites

Okay, but if you look at the image above you can see that only three overlaps is almost impossible as the floor lights are cutting in the rooms and the lights of the other rooms are intersecting too!

 

Heh, I don't want to argue about this - I just want to get around my concerns of building a manor now.. :blush:

 

In my opinion, you do not need to worry about the lights on the whole-map level. Only think about lights per room, ie. lights per visportal separated area.

 

On whole-map level Knighton Manor probably has a zillion overlapping lights. Only the lights that are in the same and adjacent accessible VP area counts, I think.

 

Don't worry about it, just map. It will be just fine.

  • Like 1

Clipper

-The mapper's best friend.

Link to comment
Share on other sites

Second that. I've also often used shadow casting lights that intersect each other. Never thought about their placement in terms of performance and never ran into problems there. You can think about optimization if you notice performance problems.

FM's: Builder Roads, Old Habits, Old Habits Rebuild

Mapping and Scripting: Apples and Peaches

Sculptris Models and Tutorials: Obsttortes Models

My wiki articles: Obstipedia

Texture Blending in DR: DR ASE Blend Exporter

Link to comment
Share on other sites

The thing is that I never saw a bigger manor map yet. For my second map I have made the plans ready and started mapping in my little spare time, but I really don't want to end with a map I worked on over a year just for realizing that four floors with each 20 rooms just do not work well with the engine.. :unsure:

 

Believe me, I'm not saying you're talking bullsh*t! I'm just unsure.

"Einen giftigen Trank aus Kräutern und Wurzeln für die närrischen Städter wollen wir brauen." - Text aus einem verlassenen Heidenlager

Link to comment
Share on other sites

One way to get around this is to use the "light_center" spawnarg. This determines where it looks like the light is coming from (for drawing the light texture and casting shadows). So what you can do is place a light in the middle of the room and then move the light center over to the wall (click on the light, go into vertex mode, and move the red dot you see at the center of the light, or just change the coordinates in the spawnarg). This makes it look like the light is on the wall but it's actually in the middle of the room. This can lessen intersects between rooms.

 

But what I've noticed is that you can get away with quite a lot in terms of overlapping lights (up to 3 overlaps w/out any big performance drop) - it really gets bad when you combine light overlaps with things like big spaces or you have 4 or 5 lights hitting in one spot. A good trick is to do what Badcog recommended in another post. In the map console type in r_showtris 1 and r_showlightcount 1. The showlightcount command will color how many lights are hitting each area and you can move things around or add brush detailing to just make sure you don't have too much intersecting in any one spot.

Edited by Moonbo

But you should walk having internal dignity. Be a wonderful person who can dance pleasantly to the rhythm of the universe.

-Sun Myung Moon

 

My work blog: gfleisher.blogspot.com

Link to comment
Share on other sites

I'm just unsure.

 

I don't know how big your manor is gonna be, but I'm pretty confident you worry over nothing. Just plan it so that it compartmentalizes well and avoid long vistas or intersections where many VPs are simultaneously visible. That is the critical thing, not light placement. Of course if your map is gonna be ultra-large, then the amount of AI thinking will start to be a problem.

 

Even in the very unlikely case your worries are true, you could do some crazy tricks like having one location based trigger per floor that teleports lights on all other floors to a giant blue room and back.

 

Compartmentalization! Vista control! Total amount of AI! Entity limits! Those are the things that are worth worrying.

Clipper

-The mapper's best friend.

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

    • Petike the Taffer

      I've finally managed to log in to The Dark Mod Wiki. I'm back in the saddle and before the holidays start in full, I'll be adding a few new FM articles and doing other updates. Written in Stone is already done.
      · 1 reply
    • nbohr1more

      TDM 15th Anniversary Contest is now active! Please declare your participation: https://forums.thedarkmod.com/index.php?/topic/22413-the-dark-mod-15th-anniversary-contest-entry-thread/
       
      · 0 replies
    • JackFarmer

      @TheUnbeholden
      You cannot receive PMs. Could you please be so kind and check your mailbox if it is full (or maybe you switched off the function)?
      · 1 reply
    • OrbWeaver

      I like the new frob highlight but it would nice if it was less "flickery" while moving over objects (especially barred metal doors).
      · 4 replies
    • nbohr1more

      Please vote in the 15th Anniversary Contest Theme Poll
       
      · 0 replies
×
×
  • Create New...