SS14 Graphics GenericVisualizer Appearance
БесплатноБез исполняемых скриптовНе проверенA practical and architectural guide to the combination of AppearanceComponent, AppearanceSystem, VisualizerSystem and GenericVisualizer in SS14. Use it when…
от makura-games★ 74 звезды на GitHubОб этом скилле
GenericVisualizer and Appearance in SS14
This skill only covers the pipeline Appearance + VisualizerSystem + GenericVisualizer :)
Low-level rendering and detailed SpriteSystem API can be analyzed in a separate sprite-skill.
When to choose this skill
Choose it if the task is about:
- replication of visual state from server to client;
- designing
Appearancekeys and payload data; - choice between
GenericVisualizerand custom visualizer; - YAML description of visualization via
visuals; - processing
AppearanceChangeEvent.
Source of truth and relevance
- If there is a conflict between documentation and code, the current code takes precedence.
- Documentation is used as conceptual support, but the API is verified against implementation.
- Practical recommendations and examples are based on fresh patterns from current code.
End-to-end architecture
- Server logic calculates the visual state.
- The server writes data to
AppearanceComponentthroughSharedAppearanceSystem.SetData(...). - The data enters the component state and is synchronized over the network.
- Client
AppearanceSystemaccepts state, updates the appearance data dictionary, and queues the update. - During
FrameUpdate,AppearanceChangeEventis raised. - Client visualizer systems (
VisualizerSystem<T>) apply data to the sprite. - If simple mapping of values on layer-data is enough,
GenericVisualizerSystemdoes this.
Idea: the server conveys not “how to draw”, but “what is visually true”; the client decides “how to draw” :)
Enum contract: which enums are needed and in what order
This topic usually involves two different enum contracts, sometimes three:
AppearanceKey enum(shared) These are the keys of theAppearanceDatadictionary. It is these enums that are passed toSetData/TryGetData/RemoveData.LayerKey enum(client + prototype visualization) These are the keys of the sprite layers (layer map), by which you changevisible/state/color/.... These enums are used inSpriteSystemand/or inGenericVisualizerYAML as layer key.AppearanceValue enum(optional, shared) This is not a key, but a value of appearance data. Example:ChargeState.Empty/Medium/Full.
Critically important: AppearanceKey enum and LayerKey enum are different roles and should not be mixed ⚠
Order of application in code and YAML
- Describe
AppearanceKey enumin the shared contract. - Describe
LayerKey enumfor addressing layers. - The server writes the value:
SetData(uid, AppearanceKey.SomeKey, value). - Client:
- or custom visualizer: reads
AppearanceKeyviaTryGetData, applies toLayerKeyviaSpriteSystem; - or GenericVisualizer: YAML mappit
AppearanceKey -> LayerKey -> AppearanceValueString -> PrototypeLayerData.
- or custom visualizer: reads
Matching pattern
visuals:
enum.AppearanceKeyEnum.SomeKey:
enum.LayerKeyEnum.TargetLayer:
"AppearanceValueToString":
state: some_state
visible: true
[Serializable, NetSerializable]
public enum LockerVisuals : byte // 1) AppearanceKey enum
{
Open,
ChargeState,
}
[Serializable, NetSerializable]
public enum LockerVisualLayers : byte // 2) LayerKey enum
{
DoorOpen,
DoorClosed,
Indicator,
}
[Serializable, NetSerializable]
public enum LockerChargeState : byte // 3) AppearanceValue enum (optional)
{
Empty,
Medium,
Full,
}
// Server: AppearanceKey + value only
_appearance.SetData(uid, LockerVisuals.Open, true, appearance);
_appearance.SetData(uid, LockerVisuals.ChargeState, LockerChargeState.Full, appearance);
// Client (custom visualizer): reads AppearanceKey, applies to LayerKey
if (_appearance.TryGetData(uid, LockerVisuals.Open, out bool open, args.Component))
{
_sprite.LayerSetVisible((uid, args.Sprite), LockerVisualLayers.DoorOpen, open);
_sprite.LayerSetVisible((uid, args.Sprite), LockerVisualLayers.DoorClosed, !open);
}
API parsing
1) SharedAppearanceSystem
Key methods:
SetData(EntityUid, Enum, object, AppearanceComponent?)RemoveData(EntityUid, Enum, AppearanceComponent?)TryGetData<T>(...)TryGetData(..., out object?)CopyData(Entity<AppearanceComponent?> src, Entity<AppearanceComponent?> dest)AppendData(...)QueueUpdate(...)(virtual, specific implementation depends on the party)
Important:
- In the current API, appearance data keys are
Enum. - Appearance values must be correctly cloned/serializable.
2) Client AppearanceSystem
What is important to know:
- keeps a queue of appearance updates;
- in
FrameUpdatecauses a change in the visual only for current entities; - generates and sends
AppearanceChangeEvent; - when received, state compares the data and updates the dictionary;
- when cloning appearance data, it requires safe types:
- value type, or
ICloneable, or- a type that the serializer can copy.
If this is not done, exceptions may occur whe
Установить SS14 Graphics GenericVisualizer Appearance в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл SS14 Graphics GenericVisualizer Appearance?
A practical and architectural guide to the combination of AppearanceComponent, AppearanceSystem, VisualizerSystem and GenericVisualizer in SS14. Use it when designing network visual states, YAML visualizations and client visualizer systems.
Как установить скилл SS14 Graphics GenericVisualizer Appearance?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл SS14 Graphics GenericVisualizer Appearance запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic