28

What is a tick?

I have heard many instances of tick being used. For example, people will say that demos are recorded in 16 tick, that servers run in 64 tick, but really good servers will run in 128 ticks.

I don't exactly understand what's a tick exactly. Why would having higher powers of 2 any better? I have seen a lot of threads about asking Valve to add higher tick servers, but what does a higher "tick" get you?

3
  • 27
    A blood-sucking insect. When encountered in large numbers, you have poly-ticks, which explains a lot. Mar 18, 2015 at 14:49
  • 3
    @MasonWheeler I see what you did there
    – Jhon
    Mar 18, 2015 at 15:42
  • 1
    The sound a analog clock makes when counting seconds.
    – Neffer_23
    Jun 16, 2015 at 22:25

5 Answers 5

42

What is a tick?

To understand the meaning of a tick first you need to have a high level understanding of a game loop. In a standard game loop you have three main functions:

  1. Process user input
  2. Update the game state
  3. Render to screen

These will loop over and over throughout the game. There are controls on the loop so that 2 different pieces of hardware (e.g. PCs) don't run the loop at different rates. This is also important in server-client setups like Counter-Strike so that all clients are running in sync. A tickrate is used to control how often the game state is updated. A tickrate of 60 would update the game state 60 times every second. You will often see this number represented as ticks, tickrate, ticks per second and tps.

Note that the rendering to screen is often controlled differently (common to see 60 frames per second, or 60fps). Complex loops try to decouple the tickrate and frame rate, so that longer processing time doesn't cause jumps in the graphics. Although linked, it is important to understand that the game updates (controlled by ticks per second) is different from screen updates (controlled by frames per second).

Some online games such as Titanfall have much lower tickrates (20). This means that every second the game world has been updated 20 times and rendered to screen 60 times (assuming 60 fps).

I have seen a lot of threads about asking Valve to add higher tick servers, but what does a higher "tick" get you?

A high tick rate will make the game appear more responsive because your actions (moving, firing etc) are being reflected in the game state more regular. However, it is more demanding on your machine/server and potential client network.

For a higher tickrate, lower end machines may struggle. Also, depending on netcode (which may be optimised for 60 rather than 100+) you could see other bugs with sync, floating point issues etc.

So in short, a higher tick rate will see the benefits if the clients can keep up (with CPU and bandwidth). Failing that, they will experience more lag/issues than on a 60 tick server. Also, the cost will be higher for servers to run higher tick rates (plus the bandwidth costs, as you are updating the clients more often).

Other games with dedicated servers will have much lower tick-rates than 60, both to increase the audience (more people able to run without issues) and to reduce cost. The game doesn't feel as responsive as a higher tick rate game/server, which is very minor considering we are talking about update rates of 20 or 60 times every second. How many times can you click the mouse in any one second, anyway?

Further reading:

  • Netcode - gives some references to tickrates
  • Game Loop - good to understand how tickrates and frame rates are handled generally by any game
  • 10 Tick Rate on Battlefield - outcry from games running on lower tickrates
2
  • 6
    Notoriously, EVE Online is a real-time game that runs in 1 tick per second, and in server-straining situations slows down to 1/10 tick (happens when several thousand players fight each other in a single location). However it's not too much of a problem there, since quick reactions give precedence to superior tactics and preparation in hour long combat. In TBS games a "tick" can be in minutes, so not all games benefit from high tick rates.
    – Ordous
    Mar 18, 2015 at 15:32
  • @Ordous I suspect that even TBS games have a tick rate, even though player actions aren't tied directly to it: it would be needed for rendering pretty animations, if nothing else.
    – jpaugh
    Nov 17, 2017 at 2:42
7

Simply put, a 'tick' deals with the smallest amount of time the game engine deals with – it is how many discrete steps the game can move in one second. With a higher tick rate, game physics can appear smoother or more realistic, but this comes at a heavy cost of processing power.

In another sense, it's a count of how many 'samples' you take from a (theoretical) real-life scenario. The more samples you take, the less jumpy the data are.

4

