Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Game Start Process Order #5151

Open
jdrueckert opened this issue Oct 22, 2023 · 0 comments
Open

Document Game Start Process Order #5151

jdrueckert opened this issue Oct 22, 2023 · 0 comments
Labels
Category: Doc Requests, Issues and Changes targeting javadoc and module documentation Revive: Keep issue has been looked at and deemed potentially helpful for revive Status: Needs Discussion Requires help discussing a reported issue or provided PR Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc. Type: Question Issue intended to help understanding something that is unclear

Comments

@jdrueckert
Copy link
Member

jdrueckert commented Oct 22, 2023

Documentation Topic

In StateLoading.java I noticed some discrepancies in the process loading order between client and host.
I don't think this topic is well-documented yet or at least I'm not aware of any such documentation.

Major question for me also is: is the difference in order intentional or a bug?

Documentation Type

With this being architectural documentation of sorts but heavily coupled with the code (despite probably being not modified too often), I would recommend this being documented in the Terasology Engine wiki or in-repo docsify to allow for documentation update as part of related code changes.

If these differences in order of loading are indeed intentional, then this should potentially also be documented in a code comment to avoid future confusion.

Additional notes

The order of process loading for client and host is generally equal (+/- some host only processes and processes that come in dedicated client or host flavours) save for

  • LoadExtraBlockData (which is done later on host side than on client side) and
  • RegisterBlockFamilies (which is done a lot later on client side than on host side)
Step Client Host
1 JoinServer (clients only) RegisterMods (host only)
2 InitialiseRendering* InitialiseRendering*
3 InitialiseEntitySystem InitialiseEntitySystem
4 RegisterBlocks RegisterBlocks
5 InitialiseGraphics* InitialiseGraphics*
6 LoadPrefabs LoadPrefabs
7 ProcessBlockPrefabs ProcessBlockPrefabs
8 LoadExtraBlockData -
9 InitialiseComponentSystemManager InitialiseComponentSystemManager
10 RegisterInputSystem* RegisterInputSystem*
11 RegisterSystems RegisterSystems
12 InitialiseCommandSystem InitialiseCommandSystem
13 - LoadExtraBlockData
14 InitialiseRemoteWorld (clients variant) InitialiseWorld (host variant)
15 - RegisterBlockFamilies
16 - EnsureSaveGameConsistency (host only)
17 InitialisePhysics InitialisePhysics
18 InitialiseSystems InitialiseSystems
19 PreBeginSystems PreBeginSystems
20 - LoadEntities (host only)
21 - InitialiseBlockTypeEntities (host only)
22 CreateRemoteWorldEntity (client variant) CreateWorldEntity (host variant)
23 - InitialiseWorldGenerator (host only)
24 - InitialiseRecordAndReplay (host only)
25 - Start Server (server only)
26 PostBeginSystems PostBeginSystems
27 SetupRemotePlayer (client variant) SetupLocalPlayer (host variant if local player)
28 AwaitCharacterSpawn AwaitCharacterSpawn
29 RegisterBlockFamilies -
30 PrepareWorld PrepareWorld

* only if not in headless mode

While we're at it we might also want to document the different execution modes (client only, host but not server, host and server, host with local player, etc.)
E.g., a singleplayer game is actually a host, as is a server game. only clients in a multiplayer setup are actually clients (see logic in stateloading.java and newgamescreen.java)

@jdrueckert jdrueckert added Category: Doc Requests, Issues and Changes targeting javadoc and module documentation Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc. Status: Needs Discussion Requires help discussing a reported issue or provided PR Type: Question Issue intended to help understanding something that is unclear Revive: Keep issue has been looked at and deemed potentially helpful for revive labels Oct 22, 2023
@jdrueckert jdrueckert changed the title Game Start Process Order Document Game Start Process Order Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Doc Requests, Issues and Changes targeting javadoc and module documentation Revive: Keep issue has been looked at and deemed potentially helpful for revive Status: Needs Discussion Requires help discussing a reported issue or provided PR Topic: Architecture Requests, Issues and Changes related to software architecture, programming patterns, etc. Type: Question Issue intended to help understanding something that is unclear
Projects
None yet
Development

No branches or pull requests

1 participant