Frame Order: Difference between revisions
No edit summary |
(More detail about how each different kind of engine works.) |
||
Line 6: | Line 6: | ||
==Engine== | ==Engine== | ||
The engine has two modes of execution, a threaded path and a non-threaded path. The <code>host_thread_mode</code> cvar determines which path is taken. Dedicated servers will ignore this cvar and always use the non-threaded path. XBox 360 runs in threaded mode by default, while PC runs in non-threaded mode by default. Threaded mode was introduced with the Orange Box version of the Source engine, and does not exist in Episode 1 or previous versions. | |||
Listenservers (ie, singleplayer games, or multiplayer games hosted by one of the players) will run all sections of code, calling both client.dll and server.dll functions from the same thread and in the same engine loop. Clients connected to a remote server will run the italicized sections only, and dedicated servers will run the bold items only. Dedicated server builds (Linux or Windows SrcDs) will run only the underlined sections. | |||
Legend: | Legend: | ||
* '''Bold - Code path for a dedicated server | * '''Bold - Server code, occurs on any server engine, server-only or listenserver''' | ||
* ''Italics - Client code, occurs on any client engine, client-only or listenserver'' | |||
* <u>Underline - Code path for a dedicated server</u> (Non underline items do not run on a dedicated server.) | |||
===Non-threaded model=== | ===Non-threaded model=== | ||
* '''Console commands''' | * '''''<u>Console commands</u>''''' | ||
* For each tick: | * For each tick: | ||
** '''Networking''' | ** '''''<u>Networking</u>''''' | ||
** ''Input'' | ** ''Input'' | ||
** '''Server game code''' | ** '''<u>Server game code</u>''' | ||
** ''Client game code'' | ** ''Client game code'' | ||
** ''Client prediction'' | ** ''Client prediction'' | ||
Line 28: | Line 32: | ||
===Threaded model=== | ===Threaded model=== | ||
* Console commands | * '''''Console commands''''' | ||
* For each client tick: | * For each client tick: | ||
** Networking | ** '''''Networking''''' | ||
** ''Client game code'' | ** ''Client game code'' | ||
* ''Client prediction'' | * ''Client prediction'' | ||
*For each server tick: | * For each server tick: | ||
** ''Input'' | ** ''Input'' | ||
** Networking | ** '''''Networking''''' | ||
* Server game code (new thread) | * '''Server game code (new thread)''' | ||
* ''Rendering'' | * ''Rendering'' | ||
* ''Sound'' | * ''Sound'' |
Revision as of 17:21, 1 October 2009
This section is currently under construction. Please feel free to add any insights you may have into the structure of the Source engine that you would like to share with the community.
Introduction
This is the order in which systems are invoked for each engine frame.
Engine
The engine has two modes of execution, a threaded path and a non-threaded path. The host_thread_mode
cvar determines which path is taken. Dedicated servers will ignore this cvar and always use the non-threaded path. XBox 360 runs in threaded mode by default, while PC runs in non-threaded mode by default. Threaded mode was introduced with the Orange Box version of the Source engine, and does not exist in Episode 1 or previous versions.
Listenservers (ie, singleplayer games, or multiplayer games hosted by one of the players) will run all sections of code, calling both client.dll and server.dll functions from the same thread and in the same engine loop. Clients connected to a remote server will run the italicized sections only, and dedicated servers will run the bold items only. Dedicated server builds (Linux or Windows SrcDs) will run only the underlined sections.
Legend:
- Bold - Server code, occurs on any server engine, server-only or listenserver
- Italics - Client code, occurs on any client engine, client-only or listenserver
- Underline - Code path for a dedicated server (Non underline items do not run on a dedicated server.)
Non-threaded model
- Console commands
- For each tick:
- Networking
- Input
- Server game code
- Client game code
- Client prediction
- Rendering
- Sound
- Client HUD update
Threaded model
- Console commands
- For each client tick:
- Networking
- Client game code
- Client prediction
- For each server tick:
- Input
- Networking
- Server game code (new thread)
- Rendering
- Sound
- Client HUD update