The server's tickrate is the number of game frames that the server processes in a single second. This is sometimes also referred to as the server FPS, which is confusing as the server still has the max_fps command.

Every game frame, the game calls into an entity's GameFrame method (if it has one) for any game logic processing. For projectiles, players, doors, etc... this includes physics processing. The game also does internal logic at this time... and any Valve Server Plugins (VSPs) such as MetaMod:Source and SourceMod can also hook have their own GameFrame calls (for SourceMod, this is used for SourceMod timers and any plugins that have OnGameFrame hooks).

As you may have guessed, the higher you set the tickrate, the more CPU power the game will use.

It doesn't always have to be a power of 2. In fact, some CS:GO server owners swear by 102 / 102.4 tick instead of the default 64 and 128 tickrates. They claim it makes the server's performance more consistent and reduces CPU spikes.

However, this may have changed as Valve has updated the game.

Keep in mind that setting the tickrate higher alone won't improve players experience. You also need to make sure your rates are set properly for the amount of bandwidth you have available.

As for Valve's other games, a lot of them use locked tickrates:

  • 30 game frames per second
    • Left 4 Dead
    • Left 4 Dead 2
  • 66 game frames per second
    • Day of Defeat: Source
    • Counter-Strike: Source
    • Team Fortress 2

The 66 game frames per second games were not always locked to 66. Valve changed this some time back after making changes to the game code. These changes made some games (TF2 in particular) much more sensitive to tickrate changes... setting it too high or too low changed the speed at which doors would open/close and caused issues.

4
  • 1
    On a side note, the server's tickrate and client's tickrate may not be the same. The client can restrict how often it receives frames from the server (cl_updaterate). Having said that, the server can set minimum and maximum values for these settings (sv_minupdaterate and sv_maxupdaterate). Regardless of what you set these min and maxs to, the server will process -tickrate game frames per second to the closest number of milliseconds (i.e. 66fps is 1000/66 or 15ms).
    – Powerlord
    Mar 17, 2015 at 20:32
  • So how does a high tickrate convert back into lower tick rates, in the instance of a demo being made on a valve server (as all demos are made in 16 tick apparently).
    – childe
    Mar 17, 2015 at 20:59
  • @0-framelinks A client side .dem file contains all the packets that a client received and would thus record at whatever cl_updaterate a client was using (assuming their rate was high enough to sustain it). A server-side .dem created with SourceTV / GoTV on the server side (using tv_record) contains much more information as its recording everything that happens in every game frame everywhere on the map and doesn't have a fixed perspective.
    – Powerlord
    Mar 18, 2015 at 0:34
  • 1
    Note that tickrate and framerate are often decoupled. Many games have FPS much higher than TPS, and DwarfFortress has a much higher TPS than FPS. Mar 18, 2015 at 16:50
0

From a Counter-Strike Forum:

During each tick, the server processes incoming user commands, runs a physical simulation step, checks the game rules, and updates all object states. After simulating a tick, the server decides if any client needs a world update and takes a snapshot of the current world state if necessary. A higher tickrate increases the simulation precision, but also requires more CPU power and available bandwidth on both server and client.

6
  • Please include your source.
    – user66184
    Mar 17, 2015 at 19:31
  • What is simulation precision? I don't exactly understand that
    – childe
    Mar 17, 2015 at 19:35
  • There we go. Had it in the clipboard, just forgot to link it. Thanks.
    – TheFaster
    Mar 17, 2015 at 19:35
  • @0-framelinks Well, if more calculations are being done per second, you'd get a more accurate and precise simulation, right?
    – TheFaster
    Mar 17, 2015 at 19:37
  • So basically a tick is how accurate information is being relayed to the server from the client?
    – childe
    Mar 17, 2015 at 19:37
0

In one tick the game engine processes all actions (whether from a user or from an AI or other internal process) and updates the state and location of all objects in the world accordingly. The rendering engine takes all the states and locations and displays the objects onto your screen using on your location in the world. For a standalone game, there is normally a render-per-tick. For an online game, the relationship depends on the game - eg. your World of Warcraft client receives state and location information from the server and your local machine simply renders the objects at its own pace.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .