Due to the recent resurgence of spam, we have temporarily disabled user creation and page editing/creation as we resolve the issue.

Difference between revisions of "Resource Usage & Optimization"

From Snapwiki
Jump to: navigation, search
(Created page with "== Empty map == Empty map with no modules uses 4.02% Network, 0.58% Objects, 1.08% Network. == Objects == All objects can be separated in 5 different classes by their use of...")
 
m
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
The campaign and multiplayer maps maintain rendering and network performance by following guidelines during development. Optimizing maps can take an experienced developer months of work. The maps in SnapMap use similar guidelines to maintain performance, ensuring that all players who can play singleplayer/multiplayer maps can also play any SnapMap.
 +
 +
These guidelines come in the form of three budgets: Network, Objects, and Memory. Everything in the editor will have an associated cost, and the editor will not let you place more items if there is no more remaining budget.
 +
 +
The Network budget applies to all dynamic objects in a map. Anything that can change during the course of a map (FX, Pickups, Interactives, Volumes, etc) will take up a portion of the Network budget. The Objects budget applies to anything that is rendered and appears as a 3D object in the map. The Memory budget applies to everything and is a general measure of how much memory each object uses during a match.
 +
 +
 
== Empty map ==
 
== Empty map ==
Empty map with no modules uses 4.02% Network, 0.58% Objects, 1.08% Network.
+
An empty map with no modules uses '''4.02%''' Network, '''0.58%''' Objects, and '''1.08%''' Memory.
  
 
== Objects ==
 
== Objects ==
 
All objects can be separated in 5 different classes by their use of map resources. '''All objects within the same class use exactly the same amount of resources regardless of their type and properties'''
 
All objects can be separated in 5 different classes by their use of map resources. '''All objects within the same class use exactly the same amount of resources regardless of their type and properties'''
 +
 
=== Light objects ===
 
=== Light objects ===
These use 0% Network, 0.01% Objects, approximately 0.02% Memory. This class includes objects from the following categories:
+
These use '''0%''' Network, '''0.01%''' Objects, and approximately '''0.02%''' Memory. This class includes objects from the following categories:
 
* AI
 
* AI
 
* Audio
 
* Audio
* Communication: Message, Callout, POI Settings, Objective
+
* Communication: [[Message]], [[Callout]], [[POI Settings]], [[Objective]]
* FX: Spot and Point Light
+
* Gameplay: [[Map]], [[Module]], [[End_Game|End Game]], [[Gameplay_Settings|Gameplay]] and [[Score_Settings|Score Settings]]
* Gameplay: Map, Module, End Game, Gameplay and Score Settings
+
 
* Player & Team
 
* Player & Team
* Events and Item Spawn Settings
+
* [[Events]] and [[Item_Spawn_Settings|Item Spawn Settings]]
 
* Flow
 
* Flow
 
* Input/output nodes used in logic chains
 
* Input/output nodes used in logic chains
This class of objects consume the least amount of resources per object. They use more Memory than Objects, so Memory is their limiting factor. A map may contain at most approximately 5000 Light objects.
+
This class of objects consume the least amount of resources per object. They use more Memory than Objects, so Memory is their limiting factor. A map may contain at most approximately '''5000''' Light objects.
 
=== Heavy objects ===
 
=== Heavy objects ===
These objects use the same amount of Objects and Memory as the Light ones: 0.01% Objects and 0.02% Memory. The difference is that they also use 0.15% Network. This class includes objects from the following categories:
+
These objects use the same amount of Objects and Memory as the Light ones: '''0.01%''' Objects and '''0.02%''' Memory. The difference is that they also use '''0.15%''' Network. This class includes objects from the following categories:
* Communication: HUD Settings
+
* Communication: [[HUD_Settings|HUD Settings]]
* Exploders
+
* [[Exploders]]
* FX (except for lights)
+
* [[FX]], [[Lights|Spot and Point Light]]
* Gameplay: Teleporter Pad and Destination, Camera
+
* Gameplay: [[Teleporter_Pad|Teleporter Pad]] and [[Teleport_Destination|Destination]], [[Camera]]
* Interactives
+
* [[Interactives]]
* Small & Large props.
+
* [[Small_Props|Small]] & [[Large_Props|Large Props]]
* Pickups.
+
* [[Pickups]]
* Spawners: Encounters and item spawners
+
* Spawners: Encounters and [[Spawn_Items|item spawners]]
* Variables
+
* [[Variables]]
 
