Difference between revisions of "S PreserveEnts"

From Valve Developer Community
Jump to: navigation, search
(l4d2 s_PreserveEnts; added "Code Dumps" section)
(Revised table summary; Introduction; Discarded a template, made things too hard to maintain; L4D1; L4D2. See the diff for full info.)
Line 1: Line 1:
 
{{stub}}
 
{{stub}}
 
{{DISPLAYTITLE:s_PreserveEnts}}
 
{{DISPLAYTITLE:s_PreserveEnts}}
In multiplayer Source games, during a round reset, all entities are resetted by being deleted then quickly respawned, unless they are under a whitelist. Usually these entities have special code to handle the resetting process, or isn't ideal to be. The{{ent|player}}entity for example, should not ever be erased unless the client disconnects from the server.
+
In multiplayer Source games, during a round reset, all entities are resetted to their defaults by being deleted then respawned, unless their classnames are in a whitelist. Whitelisted entities either has special code to handle the resetting process, and isn't ideal to be deleted.
  
Some entities in this list however, do not have any code for handling round resets, so when the reset occurs, those entities will behave in unwanted ways as they have carried over all their properties (including position) from the last round.
+
Some whitelist entities however don't account round resets properly with their new behavior, so when a round reset occurs, their properties are carried over from the last round, like their [[origin]]s.
  
{{todo|Attempt to finish this table. Some games might not have any way to reset the round (even through mp_forcewin or mp_restartgame).}}
+
{{todo|Attempt to finish this table. Some games might not have any way to reset the round (even through<code>mp_forcewin</code>or<code>mp_restartgame</code>commands).}}
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-
! !{{pergame}}
+
! Games
 +
!{{as}}
 +
!{{csgo}}
 +
!{{css}}
 +
!{{dods}}
 +
!{{hl2}}
 +
!{{hl2dm}}
 +
!{{ep1}}
 +
!{{ep2}}
 +
!{{l4d}}
 +
!{{l4d2}}
 +
!{{portal}}
 +
!{{portal2}}
 +
!{{tf2}}
 
|-
 
|-
|Affects:
+
|'''Has Whitelist'''
 
||{{style|color:green|Yes}}
 
||{{style|color:green|Yes}}
 
||{{style|color:green|Yes}}
 
||{{style|color:green|Yes}}
 
||{{style|color:green|Yes}}
 
||{{style|color:green|Yes}}
 
||{{style|color:green|Yes}}
 
||{{style|color:green|Yes}}
||N/A
+
||{{style|color:yellowgreen|No}}
 
||{{style|color:green|Yes}}
 
||{{style|color:green|Yes}}
||N/A
+
||{{style|color:yellowgreen|No}}
||N/A
+
||{{style|color:yellowgreen|No}}
||{{style|color:yellow|Unsure}}
+
||{{style|color:orange|From code dump}}
 
||{{style|color:orange|From code dump}}
 
||{{style|color:orange|From code dump}}
 
||{{style|color:green|Yes}}
 
||{{style|color:green|Yes}}
Line 380: Line 393:
  
 
== Code Dumps ==
 
== Code Dumps ==
 +
=== {{l4d}} Left 4 Dead ===
 +
22/07/2021 - Address<code>105AFCE0</code>is to be jumped to. The list at address<code>105A92A0</code>is a {{css}} leftover.
 +
{{ExpandBox|
 +
<syntaxhighlight lang="cpp">
 +
; "ai_network",
 +
; "ai_hint",
 +
; "cs_team_manager",
 +
; "terror_gamerules",
 +
; "terror_player_manager",
 +
; "survivor_bot",
 +
; "env_tonemap_controller",
 +
; "env_tonemap_controller_infected",
 +
; "env_tonemap_controller_ghost",
 +
; "vote_controller",
 +
; "env_soundscape",
 +
; "env_soundscape_proxy",
 +
; "env_soundscape_triggerable",
 +
; "env_sun",
 +
; "env_wind",
 +
; "env_fog_controller",
 +
; "func_wall",
 +
; "func_buyzone",
 +
; "func_illusionary",
 +
; "func_hostage_rescue",
 +
; "func_bomb_target",
 +
; "infodecal",
 +
; "info_projecteddecal",
 +
; "info_node",
 +
; "info_target",
 +
; "info_node_hint",
 +
; "info_player_counterterrorist",
 +
; "info_player_terrorist",
 +
; "info_map_parameters",
 +
; "info_map_parameters_versus",
 +
; "info_ladder",
 +
; "func_simpleladder",
 +
; "player",
 +
; "point_viewcontrol",
 +
; "scene_manager",
 +
; "shadow_control",
 +
; "sky_camera",
 +
; "soundent",
 +
; "trigger_soundscape",
 +
; "viewmodel",
 +
; "predicted_viewmodel",
 +
; "worldspawn",
 +
; "point_devshot_camera",
 +
; "info_survivor_position",
 +
; "logic_versus_random",
 +
</syntaxhighlight>
 +
}}
 +
 
