implementing basic transform systems for netcodes.
- game code agnostic systems including
- client prediction
- interpolation
- basic distance based replication culling
- basic replication grouping
- each features can be replaced with other expert crates
running development demo with Rapier3D's KinematicCharacterController.
cargo run --bin server
cargo run --bin client
in development demo, you will see a lot of unorganized plugins and bundles.
but point is that character controlling systems are able to be written as ordinary as offline systems.
pub fn ground_check_system(
mut query: Query<(
&Transform,
&KinematicCharacterController,
&mut Jump
)>,
rapier: Res<RapierContext>
) {
---
}
pub fn update_character_controller_system(
mut query: Query<(
&mut Transform,
&mut KinematicCharacterController,
&mut Jump,
&mut EventCache<NetworkMovement2_5D>
)>,
params: Res<PlayerMovementParams>,
time: Res<Time<Fixed>>
) {
---
}
pub fn apply_gravity_system(
mut query: Query<(
&mut KinematicCharacterController,
&mut Jump
)>,
time: Res<Time<Fixed>>
) {
---
}
and then, just add systems on server and client as same as offline.
---.add_systems(FixedUpdate,(
ground_check_system,
update_character_controller_system,
apply_gravity_system
).chain()---