highlevel-netcode-gen/casestodesignfor
2023-12-21 22:15:35 -05:00

26 lines
1.5 KiB
Plaintext

Spawn a tree
Lets say there's a concept of macros within the networking framework
You call the spawn foliage function specifying the type of tree
the spawn foliage function manually calls the server side macro to create a tree
This macro sends a packet to all clients in the chunk to create this tree entity
Each client creates the tree with the client equivalent of the create tree function
Player joins a chunk that has a tree that is on fire
The macro is called to spawn a tree, just for that player (how do we tell to call macro for this entity and not generic spawn entity function?)
...?
For each btree that isn't a part of the default created tree, keep a list on the entity of additional, attached trees
when the tree is created, loop through this list of additional trees and send packets to client to synchronize its state
^This could also include default trees that aren't in default state
^^At that point just include all trees for ease of use's sake
Kill a tree
Server death animation tree fires, also triggering client death animation tree to fire
once the animation has finished, the server calls the delete entity function
the delete entity function server side sends a special packet to client that triggers client delete entity function
A player joins a chunk with a player entity in it
The server sends a packet to create a new human
The server sends the human template packet for that entity ID
The server iterates over every synchronized behavior tree and sends the status of each variable that is synchronized within that tree