=== {{l4d2}} Left 4 Dead 2 ===
 
=== {{l4d2}} Left 4 Dead 2 ===
 
21/07/2021 - Address<code>107A8D64</code>is to be jumped to.
 
21/07/2021 - Address<code>107A8D64</code>is to be jumped to.
 
{{ExpandBox|
 
{{ExpandBox|
<pre>
+
<syntaxhighlight lang="cpp">
* ai_network,
+
; "ai_network",
* ai_hint,
+
; "ai_hint",
* cs_team_manager,
+
; "cs_team_manager",
* terror_gamerules,
+
; "terror_gamerules",
* terror_player_manager,
+
; "terror_player_manager",
* survivor_bot,
+
; "survivor_bot",
* env_tonemap_controller,
+
; "env_tonemap_controller",
* env_tonemap_controller_infected,
+
; "env_tonemap_controller_infected",
* env_tonemap_controller_ghost,
+
; "env_tonemap_controller_ghost",
* vote_controller,
+
; "vote_controller",
* env_soundscape,
+
; "env_soundscape",
* env_soundscape_proxy,
+
; "env_soundscape_proxy",
* env_soundscape_triggerable,
+
; "env_soundscape_triggerable",
* env_sun,
+
; "env_sun",
* env_wind,
+
; "env_wind",
* env_fog_controller,
+
; "env_fog_controller",
* func_wall,
+
; "func_wall",
* infodecal,
+
; "infodecal",
* info_projecteddecal,
+
; "info_projecteddecal",
* info_node,
+
; "info_node",
* info_node_hint,
+
; "info_node_hint",
* info_map_parameters,
+
; "info_map_parameters",
* info_map_parameters_versus,
+
; "info_map_parameters_versus",
* info_ladder,
+
; "info_ladder",
* func_simpleladder,
+
; "func_simpleladder",
* player,
+
; "player",
* point_viewcontrol,
+
; "point_viewcontrol",
* scene_manager,
+
; "scene_manager",
* shadow_control,
+
; "shadow_control",
* sky_camera,
+
; "sky_camera",
* soundent,
+
; "soundent",
* trigger_soundscape,
+
; "trigger_soundscape",
* viewmodel,
+
; "viewmodel",
* predicted_viewmodel,
+
; "predicted_viewmodel",
* worldspawn,
+
; "worldspawn",
* point_devshot_camera,
+
; "point_devshot_camera",
* weapon_scavenge_item_spawn,
+
; "weapon_scavenge_item_spawn",
* logic_versus_random,
+
; "logic_versus_random",
</pre>
+
</syntaxhighlight>
 
}}
 
}}

Revision as of 13:56, 21 July 2021

In multiplayer Source games, during a round reset, all entities are resetted to their defaults by being deleted then respawned, unless their classnames are in a whitelist. Whitelisted entities either has special code to handle the resetting process, and isn't ideal to be deleted.

Some whitelist entities however don't account round resets properly with their new behavior, so when a round reset occurs, their properties are carried over from the last round, like their origins.

To do: Attempt to finish this table. Some games might not have any way to reset the round (even throughmp_forcewinormp_restartgamecommands).

Games Alien Swarm Counter-Strike: Global Offensive Counter-Strike: Source Day of Defeat: Source Half-Life 2 Half-Life 2: DeathmatchHalf-Life 2: Deathmatch Half-Life 2: Episode OneHalf-Life 2: Episode One Half-Life 2: Episode TwoHalf-Life 2: Episode Two Left 4 Dead Left 4 Dead 2 Portal Portal 2 Team Fortress 2
Has Whitelist Yes Yes Yes Yes No Yes No No From code dump From code dump Yes Unsure Yes

Source Code

Half-Life 2hl2mp/hl2mp_gamerules.cpp



Portalportal/portal_mp_gamerules.cpp



Team Fortress 2tf/tf_gamerules.cpp



Counter-Strike: Sourcecstrike/cs_gamerules.cpp



Counter-Strike: Global Offensivecstrike15/cs_gamerules.cpp



Day of Defeat: Sourcedod/dod_gamerules.cpp



Alien Swarmswarm/asw_gamerules.cpp



Code Dumps

Left 4 Dead Left 4 Dead

22/07/2021 - Address105AFCE0is to be jumped to. The list at address105A92A0is a Counter-Strike: Source leftover.



Left 4 Dead 2 Left 4 Dead 2

21/07/2021 - Address107A8D64is to be jumped to.