Lag and Script Objects

If you're looking for mapping help or you reckon you're a mapping guru, post your questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Gen Cobra
Major General
Posts: 739
Joined: Tue Jan 28, 2003 4:26 pm

Lag and Script Objects

Post by Gen Cobra »

Ok so I wanna know if complex script objects cause lag? And if so is there anything I can do about this? I kinda screwed myself on my new map by creating such large script objects. And one other thing, they tend to disappear with a farplane when they are not supposed to even if i choose not to cull the farplane. Any help would be most appreciated. thanks.
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

faces

Post by tltrude »

IF there are a lot of faces (polygons) in the map it will cause lag. That is why we caulk all hidden faces. The game will cull textures at a distance because of the settings (or lack of them) in the texture shader.

If a shader does not have "cull none" it defaults to "cull front", so the brush with that texture will loose its outside faces when seen at a distance. Here is what the shader bible says about it.

--------------------------------------------------
3.2 cull <side>
Every surface of a polygon has two sides, a front and a back. Typically, we only see the front or "out" side. For example, a solid block you only show the front side. In many applications we see both. For example, in water, you can see both front and a back. The same is true for things like grates and screens.

To "cull" means to remove. The value parameter determines the type of face culling to apply. The default value is cull front if this keyword is not specified. However for items that should be inverted then the value back should be used. To disable culling, the value "disable" or "none" should be used. Only one cull instruction can be set for the shader.
--------------------------------------------------
Tom Trude,

Image
Balr14
Colonel
Posts: 450
Joined: Sat Aug 03, 2002 4:01 am
Location: Germantown, WI, USA

Post by Balr14 »

Lots of faces cause performance degradation, they don't cause lag. Only things sent in the packet cause lag. Scripting can cause quite a bit of lag. It may significantly increase packet size. Make your farplane distance greater to reduce culling.
User avatar
Gen Cobra
Major General
Posts: 739
Joined: Tue Jan 28, 2003 4:26 pm

Re: faces

Post by Gen Cobra »

Thanks guys. The problem with the towers disappearing is because I had it split in two. One half was for the script object. The farplane couldnt draw it even with cull set to no in the worldspawn??? So wtf is that? I'm trying now to use fog to make the map run good.

I've also wanted to fully understand hint brushes and never grasped the concept but I easily understand VIS grouping with leaf brushes. The Storms explaination was good but I felt that it needed to be more clarified with larger open areas where parts of the map must be drawn quite frequently. Hint?
Image
Balr14
Colonel
Posts: 450
Joined: Sat Aug 03, 2002 4:01 am
Location: Germantown, WI, USA

Post by Balr14 »

Even with cull = no, you will still get some culling if farplane is too short.

Hint brushes just cause additional view portals to be created. They are usually used to render things that otherwise aren't rendering correctly. But, they can be used to block parts of the map. For example, if you have an open L shaped hallway. You can't really see around the corner, but because each side of the hallway would have adjoining view portals, the entire hallway would be rendered. Placing a hint brush at the middle of the L will cause additional view portals to be created, so those on each side of the hallway would no longer adjoin, and the part of the hallway you can't see isn't rendered.

That is theory from the old days (Q1, HL, etc.), when vis calculations were done on a flat plane. In Q3, vis calculations are done in 3D space, so view portal breaks are much more likely. Unless you have a rectangular, featureless hallway, you are going to get a fair number of portal breaks. If you do have a rectangular featureless hall, you aren't going to save many faces by using a hint brush anyway.

Hint brushes are quite useless in large open areas, except to render things that won't render otherwise. This usually occurs with brushes that have odd angles.
User avatar
Gen Cobra
Major General
Posts: 739
Joined: Tue Jan 28, 2003 4:26 pm

Post by Gen Cobra »

Balr14 wrote:Even with cull = no, you will still get some culling if farplane is too short.
So why with the farplane set to cull = no does the only thing that seems to screw up is the towers? I mean everything else gets drawn from a very far distance and is darkened out just the way I wanted it to with farplane noit culled. I can't set the farplane to what i want it to be without the towers disappearing and reappearing all the time. :?
Image
User avatar
Gen Cobra
Major General
Posts: 739
Joined: Tue Jan 28, 2003 4:26 pm

Post by Gen Cobra »

Balr14 wrote:Even with cull = no, you will still get some culling if farplane is too short.
So why with the farplane set to cull = no does the only thing that seems to screw up is the towers? I mean everything else gets drawn from a very far distance and is darkened out just the way I wanted it to with farplane noit culled. I can't set the farplane to what i want it to be without the towers disappearing and reappearing all the time. :?
Image
Balr14
Colonel
Posts: 450
Joined: Sat Aug 03, 2002 4:01 am
Location: Germantown, WI, USA

Post by Balr14 »

Could be partially due to the textures you are using on the towers. Could be the towers do not have enough depth.
Post Reply