Making a map optimization friendly can be a huge boost in framerates for your map. When you run the map optimizer, it tries its best to find all areas that the playing area can reach. Basically, it starts at each player start-point and uses a path-finding algorithm to locate all edges that can be reached. It can take a while to do this. All edges outside this area (And all prefabs that it cannot reach) are not included in the collision map. Once it has found all lines and prefabs its possible to touch, it uses that as the game area. The smaller the game area the better. If any point on a line is included, the entire line is included. Therefore, you should try to follow the following guidelines in keeping your map optimized.
Example image of the mining facility collision map after optimization: (Notice how all of the collision lines and prefabs outside the map have been removed from the possible collision map). You can get a collision map for any map you have or one you're making by pressing the console button (the ~ at the top left of the keyboard), and typing 'savecollisions' before loading the map in game. After doing this, a file will be created in the map's folder, called 'mapname_collisionlines.raw' These are RAW format triangles which you can import into programs like Blender3D (or other 3D packages) using the 'import' command. RAW TRIANGLES. You can also use this to custom-fit when making custom prefabs for your maps! This is what it's doing while it optimizes - the spiderweb is its basic fill routine, covering any place it can get to from the start point. It does this many times a second: Cheap but effective! Example of using a prefab to prevent unneccesary collision map from being exposed: Starmap. I've drawn a red oval around the block (sunken under the hyperchannel) that was put there to prevent the collision lines from 'leaking' into the useless area. Starmap, During scanning. Notice that the white cobweb of lines is blocked from entering that tiny zone. That means all of the collision stuff behind it will not be used in game, greatly speeding up the physics. |
Editing/Modding >