vexyl / MCHawk2

A rewrite of the Minecraft classic software that I wrote, MCHawk
MIT License
5 stars 1 forks source link

Entity replication #6

Open vexyl opened 2 years ago

vexyl commented 2 years ago

Entities should be automatically replicated to players, updating their name, position, and heading every tick (for which rate should be modifiable). Maybe have some kind of priority? Entities should only be replicated to players nearby unless set otherwise (distance should be modifiable). Adding to replicated entity list should send all interested players the new entity (i.e., ExtAddEntity2) and removing them should also remove them on the player's client (i.e., DespawnPlayer).

This makes it easy to do stuff with entities. If a developer wants NPCs in a game (bots), then they'd manage their own NPC list, linking them to the replication system. Then, if they wanted them to move, they'd simply update their position and it would automatically be replicated to interested players.

vexyl commented 2 years ago

This system should also replicate particle effects (and changes of their properties), player velocity (using VelocityControl packet), and model/texture changes on entities.