Zh/S PreserveEnts: Difference between revisions
< Zh
Jump to navigation
Jump to search
mNo edit summary |
m (Multipage removal) |
||
(10 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{ | {{LanguageBar|title = s_PreserveEnts}} | ||
{{stub}} | |||
在起源的多人游戏中,当进行回合重置时,所有实体会被删除并重新生成以重置其实体属性。除非它们的{{L|Classname|实体类名}}与白名单s_PreserveEnts中的条目匹配。 列入白名单的实体要么具有处理重置过程的特殊代码,要么不适合删除。 | |||
{{todo | 然而,一些白名单实体并没有用他们的新行为正确地考虑轮次重置,所以当进行回合重置时,它们的实体属性会从上一回合继承下来,比如它们的{{L|origin|坐标}}。 | ||
{{todo|尝试完成此列表。某些游戏可能没有任何方法可以重置回合(即使通过<code>mp_forcewin</code>或<code>mp_restartgame</code>命令)。}} | |||
{| class=wikitable | {| class=wikitable | ||
|- | |- | ||
Line 34: | Line 35: | ||
|colspan = 2 |{{style|color:orange|是(通过逆向工程)}} | |colspan = 2 |{{style|color:orange|是(通过逆向工程)}} | ||
||{{style|color:green|是}} | ||{{style|color:green|是}} | ||
||{{style|color: | ||{{style|color:green|是}} | ||
||{{style|color:green|是}} | ||{{style|color:green|是}} | ||
|} | |} | ||
==源代码== | ==源代码== | ||
==={{ | ==={{hl2dm|4}}=== | ||
{{ | {{Expand|title=<code>hl2mp/hl2mp_gamerules.cpp</code>| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
static const char *s_PreserveEnts[] = | static const char *s_PreserveEnts[] = | ||
Line 87: | Line 88: | ||
}} | }} | ||
==={{portal}} | ==={{portal|4}}=== | ||
{{ | {{Expand|title=<code>portal/portal_mp_gamerules.cpp</code>| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
static const char *s_PreserveEnts[] = | static const char *s_PreserveEnts[] = | ||
Line 135: | Line 136: | ||
}} | }} | ||
==={{ | ==={{portal2|4}}=== | ||
{| | {{Expand|title=<code>portal/portal_mp_gamerules.cpp</code>| | ||
<syntaxhighlight lang="cpp"> | |||
| {{ | static const char *s_PreserveEnts[] = | ||
{ | |||
"ai_network", | |||
"ai_hint", | |||
"hl2mp_gamerules", | |||
"team_manager", | |||
"player_manager", | |||
"env_soundscape", | |||
"env_soundscape_proxy", | |||
"env_soundscape_triggerable", | |||
"env_sun", | |||
"env_wind", | |||
"env_fog_controller", | |||
"func_brush", | |||
"func_wall", | |||
"func_buyzone", | |||
"func_illusionary", | |||
"infodecal", | |||
"info_projecteddecal", | |||
"info_node", | |||
"info_target", | |||
"info_node_hint", | |||
"info_player_deathmatch", | |||
"info_player_combine", | |||
"info_player_rebel", | |||
"info_map_parameters", | |||
"keyframe_rope", | |||
"move_rope", | |||
"info_ladder", | |||
"player", | |||
"point_viewcontrol", | |||
"scene_manager", | |||
"shadow_control", | |||
"sky_camera", | |||
"soundent", | |||
"trigger_soundscape", | |||
"viewmodel", | |||
"predicted_viewmodel", | |||
"worldspawn", | |||
"point_devshot_camera", | |||
"", // END Marker | |||
}; | |||
</syntaxhighlight> | |||
}} | |||
==={{tf2|4}}=== | |||
{{Expand|title=<code>teamplayroundbased_gamerules.cpp</code>| | |||
<syntaxhighlight lang="cpp"> | |||
// Classnames of entities that are preserved across round restarts | // Classnames of entities that are preserved across round restarts | ||
static const char *s_PreserveEnts[] = | static const char *s_PreserveEnts[] = | ||
Line 174: | Line 222: | ||
"info_populator", | "info_populator", | ||
"", // END Marker | "", // END Marker | ||
};</syntaxhighlight> | };</syntaxhighlight>}} | ||
{{expand|title=<code>tf/tf_gamerules.cpp</code>| | |||
<syntaxhighlight lang="cpp"> | |||
// Classnames of entities that are preserved across round restarts | // Classnames of entities that are preserved across round restarts | ||
static const char *s_PreserveEnts[] = | static const char *s_PreserveEnts[] = | ||
Line 189: | Line 239: | ||
"tf_logic_training", | "tf_logic_training", | ||
"tf_logic_training_mode", | "tf_logic_training_mode", | ||
"tf_powerup_bottle", | "tf_powerup_bottle", | ||
"tf_mann_vs_machine_stats", | "tf_mann_vs_machine_stats", | ||
Line 212: | Line 259: | ||
"tf_halloween_gift_pickup", | "tf_halloween_gift_pickup", | ||
"tf_logic_competitive", | "tf_logic_competitive", | ||
"tf_wearable_razorback", | |||
"entity_soldier_statue", | |||
"", // END Marker | "", // END Marker | ||
};</syntaxhighlight> | };</syntaxhighlight>}} | ||
==={{css}} | ==={{css|4}}=== | ||
{{ | {{expand|title=<code>cstrike/cs_gamerules.cpp</code>| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
static const char *s_PreserveEnts[] = | static const char *s_PreserveEnts[] = | ||
Line 265: | Line 313: | ||
}} | }} | ||
==={{csgo}} | ==={{csgo|4}}=== | ||
{{ | {{expand|title=<code>cstrike15/cs_gamerules.cpp</code>| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
static const char *s_PreserveEnts[] = | static const char *s_PreserveEnts[] = | ||
Line 332: | Line 380: | ||
}} | }} | ||
==={{dods}} | ==={{dods|4}}=== | ||
{{ | {{expand|title=<code>dod/dod_gamerules.cpp</code>| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
static const char *s_PreserveEnts[] = | static const char *s_PreserveEnts[] = | ||
Line 379: | Line 427: | ||
}} | }} | ||
==={{as}} | ==={{as|4}}=== | ||
{{ | {{expand|title=<code>swarm/asw_gamerules.cpp</code>| | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
CAlienSwarm::CAlienSwarm() | CAlienSwarm::CAlienSwarm() |
Latest revision as of 10:33, 12 July 2024
在起源的多人游戏中,当进行回合重置时,所有实体会被删除并重新生成以重置其实体属性。除非它们的实体类名 与白名单s_PreserveEnts中的条目匹配。 列入白名单的实体要么具有处理重置过程的特殊代码,要么不适合删除。
然而,一些白名单实体并没有用他们的新行为正确地考虑轮次重置,所以当进行回合重置时,它们的实体属性会从上一回合继承下来,比如它们的坐标 。
待完善: 尝试完成此列表。某些游戏可能没有任何方法可以重置回合(即使通过
mp_forcewin
或mp_restartgame
命令)。游戏 | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
是否拥有白名单 | 是 | 是 | 是 | 是 | 否 | 是 | 否 | 否 | 是(通过逆向工程) | 是 | 是 | 是 |
源代码
半衰期2:死亡竞赛
static const char *s_PreserveEnts[] =
{
"ai_network",
"ai_hint",
"hl2mp_gamerules",
"team_manager",
"player_manager",
"env_soundscape",
"env_soundscape_proxy",
"env_soundscape_triggerable",
"env_sun",
"env_wind",
"env_fog_controller",
"func_brush",
"func_wall",
"func_buyzone",
"func_illusionary",
"infodecal",
"info_projecteddecal",
"info_node",
"info_target",
"info_node_hint",
"info_player_deathmatch",
"info_player_combine",
"info_player_rebel",
"info_map_parameters",
"keyframe_rope",
"move_rope",
"info_ladder",
"player",
"point_viewcontrol",
"scene_manager",
"shadow_control",
"sky_camera",
"soundent",
"trigger_soundscape",
"viewmodel",
"predicted_viewmodel",
"worldspawn",
"point_devshot_camera",
"", // END Marker
};
|
传送门
static const char *s_PreserveEnts[] =
{
"ai_network",
"ai_hint",
"hl2mp_gamerules",
"team_manager",
"player_manager",
"env_soundscape",
"env_soundscape_proxy",
"env_soundscape_triggerable",
"env_sun",
"env_wind",
"env_fog_controller",
"func_brush",
"func_wall",
"func_buyzone",
"func_illusionary",
"infodecal",
"info_projecteddecal",
"info_node",
"info_target",
"info_node_hint",
"info_player_deathmatch",
"info_player_combine",
"info_player_rebel",
"info_map_parameters",
"keyframe_rope",
"move_rope",
"info_ladder",
"player",
"point_viewcontrol",
"scene_manager",
"shadow_control",
"sky_camera",
"soundent",
"trigger_soundscape",
"viewmodel",
"predicted_viewmodel",
"worldspawn",
"point_devshot_camera",
"", // END Marker
};
|
传送门2
static const char *s_PreserveEnts[] =
{
"ai_network",
"ai_hint",
"hl2mp_gamerules",
"team_manager",
"player_manager",
"env_soundscape",
"env_soundscape_proxy",
"env_soundscape_triggerable",
"env_sun",
"env_wind",
"env_fog_controller",
"func_brush",
"func_wall",
"func_buyzone",
"func_illusionary",
"infodecal",
"info_projecteddecal",
"info_node",
"info_target",
"info_node_hint",
"info_player_deathmatch",
"info_player_combine",
"info_player_rebel",
"info_map_parameters",
"keyframe_rope",
"move_rope",
"info_ladder",
"player",
"point_viewcontrol",
"scene_manager",
"shadow_control",
"sky_camera",
"soundent",
"trigger_soundscape",
"viewmodel",
"predicted_viewmodel",
"worldspawn",
"point_devshot_camera",
"", // END Marker
};
|
军团要塞2
// Classnames of entities that are preserved across round restarts
static const char *s_PreserveEnts[] =
{
"player",
"viewmodel",
"worldspawn",
"soundent",
"ai_network",
"ai_hint",
"env_soundscape",
"env_soundscape_proxy",
"env_soundscape_triggerable",
"env_sprite",
"env_sun",
"env_wind",
"env_fog_controller",
"func_wall",
"func_illusionary",
"info_node",
"info_target",
"info_node_hint",
"point_commentary_node",
"point_viewcontrol",
"func_precipitation",
"func_team_wall",
"shadow_control",
"sky_camera",
"scene_manager",
"trigger_soundscape",
"commentary_auto",
"point_commentary_node",
"point_commentary_viewpoint",
"bot_roster",
"info_populator",
"", // END Marker
};
|
// Classnames of entities that are preserved across round restarts
static const char *s_PreserveEnts[] =
{
"tf_gamerules",
"tf_team_manager",
"tf_player_manager",
"tf_team",
"tf_objective_resource",
"keyframe_rope",
"move_rope",
"tf_viewmodel",
"tf_logic_training",
"tf_logic_training_mode",
"tf_powerup_bottle",
"tf_mann_vs_machine_stats",
"tf_wearable",
"tf_wearable_demoshield",
"tf_wearable_robot_arm",
"tf_wearable_vm",
"tf_logic_bonusround",
"vote_controller",
"monster_resource",
"tf_logic_medieval",
"tf_logic_cp_timer",
"tf_logic_tower_defense", // legacy
"tf_logic_mann_vs_machine",
"func_upgradestation",
"entity_rocket",
"entity_carrier",
"entity_sign",
"entity_saucer",
"tf_halloween_gift_pickup",
"tf_logic_competitive",
"tf_wearable_razorback",
"entity_soldier_statue",
"", // END Marker
};
|
反恐精英:起源
static const char *s_PreserveEnts[] =
{
"ai_network",
"ai_hint",
"cs_gamerules",
"cs_team_manager",
"cs_player_manager",
"env_soundscape",
"env_soundscape_proxy",
"env_soundscape_triggerable",
"env_sun",
"env_wind",
"env_fog_controller",
"func_brush",
"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",
"keyframe_rope",
"move_rope",
"info_ladder",
"player",
"point_viewcontrol",
"scene_manager",
"shadow_control",
"sky_camera",
"soundent",
"trigger_soundscape",
"viewmodel",
"predicted_viewmodel",
"worldspawn",
"point_devshot_camera",
"", // END Marker
};
|
反恐精英:全球攻势
static const char *s_PreserveEnts[] =
{
"ai_network",
"ai_hint",
"cs_gamerules",
"cs_team_manager",
"cs_player_manager",
"env_soundscape",
"env_soundscape_proxy",
"env_soundscape_triggerable",
"env_sun",
"env_wind",
"env_fog_controller",
"env_tonemap_controller",
"env_cascade_light",
"func_brush",
"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_enemy_terrorist_spawn",
"info_deathmatch_spawn",
"info_armsrace_counterterrorist",
"info_armsrace_terrorist",
"info_map_parameters",
"keyframe_rope",
"move_rope",
"info_ladder",
"player",
"point_viewcontrol",
"point_viewcontrol_multiplayer",
"scene_manager",
"shadow_control",
"sky_camera",
"soundent",
"trigger_soundscape",
"viewmodel",
"predicted_viewmodel",
"worldspawn",
"point_devshot_camera",
"logic_choreographed_scene",
"cfe_player_decal",
"info_bomb_target_hint_A",
"info_bomb_target_hint_B",
"info_hostage_rescue_zone_hint",
"generic_actor",
"vote_controller",
"wearable_item",
"point_hiding_spot",
"game_coopmission_manager",
"chicken",
"", // END Marker
};
|
胜利之日:起源
static const char *s_PreserveEnts[] =
{
"player",
"viewmodel",
"worldspawn",
"soundent",
"ai_network",
"ai_hint",
"dod_gamerules",
"dod_team_manager",
"dod_player_manager",
"dod_objective_resource",
"env_soundscape",
"env_soundscape_proxy",
"env_soundscape_triggerable",
"env_sprite",
"env_sun",
"env_wind",
"env_fog_controller",
"func_brush",
"func_wall",
"func_illusionary",
"info_node",
"info_target",
"info_node_hint",
"info_player_allies",
"info_player_axis",
"point_viewcontrol",
"shadow_control",
"sky_camera",
"scene_manager",
"trigger_soundscape",
"info_dod_detect",
"dod_team_allies",
"dod_team_axis",
"point_commentary_node",
"dod_round_timer",
"func_precipitation",
"func_team_wall",
"", // END Marker
};
|
异形丛生
CAlienSwarm::CAlienSwarm()
{
// set which entities should stay around when we restart the mission
m_MapResetFilter.AddKeepEntity("worldspawn");
m_MapResetFilter.AddKeepEntity("soundent");
m_MapResetFilter.AddKeepEntity("asw_gamerules");
m_MapResetFilter.AddKeepEntity("player");
m_MapResetFilter.AddKeepEntity("asw_player");
m_MapResetFilter.AddKeepEntity("player_manager");
m_MapResetFilter.AddKeepEntity("predicted_viewmodel");
m_MapResetFilter.AddKeepEntity("sdk_team_manager");
m_MapResetFilter.AddKeepEntity("scene_manager");
m_MapResetFilter.AddKeepEntity("event_queue_saveload_proxy");
m_MapResetFilter.AddKeepEntity("ai_network");
}
|
逆向工程
求生之路
2021年7月22日 - 步骤:[使用软件:IDA]
1. 搜索ai_network
字符串引用。
2. 调出参考的 XREF。
3. 找到同时包含survivor_bot
和logic_versus_random
的列表
; "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",
求生之路2
2021年7月22日 - 步骤:[使用软件:IDA]
1. 搜索ai_network
字符串引用。
2. 调出参考的 XREF。
3. 找到同时包含survivor_bot
和logic_versus_random
的列表
; "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",
; "infodecal",
; "info_projecteddecal",
; "info_node",
; "info_node_hint",
; "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",
; "weapon_scavenge_item_spawn",
; "logic_versus_random",