What is a Service?
A Service in Knight is any module placed in:src/ServerStorage/Knight/Services(server-side)src/StarterPlayer/StarterPlayerScripts/Knight/Services(client-side)src/ReplicatedStorage/Knight/Shared/Services(shared)
self.Services.
Examples:
Why Call Them “Controllers” on the Client?
While technically still Services, developers often call client-side services Controllers because:- They manage input, UI, camera, audio, and other player-facing systems
- It helps mentally separate game logic (server) from player experience (client)
- It mirrors common frontend/backend naming conventions
Best Practices
1. Keep Logic Scoped to the Right Context
- Server Services should never assume presence of GUI elements or player input.
- Client Services (aka Controllers) should never mutate global game state or kick players.
2. Name Clearly and Consistently
Use suffixes if it helps readability:3. Shared Services Are Powerful
If you have logic that both client and server need (like data validation, math utilities, enum definitions), place them inKnight/Shared/Services.
Avoid placing business logic here — shared services should be deterministic and stateless when possible.
Summary
| Concept | Definition |
|---|---|
| Service | A module that runs logic in the Knight Framework. |
| Controller | A naming convention for client-side services. |
| Shared Service | A deterministic module usable by both client and server. |
