<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.randomgs.com/index.php?title=Optimization_for_newbies&amp;feed=atom&amp;action=history</id>
		<title>Optimization for newbies - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.randomgs.com/index.php?title=Optimization_for_newbies&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="https://wiki.randomgs.com/index.php?title=Optimization_for_newbies&amp;action=history"/>
		<updated>2017-08-12T03:17:13Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.1</generator>

	<entry>
		<id>https://wiki.randomgs.com/index.php?title=Optimization_for_newbies&amp;diff=177&amp;oldid=prev</id>
		<title>Shawn: Created page with &quot;[http://forum.randomgs.com/index.php/topic,10862.0.html Original post] by:[http://forum.randomgs.com/index.php?action=profile;u=228 Mehis]  Piece of advice before starting to ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.randomgs.com/index.php?title=Optimization_for_newbies&amp;diff=177&amp;oldid=prev"/>
				<updated>2012-01-25T16:31:22Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;[http://forum.randomgs.com/index.php/topic,10862.0.html Original post] by:[http://forum.randomgs.com/index.php?action=profile;u=228 Mehis]  Piece of advice before starting to ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[http://forum.randomgs.com/index.php/topic,10862.0.html Original post] by:[http://forum.randomgs.com/index.php?action=profile;u=228 Mehis]&lt;br /&gt;
&lt;br /&gt;
Piece of advice before starting to read this.&lt;br /&gt;
&lt;br /&gt;
If something doesn't work, don't give up. Optimization is part of mapping, what you want to learn. Without, people will complain about the lag. Which usually comes to removing your map or fixing it by decompiling, which makes it even worse.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Func_detail==&lt;br /&gt;
&lt;br /&gt;
Func_detail, is a brush entity, which doesn't counter with vis leafs. You could imagine it as it was not there. You can see through it, but not go through it. Like invisible wall, without being a wall.&lt;br /&gt;
&lt;br /&gt;
[https://developer.valvesoftware.com/w/images/8/81/World-vs-detail.png Here is an example of func_detail and a world geometry.]&lt;br /&gt;
&lt;br /&gt;
'''World geometry (left), Func_detail (Right)'''&lt;br /&gt;
Those boxes, corners highlighted with blue lines are leafs. They show what you can see and what you can't. Lets say there is a prop on the other side of the room, but you cannot see there. But, it doesn't mean the leaf you are IN can see it. If the leaf cannot see it you are in, neither do you. This is already calculated when you compile your map, that's why it's important to keep your map clean.&lt;br /&gt;
&lt;br /&gt;
Obviously the left one is bad. This is because it tries to calculate what player can see on those little leafs. This will result in compile log error '''WARNING: Cluster portals saw into cluster''' (usually). It basicly says, that there are too many leafs clustered together. In-game this usually causes huge fps drops, invisible walls, etc. Even problems, which doesn't have to do anything with the leafs. If you don't get this error, it doesn't mean your map can have these mistakes. VVIS (The leaf calculating program.) would take longer to compile your map. (No, VVIS does not compile your map. There are two other programs, which does own sections of your map.)&lt;br /&gt;
&lt;br /&gt;
[http://img860.imageshack.us/img860/1479/brush01.png (90 degree arch)]&lt;br /&gt;
Here, you have made an 90 degree arch. If you would now compile it without turning it into func_detail, it would take longer time to compile.&lt;br /&gt;
You could turn it as it is to func_detail. But, i'd rather do this: Taking the whole arch apart and make each section of it func_detail.&lt;br /&gt;
Press Ctrl+U. It ungroups the arch to their own smaller sections. [http://img710.imageshack.us/img710/1240/brush02.png Like this]&lt;br /&gt;
Now, simply click each section and press Ctrl+T. This creates brush entity. Select from the dropdown list func_detail. Repeat. (No, you don't have to press Ok or anything to apply this.)&lt;br /&gt;
If you want to move it around like arch again, select all the section and press Ctrl+G. It will group them back together.&lt;br /&gt;
The main point is to func_detail every single brush on it's own.&lt;br /&gt;
&lt;br /&gt;
This next picture, is a demonstration [http://img100.imageshack.us/img100/1488/brush03.png what you should func_detail and what not.]&lt;br /&gt;
Everything small or complicated should be func_detailed. Small slopes like this is usually func_detailed. However, if the slopes are big enough to block player's view, you can leave it as world geometry.&lt;br /&gt;
&lt;br /&gt;
Func_detail these.&amp;lt;br&amp;gt;&lt;br /&gt;
· Stairs&amp;lt;br&amp;gt;&lt;br /&gt;
· Slopes&amp;lt;br&amp;gt;&lt;br /&gt;
· Small geometry&amp;lt;br&amp;gt;&lt;br /&gt;
· Complicated geometry&amp;lt;br&amp;gt;&lt;br /&gt;
· Pillars, supporters, etc.&amp;lt;br&amp;gt;&lt;br /&gt;
· Thin brushes&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These you MUST func_detail. (func_detail is like every other brush entity. Other entities like func_brush, func_illusionary, too doesn't counter with leafs. If you want to make them func_brush for an example, it will act like func_detail. Func_detail is just the cheapest version of all of them.)&lt;br /&gt;
&lt;br /&gt;
'''More examples:'''&amp;lt;br&amp;gt;&lt;br /&gt;
http://img853.imageshack.us/img853/6517/brush05.png&lt;br /&gt;
This ceiling is problematic. Ceilings are usually world geometry, but in this case it isn't. If the ceiling is func_detail, then you'll just have to cover it with brushes.&amp;lt;br&amp;gt;&lt;br /&gt;
http://img3.imageshack.us/img3/6301/brush06.png&amp;lt;br&amp;gt;&lt;br /&gt;
http://img507.imageshack.us/img507/2586/brush07.png&amp;lt;br&amp;gt;&lt;br /&gt;
http://img844.imageshack.us/img844/6200/brush08.png&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://developer.valvesoftware.com/wiki/Func_detail Read more about func_detail]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Fade distance==&lt;br /&gt;
&lt;br /&gt;
Fade distance is the most easiest part of optimization. With fade distance, all props (Some entities. This includes, weapons, healthstations, etc.) fades away. This means that the prop isn't rendered anymore in certain distance.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[http://img845.imageshack.us/img845/7162/brush09.png Simply go into prop's properties and choose your fade distance.]&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
600-1000 indoors&amp;lt;br&amp;gt;&lt;br /&gt;
1000-3000 outdoors&amp;lt;br&amp;gt;&lt;br /&gt;
You'll just have to experiment and find the right one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Helping VVIS==&lt;br /&gt;
&lt;br /&gt;
In this section, you'll have to use your brain and know something about HINT and SKIP textures. '''Skip''', like the name, is nothing, skipped. It doesn't do anything. It's not rendered. When map compiles, all faces with SKIP gets removed completely (You cannot use SKIP texture like nodraw. E.g, for optimization purposes). They aren't there anymore. '''Hint''' however, 'blocks' leafs from going through it. It cuts them into own seperate pieces.&lt;br /&gt;
&lt;br /&gt;
http://img16.imageshack.us/img16/4331/brush10.png&lt;br /&gt;
Lets say you compile your map, you use mat_wireframe 3, but you can still see the barrel from the other side of the wall. This means, that the leaf you are in, can see the leaf where the barrel is. You don't want it to do that.&lt;br /&gt;
&lt;br /&gt;
You fix the problem, by adding a SKIP textured brush [http://img580.imageshack.us/img580/4940/brush11.png like in the picture] and making '''one''' of the sides HINT texture.&lt;br /&gt;
Imagine it as a wall, you can't see it and you can go through it.&lt;br /&gt;
&lt;br /&gt;
If player can go over the wall, you just put another one [http://img853.imageshack.us/img853/3518/brush12.png like this]. Imagine it as a ceiling, you can't see it and you can go through it.&lt;br /&gt;
Now the 'player-leaf' can't see the 'barrel-leaf'.&lt;br /&gt;
&lt;br /&gt;
This doesn't mean, that the leafs must be blocks. This is perfect [http://img833.imageshack.us/img833/9871/brush13.png example].&lt;br /&gt;
The players cannot see each other, until one of them steps inside the hint brush.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Areaportals==&lt;br /&gt;
&lt;br /&gt;
Areaportals are used to block player's view to the other side of the areaportal. They are usually placed on doors, windows, small cracks, etc. The engine in-game calculates what player can see and what not.&lt;br /&gt;
Just make a brush size of the door and texture it with areaportal texture. Ctrl+T and from dropdown list select func_areaportal. Make sure that initial state is closed. (If the door is closed.)&lt;br /&gt;
&lt;br /&gt;
Here is an [http://img213.imageshack.us/img213/9480/brush16.png example]. We could simply put an func_areaportal on the door, but OH NO! There is a gap in the wall! If we would compile the map without fixing the gap, it would crash the game. That's why there is func_areaportalwindow for the gap.&lt;br /&gt;
(Imagine the void as skybox.)&lt;br /&gt;
Now when it's [http://img851.imageshack.us/img851/1103/brush17.png fixed], you can happily play your map.&lt;br /&gt;
&lt;br /&gt;
[http://img828.imageshack.us/img828/9946/brush18.png Example what areaportals do].&lt;br /&gt;
When the door is closed, both barrels aren't rendered for the player. When the door is opened, player can only see the white barrel. If the player moves more to the left, the brown barrel would be rendered eventually. Cool isn't it?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Occluder==&lt;br /&gt;
&lt;br /&gt;
Occluder is mostly used when you cannot use areaportals. It calculates, if the player can see all the content what's inside it.&lt;br /&gt;
Pretty much works like areaportal. Make a brush '''bigger''' than the model, use occluder texture on it. Ctrl+T, func_occluder.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Others==&lt;br /&gt;
&lt;br /&gt;
Connecting walls [http://img403.imageshack.us/img403/4081/brush15.png like this], optimizes your map too. It saves one face from rendering. It might not sound much, but it makes the map more clean.&amp;lt;br&amp;gt;&lt;br /&gt;
Nodraw. Simple as that. Apply nodraw texture on every face where player can't see. This includes unreachable places such as roofs and skyboxes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[User:Shawn|Shawn]] 10:31, 25 January 2012 (CST)&lt;/div&gt;</summary>
		<author><name>Shawn</name></author>	</entry>

	</feed>