User Tools

Site Tools


tutorial:side

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
tutorial:side [2019/05/12 12:22] tyra314tutorial:side [2019/05/26 14:51] – [Logical Sides] Made logical sides more about the world state and the replication jamieswhiteshirt
Line 22: Line 22:
 ===== Logical Sides ===== ===== Logical Sides =====
  
-Logical sides are about the actual logic running during the execution.  +Logical sides are about the actual game logic.  
-The client does rendering, sends player inputs to the server, handles resource packsand the server calculates most core logic, handles data packs, keeps the world/game data.+The logical client does rendering, sends player inputs to the server, handles resource packs and partially simulates the game world. The server handles the core game logic, data packs and maintains the true state of the game world.
  
-The logical client and server share some logic classesincluding:<code>+The client maintains a partial replica of the server's worldwith copies of objects such as:<code>
 net.minecraft.world.World net.minecraft.world.World
 net.minecraft.entity.Entity net.minecraft.entity.Entity
 net.minecraft.block.entity.BlockEntity net.minecraft.block.entity.BlockEntity
 </code> </code>
-These shared classes allow logical clients to shadow some common game logic from the logical server for easy rendering(block entities are shadowed to the logical client optionally) +These replicated objects allow clients and servers to perform some common game logic. The client can interact with these objects while the server is responsible for keeping them in sync. Usually, to distinguish objects on the logical clients from the ones on the logical server, access the world of the object and check its 'isClientfield. This can be used to perform authoritative actions on the server such as spawning entities, and to simulate actions on the client. This technique is necessary to avoid desynchronization between the two logical sides.
- +
-Usually, to distinguish the shadowed objects on the logical clients from the real ones on the logical server, vanilla and mod code access the world referenced in these objects and check the state of the isClient field. A calculation is then only down on the logical server so that they do not perform useless calculations on the logical client. This technique avoids desynchronization between the two logical sides and reduces the load on the logical client. +
 ===== Detailed look into all sides ===== ===== Detailed look into all sides =====
  
tutorial/side.txt · Last modified: 2022/04/13 04:32 by 127.0.0.1