* Volumes
 
* Volumes
* Weapons
+
* [[Weapons]]
For these objects the limiting factor is Network. You can only have around 645 оf those in a map. These objects all use the same amount of resources each, whether it's a fancy FX, soda can, huge crate, volume of the size of the Foundry module, or just a boolean variable.
+
For these objects the limiting factor is Network. You can only have around '''645''' оf these in a map. These objects all use the same amount of resources each, whether it's a fancy FX, soda can, huge crate, volume of the size of the Foundry module, or just a boolean variable.
=== Demons ===
+
=== [[Demons]] ===
Aside from 64 demon limit, they also use 0.15% Network, 0.30% Objects and 0.02% Memory. Again, all demons are equal, whether it's a Baron of Hell or a Possessed Worker. 1 Demon is equal to 1 Heavy object in terms of Network and Memory and 30 Light/Heavy objects in terms of Objects.
+
Aside from the 64 hand-placed demon limit, they also use '''0.15%''' Network, '''0.30%''' Objects and '''0.02%''' Memory. Again, all demons are equal, whether it's a Baron of Hell or a Possessed Worker. One Demon is equal to one Heavy object in terms of Network and Memory and 30 Light/Heavy objects in terms of Objects.  
=== World Text ===
+
=== [[World_Text|World Text]] ===
These objects use 0% Network, 0.40% Objects (more than a demon!) and 0.04% (0.0385%) Memory. The limiting factor here is Objects footprint. You can have at most around 250 World Texts in a map.
+
These objects use '''0%''' Network, '''0.40%''' Objects and '''0.04%''' (0.0385%) Memory. The limiting factor here is the Objects footprint. You can have at most around '''250''' World Texts in a map.
=== Doors ===
+
=== [[Doors]] ===
These are created when you attach a new module to an existing one. They cost 0.30% Network, 0.01% Objects and 0.02% Memory. (2 Heavy objects in terms of Network).
+
These are created when you attach a new module to an existing one. They cost '''0.30%''' Network, '''0.01%''' Objects and '''0.02%''' Memory. (2 Heavy objects in terms of Network).
  
