This article's documentation is for anything that uses the Source engine. Click here for more information.

Maxplayers: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Tisn't.)
mNo edit summary
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{This is a|engine=source|cvar|name=maxplayers}}
{{this is a|console variable|engine=Source|name=maxplayers}}
'''{{mono|maxplayers}}''' is a server [[console variable]] that determines the maximum number of [[player]]s that can join a game. It cannot be changed while a server is running.
'''{{mono|maxplayers}}''' is a server [[console variable]] that determines the maximum number of [[player]]s that can join a game. It cannot be changed while a server is running.


The absolute player limit of Source is 255, though the number supported by most games is far lower. Usually the limit is 32.
The absolute player limit of Source is 255, though the number supported by most games is far lower. Usually the limit is 32. In some games it is usually 1 over the expected limit to account for the fake [[SourceTV]] client.


{{Warning|In {{csgo}} [[Counter-Strike: Global Offensive]], {{mono|maxplayers}} is deprecated. Set it in {{mono|gamemodes_server.txt.example}} or use the [[Command Line Options|launch option]] {{mono|-maxplayers_override <number>}} instead.
{{confirm|Doesn't seem like there is any non sourcemod way to change this in {{L4ds|4}}}}
}}
{{Warning|In {{csgo}} [[Counter-Strike: Global Offensive]], {{mono|maxplayers}} is deprecated. Set it in {{mono|gamemodes_server.txt.example}} or use the [[Command Line Options|launch option]] {{mono|-maxplayers_override <number>}} instead.}}
 
{{Warning|In {{cs2}} [[Counter-Strike 2]], {{mono|maxplayers_override }} is deprecated. Use the [[Command Line Options|launch option]] {{mono|-maxplayers <number>}} instead.}}
{{Warning|In {{cs2}} [[Counter-Strike 2]], {{mono|maxplayers_override }} is deprecated. Use the [[Command Line Options|launch option]] {{mono|-maxplayers <number>}} instead.
}}


== Usage ==
== Usage ==
The engine can be put into single-player mode by setting {{mono|maxplayers}} to 1 before a game starts. This bridges the normal client-server divide in several areas, eliminating [[latency]] and [[interpolation]] and opening backdoors like the one used by the [[inverse kinematics]] system. In {{src13|2}}, enabling singleplayer mode additionally disables DRM, allowing the maps to be loaded without Steam running.


The engine can be put into single-player mode by setting {{mono|maxplayers}} to 1 before a game starts. This bridges the normal client-server divide in several areas, eliminating [[latency]] and [[interpolation]] and opening backdoors like the one used by the [[inverse kinematics]] system.
The [[entity index|entity indices]] 1 to ''<maxplayers>'' are reserved for [[CBasePlayer|player entities]] (0 is [[worldspawn]]).


The [[entity index|entity indices]] 1 to ''<maxplayers>'' are reserved for [[CBasePlayer|player entities]] (0 is [[worldspawn]]).
== Limits ==
* {{gmod|2}} - 128
* {{tf2|2}}, {{hl2dm|2}} - 101 (33 on 32-bit if not using <code>-unrestricted_maxplayers</code> launch option)
* {{css|2}} - 65
* {{csgo|2}} - 64
* {{dods|2}} - 33
{{todo|Other games}}
:{{Warning|In {{tf2branch|4}} games, the minimum value is 2, disallowing singleplayer mode. This can be changed for SDK projects by modifying the game DLL{{how}}, but this version of the engine currently has major bugs in singleplayer mode.}}


[[Category:Glossary]]
[[Category:Glossary]]

Latest revision as of 11:24, 29 April 2025

maxplayers is a console variable available in all Source Source games. maxplayers is a server console variable that determines the maximum number of players that can join a game. It cannot be changed while a server is running.

The absolute player limit of Source is 255, though the number supported by most games is far lower. Usually the limit is 32. In some games it is usually 1 over the expected limit to account for the fake SourceTV client.

Confirm:Doesn't seem like there is any non sourcemod way to change this in Left 4 Dead seriesLeft 4 Dead series Left 4 Dead series
Warning.pngWarning:In Counter-Strike: Global Offensive Counter-Strike: Global Offensive, maxplayers is deprecated. Set it in gamemodes_server.txt.example or use the launch option -maxplayers_override <number> instead.
Warning.pngWarning:In Counter-Strike 2 Counter-Strike 2, maxplayers_override is deprecated. Use the launch option -maxplayers <number> instead.

Usage

The engine can be put into single-player mode by setting maxplayers to 1 before a game starts. This bridges the normal client-server divide in several areas, eliminating latency and interpolation and opening backdoors like the one used by the inverse kinematics system. In Source 2013 Source 2013, enabling singleplayer mode additionally disables DRM, allowing the maps to be loaded without Steam running.

The entity indices 1 to <maxplayers> are reserved for player entities (0 is worldspawn).

Limits

Todo: Other games
Warning.pngWarning:In Team Fortress 2 branch Team Fortress 2 branch games, the minimum value is 2, disallowing singleplayer mode. This can be changed for SDK projects by modifying the game DLL[How?], but this version of the engine currently has major bugs in singleplayer mode.