Skip to content
/ feces Public

A generalized replication system for jecs that allows for easy and fast replication of components.

License

Notifications You must be signed in to change notification settings

NeonD00m/feces

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

"Fast Entity Component Export System"

A generalized replication system for jecs that allows for easy and fast replication of components.


Getting Started

Example in examples/replication.luau for how to use it. Here are some explanations and basic types:

feces.init :: (Jecs.World) -> ()
feces.replicated :: Jecs.Component<{Player} | Player?>
-- feces.replicated is readonly

init() should be obvious as to what it does, if the world is not set there will be warnings in the console.

replicated is the component used to mark entities that should be replicated by simply adding it to an entity, or replicate specific components by pairing it with the type of component.

If a list of players or a single player is provided, the component will only replicate to those players. This value is not meant to change at runtime and could cause issues if changed.


feces.getPackets :: () -> (() -> (number?, Packet?))
feces.getFullPacket :: () -> Packet

getPackets() returns an iterator to loop through all the packets at that frame

getFullPacket() returns all public entities and components at this frame (useful for giving new players a payload on join)


feces.applyPackets :: (EntityChanges) -> ()
feces.filterPackets :: (EntityChanges, ...: component<any>) -> ({ entity<any> }, { component<any> })

applyPackets() applies the packets to the world

filterPackets() filters the packets to only the components you want to replicate


Installation

Either copy the code manually or use pesde:

pesde add neond00m/feces

About

A generalized replication system for jecs that allows for easy and fast replication of components.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages