Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

ss14-virtual-controller-core

БесплатноБез исполняемых скриптовНе проверен

Parses the VirtualController architecture in Space Station 14: the UpdateBeforeSolve/UpdateAfterSolve cycle, order through UpdatesBefore/UpdatesAfter…

makura-gamesот makura-games★ 74 звезды на GitHub

Об этом скилле

VirtualController: Architecture and Cycle

Use this skill as an architectural playbook for VirtualController :) Keep your focus on fresh code and check its relevance through git log/blame (cutoff: 2024-02-20).

What to download first

  1. references/fresh-pattern-catalog.md - patterns with an obvious freshness status (Use / Limited) ✅
  2. references/rejected-snippets.md - zones that cannot be taken as a standard ⚠️
  3. references/docs-context.md - how to use docs safely

Source of truth

  1. The codebase is the primary source of truth.
  2. Documentation - secondary layer (terms, intent, diagnostics).
  3. Any site older than two years or with a TODO/problematic comment on the topic should not be included in the reference rules.

VirtualController mental model

  1. VirtualController is EntitySystem which subscribes to PhysicsUpdateBeforeSolveEvent and PhysicsUpdateAfterSolveEvent.
  2. The order of calling the controller is specified via UpdatesBefore / UpdatesAfter.
  3. Hooks UpdateBeforeSolve and UpdateAfterSolve are called on each physics substep.
  4. The prediction parameter tells whether predict simulation is running on the client.
  5. frameTime — time of one substep, not the entire tick.
  6. The performance of controllers is monitored separately through built-in histograms (BeforeMonitor / AfterMonitor).

Layer scheme

  1. Engine layer: VirtualController, SharedPhysicsSystem, before/after solve events, solver/contact pipeline, special-casing KinematicController.
  2. Shared layer: SharedMoverController, TileFrictionController, SharedConveyorController, ClimbSystem.
  3. Server layer: PullController, RandomWalkController, ChasingWalkSystem, ChaoticJumpSystem, MoverController, ConveyorController.
  4. Client layer: MoverController, ConveyorController-stub for prediction/network presence, prediction hooks via UpdateIsPredictedEvent.

Patterns

  1. Add UpdatesBefore / UpdatesAfter before base.Initialize() - otherwise the order hook will be fixed incorrectly.
  2. In UpdateBeforeSolve do early continue by prediction/body.Predict so as not to break the predict.
  3. Use AwakeBodies as the main set for per-step physical logic.
  4. For KinematicController, use manual damping via helper movement methods and then SetLinearVelocity/SetAngularVelocity.
  5. For heavy calculations inside the controller, separate the calculation phase (parallel job) from the phase of applying the results (main thread).
  6. For relay management, use the SetRelay/RemoveRelay API methods, rather than manually adding/removing components.
  7. For container-eject scenarios, where the entity must immediately appear “outside”, use ForciblySetClimbing as a safe post-eject transition.
  8. Keep UpdateBeforeSolve deterministic: minimum hidden state, minimum nondeterministic sources.
  9. To control regressions, check the physics monitors of the controllers before/after the change.
  10. For movement systems, maintain an invariant: mob movement and tile friction must occur in a consistent order.

Anti-patterns

  1. Configure UpdatesBefore/UpdatesAfter after base.Initialize().
  2. Copy TODO-heavy sections as an architectural standard.
  3. Write a controller that depends on “one call per tick” and ignores substeps.
  4. Perform expensive lookup/alloc operations without cache-query in a hot physics loop.
  5. Bypass the relay API using direct RemComp/EnsureComp in the gameplay code.
  6. Consider the empty client ConveyorController “superfluous” and remove it from the predictor scheme.
  7. Try to use old pre-cutoff fragments as a basis for new solutions.
  8. Treat mispredict with “magic guards” instead of correcting the source of desync.
  9. Interfere with transform movement and physical impulses without a clear cause-and-effect model.
  10. Ignore warning comments about fragile logic (slop, hack, temporary).

Low-level Box2D/Physics Internals

  1. The simulation goes through SimulateWorld: each substep raises before/after events, then broadphase/contact/solve.
  2. Controllers are executed before the solver (UpdateBeforeSolve) and after the solver (UpdateAfterSolve) on each substep.
  3. AwakeBodies - a key runtime set of bodies participating in the active simulation and controllers.
  4. Generation and recalculation of contacts are based on broadphase overlap + narrowphase manifold update.
  5. For KinematicController there are separate branches in solver/contact logic, so it cannot be treated as a regular Dynamic.
  6. Any logic that changes speeds/pulses in controllers must take into account prediction and body mode.

Code examples

1) Subscribe VirtualController to before/after solve

public override void Initialize()
{
    base.Initialize();

    var updatesBefore = UpdatesBefore.ToArray();
    var updatesAfter = UpdatesAfter.ToArray();

    // The controller receives both physics hooks in one order graph.
    SubscribeLocalEvent<Physics
Полный SKILL.md на GitHub

Установить ss14-virtual-controller-core в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/docs-context.mdreferences/fresh-pattern-catalog.mdreferences/rejected-snippets.md

FAQ

Что делает скилл ss14-virtual-controller-core?

Parses the VirtualController architecture in Space Station 14: the UpdateBeforeSolve/UpdateAfterSolve cycle, order through UpdatesBefore/UpdatesAfter, prediction semantics and connection with low-level physics Box2D (substeps, contacts, solver). Use when you need to deeply understand the system before expanding or debugging.

Как установить скилл ss14-virtual-controller-core?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл ss14-virtual-controller-core запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить ss14-virtual-controller-core с