Pets
Companion entities: summon with an opaque look; follow / zone-travel / owner-leave handled. Server-only.
Services you call 1
Crossplay implements these. Resolve them from DI and call them from your own systems.
IPetService
Companion entities bound to a player: summon with an OPAQUE appearance, and the piece keeps the pet at the owner's side — following through the standard movement pipeline, teleporting across zone travel, despawning when the owner leaves. Everything else a pet might do (combat, abilities, tricks) is the game's, via the ordinary entity id.
-
void CollectPets(ISession session, List<long> into)Fills into with the session's live pet entity ids (cleared first; empty when none).
-
bool Dismiss(ISession session, long petEntityId = 0)Despawns one pet (or all of the session's pets when petEntityId is 0).
-
long Summon(ISession session, byte[] appearance)Spawns a pet next to the session's avatar; the piece then keeps it at the owner's side automatically.
Configuration 1
Every tunable lives in an options object — there are no magic numbers to hunt for.
PetOptions
Pets tuning (defaults here, never inline).
-
float FollowDistance { get; set; }The pet idles once this close to its owner.
-
byte FollowLocomotion { get; set; }Locomotion byte broadcast while following (game vocabulary).
-
float FollowSpeed { get; set; }Follow speed (units/second).
-
byte IdleLocomotion { get; set; }Locomotion byte broadcast when settling (game vocabulary).
-
int MaxPetsPerOwner { get; set; }Active pets one owner may have out at once.
-
float TeleportDistance { get; set; }Past this distance the pet teleports to the owner instead of walking.
-
double UpdateHz { get; set; }How often each pet thinks (per second).