agentleFS
abduznikabduznik/abduznik-skills/skills/flash-game-research/SKILL.md

flash-game-research

Skill2 starsChanged 2 months agoMITView on GitHub

Run, analyze, or automate Flash SWF games via Ruffle.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when running, analyzing, or automating Flash (.swf) games via Ruffle.

    line 15
  2. Very specific:

    Verify with file <swf> — expect Macromedia Flash data (compressed), version N.

    line 21
  3. Distinctive:

    No programmatic API from Ruffle desktop — control via mouse/keyboard simulation (pyautogui, mss).

    line 55
  4. Very specific:

    Ruffle Vulkan segfault on Intel iGPUs: always pass --graphics gl on machines without dedicated GPU.

    line 61

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Use when running, analyzing, or automating Flash (.swf) games via Ruffle.

Procedure

1. Get the SWF

  • Archive.org: https://archive.org/metadata/<slug> lists files. Find the .swf filename from the metadata JSON, then download via https://archive.org/download/<slug>/<filename>.
  • Verify with file <swf> — expect Macromedia Flash data (compressed), version N.
  • CWS = zlib-compressed. The first byte after the 8-byte header is the start of zlib data.

2. Ruffle Setup

  • Download: GitHub releases API https://api.github.com/repos/ruffle-rs/ruffle/releases?per_page=3, look for windows-x86_64 zip.
  • Graphics backend: Intel HD Graphics (e.g. HD 520) segfaults on Vulkan. Force --graphics gl. DX12 also works on some Intel iGPUs.
  • Launch: ./ruffle/ruffle.exe --graphics gl --width 800 --height 600 game.swf
  • SWF v9 games (AS2) load fine. AVM1 stack underflow warnings are cosmetic. Ad URL errors (InvalidDomain) are harmless.

3. SWF Introspection (finding interactables)

Quick method — string extraction: Decompress the SWF and scan for readable ASCII strings. Finds button names, instance names, screen labels, ActionScript constants without a full parser.

import zlib
with open('game.swf', 'rb') as f:
    f.read(8)  # skip CWS header
    compressed = f.read()
decompressed = zlib.decompress(compressed, 15)  # wbits=15 for CWS

Scan for runs of printable ASCII >4 chars. Filter for game-relevant keywords: btn, button, click, order, cook, cut, serve, station, screen, menu, play, start, score, drag, drop.

Tag-level parsing: SWF tags include:

  • DoAction (12): ActionScript 2 bytecode — extract string constants
  • FrameLabel (43): named frames = game states
  • PlaceObject2 (22): placed MovieClips with instance names
  • SymbolClass (76): maps character IDs to class names (AS3 games)
  • DefineSprite (39): animated sequences, frame count reveals screen complexity

Full decompilation: JPEXS Free Flash Decompiler (requires Java) gives complete ActionScript source.

4. Game Control

  • Flash games use onPress/onRelease handlers on named MovieClips.
  • No programmatic API from Ruffle desktop — control via mouse/keyboard simulation (pyautogui, mss).
  • Station detection: frame labels or screen region fingerprinting (color histograms per station area).
  • Coordinate mapping: Ruffle window position from pyautogui, game coordinates relative to window.

Pitfalls

  • Ruffle Vulkan segfault on Intel iGPUs: always pass --graphics gl on machines without dedicated GPU.
  • SWF decompression wbits: zlib.decompress(data) fails on CWS SWFs. Use zlib.decompress(data, 15) — 15 = max window bits + enable zlib header detection.
  • python3 vs python: On this Windows machine, python3 resolves to a broken Windows Store alias. Use python (3.11.10 in the venv) and python -m pip for installs.
  • AS2 vs AS3: SWF version ≤8 is AS2 (DoAction tags, no SymbolClass). Version ≥9 can be either. AS3 games use class-based structure via SymbolClass tag 76. AS2 games use _root.onPress style with all logic in DoAction bytecode.
  • Frame label extraction: FrameLabel tags contain null-terminated strings. Parse with tag_data.split(b'\x00')[0].decode('latin-1').
  • PlaceObject2 instance names: variable-length matrix encoding makes naive offset parsing unreliable. Use string extraction method instead for finding instance names.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.