== Modules ==
+
== [[SnapMap_Modules|Modules]] ==
* All modules use different amounts of Objects and Memory.
+
All modules use different amounts of Objects and Memory in varying proportions. Because of that, it is faster and easier to see their footprint in the editor. Here are some general observations:
* Usage of Objects and Memory are not correlated. Let's take for example Foundry (9,03% O, 7,92% M) and Molten Vats (10,64% O, 4,94% M). Foundry uses ~3% more Memory, but Molten Vats uses ~1,5% more Objects.
+
* Usage of Objects and Memory are not correlated. Let's take for example Foundry ('''9.03% O, 7.92% M''') and Molten Vats '''(10.64% O, 4.94% M'''). Foundry uses '''~3%''' more Memory, but Molten Vats uses '''~1.5%''' more Objects. Total usage of resources though is proportional to the size of the module.
Total usage of resources though is proportional to the size of the module.
+
* Usage of Objects may vary between '''0.11%''' (Coupler Small) (~'''1/3''' of a Demon) to '''10.64%''' (Molten Vats) ('''36''' Demons, '''27''' World Texts, '''1064''' Light/Heavy objects).
* Usage of Objects may vary between 0.11%  (Coupler Small) (~1/3 of a Demon) to 10.64% (Molten Vats) (36 Demons, 27 World Texts, 1064 Light/Heavy objects).
+
* Usage of Memory may vary between '''0.28%''' (Coupler Small) ('''14''' objects) to '''7.92%''' (Foundry) (~'''400''' objects)
* Usage of Memory may vary between 0.28% (Coupler Small) (14 objects) to 7.92% (Foundry) (~400 objects)
+
* All modules when placed first have all their properties disabled except for the sound layer. Unlike Audio objects, which are Light objects, sound layers' Audio objects are Heavy, that is, they add '''0.15'''% Network per Audio. '''By just disabling sound layer in all modules and manually placing 3D Speakers and Roomtones you can save some Network''' (although you will need to activate them on map start, which will need a chain Map->On Map Started->Play->sounds = 3 Light Objects, so this workaround will need some extra Objects/Memory instead)
* All modules when placed first have all their properties disabled except for the sound layer. Unlike Audio objects, which are Light objects, sound layers' Audio objects are Heavy, that is, they add 0.15% Network per Audio. By just disabling sound layer in all modules and manually placing 3D Speaker and Roomtones you can save some Network for free.
+
* Most modules (with disabled sound layer) don't use Network, but some do (like Skylight Nine – '''0.59%''' Network), probably because they have embedded Heavy objects.
* Most modules (with disabled sound layer) don't use Network, but some do (like Skylight Nine – 0.59% Network), probably because they have embedded Heavy objects.
+
* Changing a Module's environment doesn't cost any resources.
* Changing Module's environment doesn't cost any resources.
+
* Adding Prop Layer and Floor/Ceiling/Wall clutter works like adding Props. These props, unlike Large/Small props, are Light objects, (they don't use Network). Use them instead of manually placed props when possible to save some Network. Props/Clutter use Objects/Memory in '''1:2''' proportion.
* Adding Prop Layer and Floor/Ceiling/Wall clutter works like adding Props. These props, unlike Large/Small props, are Light objects, (they don't use Network). Use them instead of manually placed props when possible to save some Network. Props/Clutter use Objects/Memory in 1:2 propotion.
+
* Decal layers use Objects/Memory in '''1:1''' proportion.  
* Decals use Objects/Memory in 1:1 proportion.  
+
 
* Different modules have different amounts of decals/props/clutter. The larger the module is, the more clutter/props/decals it will have.
 
* Different modules have different amounts of decals/props/clutter. The larger the module is, the more clutter/props/decals it will have.
  
Line 54: Line 60:
 
* Changing any properties of existing Objects.
 
* Changing any properties of existing Objects.
 
* Adding connections in logic chains without creating new input/output nodes.
 
* Adding connections in logic chains without creating new input/output nodes.
* Changing Environment property in Modules.
+
* Changing the Environment property in Modules.
  
 
=== Network optimization ===
 
=== Network optimization ===
Network is used by Heavy objects, Demons, some rare Modules, sound layer in Modules.
+
Network is used by Heavy objects, Demons, some rare Modules, and the sound layer in Modules.
All objects use 0.15% Network, except for Doors (0.30%) and Modules (up to 1.19% - The Vats).
+
 
 +
All objects use '''0.15%''' Network, except for Doors ('''0.30%''') and Modules (up to '''1.19%''' - The Vats).
 +
 
 
Strategies:
 
Strategies:
 +
* Setting the Static property on any Props or Player Blocking Volumes to get back their Network cost at the cost of disabling their inputs and outputs.
 
* Disabling sound layers in all modules and placing audio nodes manually.
 
* Disabling sound layers in all modules and placing audio nodes manually.
 
* Using only one reference to Variable object in a whole map.
 
* Using only one reference to Variable object in a whole map.
Line 66: Line 75:
 
=== Objects optimization ===
 
=== Objects optimization ===
 
Ordered by usage:
 
Ordered by usage:
Most Modules (0.11%-10.64%) > World Texts (0.40%) > Demons (0.30%) > Doors/Light objects/Heavy objects (0.01%)
+
 
Prop/clutter/decals layers in Modules may use from 0.01% up to 1% Objects and more.
+
Most Modules ('''0.11%-10.64%''') > World Texts ('''0.40%''') > Demons ('''0.30%''') > Doors/Light objects/Heavy objects ('''0.01%''')
 +
 
 +
Prop/clutter/decals layers in Modules may use from '''0.01%''' up to '''1%''' Objects and more.
 +
 
 
Strategies:
 
Strategies:
Replacing World Texts with other means of communication.
+
* Replacing World Texts with other means of [[communication]].
Replacing Demons with Single Demon Encounters.
+
* Replacing Demons with [[Single Encounter|Single Demon Encounters]], [[Group Encounter|Group Demon Encounters]] or [[Custom Encounter|Custom Group Encounters]].
Giving up Module's clutter/decals, especially in big Modules, especially decals (1,12% in Molten Vats).
+
* Giving up Module's clutter/decals, especially in big Modules, especially decals (1.12% in Molten Vats).
Using Modules with smaller Objects footprint.
+
  
 
=== Memory optimization ===
 
=== Memory optimization ===
 
Ordered by usage:
 
Ordered by usage:
Modules (0.28%-7.92%) > World Texts (0.04%) > Demons/Doors/Light objects/Heavy objects (0.02%)
+
 
 +
Modules ('''0.28%-7.92%''') > World Texts ('''0.04%''') > Demons/Doors/Light objects/Heavy objects ('''0.02%''')
 +
 
 
Strategies:
 
Strategies:
 
* Replacing World Texts with other means of communication.
 
* Replacing World Texts with other means of communication.
* Giving up Module's clutter/decals, especially in big Modules, especially decals (e.g. decals use 1,12% in Molten Vats ~ 112 objects).
+
* Giving up Module's clutter/decals, especially in big Modules.
  
 
=== General tips ===
 
=== General tips ===
* Use multicasting when possible (avoid creating extra input/output nodes).
+
* Use [[Multicasting|multicasting]] when possible (avoid creating extra input/output nodes).
* Hovering over different objects in Object Menu will immediately add their resource usage to the indicators, so you can figure out, how much resources an object of any particular type will use before adding them. This way you can easily distinguish Heavy objects from Light ones by looking at a Network field.
+
* Hovering over different objects in Object Menu will immediately add their resource usage to the indicators, so you can figure out, how much resources an object of any particular type will use before adding them. This way you can easily distinguish Heavy objects from Light ones by looking at the Network budget.
* The above trick does not work well with Modules – predicted resource usage for them will always be less than the real one that will be shown after actually adding the module to the map (by 1-2% for large modules).
+
* The above trick does not work well with Modules – predicted resource usage for them will always be less than the real one that will be shown after actually adding the module to the map (by '''1-2%''' for large modules).

Latest revision as of 2016-07-29T15:55:13

The campaign and multiplayer maps maintain rendering and network performance by following guidelines during development. Optimizing maps can take an experienced developer months of work. The maps in SnapMap use similar guidelines to maintain performance, ensuring that all players who can play singleplayer/multiplayer maps can also play any SnapMap.

These guidelines come in the form of three budgets: Network, Objects, and Memory. Everything in the editor will have an associated cost, and the editor will not let you place more items if there is no more remaining budget.

The Network budget applies to all dynamic objects in a map. Anything that can change during the course of a map (FX, Pickups, Interactives, Volumes, etc) will take up a portion of the Network budget. The Objects budget applies to anything that is rendered and appears as a 3D object in the map. The Memory budget applies to everything and is a general measure of how much memory each object uses during a match.


Empty map

An empty map with no modules uses 4.02% Network, 0.58% Objects, and 1.08% Memory.

Objects

All objects can be separated in 5 different classes by their use of map resources. All objects within the same class use exactly the same amount of resources regardless of their type and properties

Light objects

These use 0% Network, 0.01% Objects, and approximately 0.02% Memory. This class includes objects from the following categories:

This class of objects consume the least amount of resources per object. They use more Memory than Objects, so Memory is their limiting factor. A map may contain at most approximately 5000 Light objects.

Heavy objects

These objects use the same amount of Objects and Memory as the Light ones: 0.01% Objects and 0.02% Memory. The difference is that they also use 0.15% Network. This class includes objects from the following categories:

For these objects the limiting factor is Network. You can only have around 645 оf these in a map. These objects all use the same amount of resources each, whether it's a fancy FX, soda can, huge crate, volume of the size of the Foundry module, or just a boolean variable.

Demons

Aside from the 64 hand-placed demon limit, they also use 0.15% Network, 0.30% Objects and 0.02% Memory. Again, all demons are equal, whether it's a Baron of Hell or a Possessed Worker. One Demon is equal to one Heavy object in terms of Network and Memory and 30 Light/Heavy objects in terms of Objects.

World Text

These objects use 0% Network, 0.40% Objects and 0.04% (0.0385%) Memory. The limiting factor here is the Objects footprint. You can have at most around 250 World Texts in a map.

Doors

These are created when you attach a new module to an existing one. They cost 0.30% Network, 0.01% Objects and 0.02% Memory. (2 Heavy objects in terms of Network).

Modules

All modules use different amounts of Objects and Memory in varying proportions. Because of that, it is faster and easier to see their footprint in the editor. Here are some general observations:

  • Usage of Objects and Memory are not correlated. Let's take for example Foundry (9.03% O, 7.92% M) and Molten Vats (10.64% O, 4.94% M). Foundry uses ~3% more Memory, but Molten Vats uses ~1.5% more Objects. Total usage of resources though is proportional to the size of the module.
  • Usage of Objects may vary between 0.11% (Coupler Small) (~1/3 of a Demon) to 10.64% (Molten Vats) (36 Demons, 27 World Texts, 1064 Light/Heavy objects).
  • Usage of Memory may vary between 0.28% (Coupler Small) (14 objects) to 7.92% (Foundry) (~400 objects)
  • All modules when placed first have all their properties disabled except for the sound layer. Unlike Audio objects, which are Light objects, sound layers' Audio objects are Heavy, that is, they add 0.15% Network per Audio. By just disabling sound layer in all modules and manually placing 3D Speakers and Roomtones you can save some Network (although you will need to activate them on map start, which will need a chain Map->On Map Started->Play->sounds = 3 Light Objects, so this workaround will need some extra Objects/Memory instead)
  • Most modules (with disabled sound layer) don't use Network, but some do (like Skylight Nine – 0.59% Network), probably because they have embedded Heavy objects.
  • Changing a Module's environment doesn't cost any resources.
  • Adding Prop Layer and Floor/Ceiling/Wall clutter works like adding Props. These props, unlike Large/Small props, are Light objects, (they don't use Network). Use them instead of manually placed props when possible to save some Network. Props/Clutter use Objects/Memory in 1:2 proportion.
  • Decal layers use Objects/Memory in 1:1 proportion.
  • Different modules have different amounts of decals/props/clutter. The larger the module is, the more clutter/props/decals it will have.

Optimization

What does not affect resource usage?

  • Changing any properties of existing Objects.
  • Adding connections in logic chains without creating new input/output nodes.
  • Changing the Environment property in Modules.

Network optimization

Network is used by Heavy objects, Demons, some rare Modules, and the sound layer in Modules.

All objects use 0.15% Network, except for Doors (0.30%) and Modules (up to 1.19% - The Vats).

Strategies:

  • Setting the Static property on any Props or Player Blocking Volumes to get back their Network cost at the cost of disabling their inputs and outputs.
  • Disabling sound layers in all modules and placing audio nodes manually.
  • Using only one reference to Variable object in a whole map.
  • Using prop layers in modules instead of manually placed props, when possible.

Objects optimization

Ordered by usage:

Most Modules (0.11%-10.64%) > World Texts (0.40%) > Demons (0.30%) > Doors/Light objects/Heavy objects (0.01%)

Prop/clutter/decals layers in Modules may use from 0.01% up to 1% Objects and more.

Strategies:

Memory optimization

Ordered by usage:

Modules (0.28%-7.92%) > World Texts (0.04%) > Demons/Doors/Light objects/Heavy objects (0.02%)

Strategies:

  • Replacing World Texts with other means of communication.
  • Giving up Module's clutter/decals, especially in big Modules.

General tips

  • Use multicasting when possible (avoid creating extra input/output nodes).
  • Hovering over different objects in Object Menu will immediately add their resource usage to the indicators, so you can figure out, how much resources an object of any particular type will use before adding them. This way you can easily distinguish Heavy objects from Light ones by looking at the Network budget.
  • The above trick does not work well with Modules – predicted resource usage for them will always be less than the real one that will be shown after actually adding the module to the map (by 1-2% for large modules).