ewrogers/sgdk-skills

sgdk-multiplayer

Build local SGDK multiplayer with join/leave during play, direct pads and multitaps, shared cameras, independent respawns and fair shared interactions.

소스 보기

사용 방법

  1. 설치 명령을 복사하고 자신의 에이전트 환경에 설치하기 전에 소스 패키지를 확인하세요.
  2. 필요한 도구, 인증 정보, 지원 환경은 원본 문서에서 확인하세요.
  3. 입력과 원하는 산출물을 설명하고 출처와 결과를 대조하세요.
npx skills add https://github.com/ewrogers/sgdk-skills --skill sgdk-multiplayer

시작 전 확인

  • 설치에는 모델 구독, API 한도, 파일 접근 권한이 포함되지 않습니다.
  • 별점 수와 설치 수는 활동 지표이며 독립적인 품질·보안 검증이 아닙니다.
원본 Skill 문서

원본 저장소의 제목, 예시, 코드, 표, 링크, 이미지를 유지해 표시합니다.

SGDK multiplayer

Keep a controller's logical slot separate from the player it controls. A pad on JOY_7 can join as Player 1. Joining, leaving, pausing and respawning are game rules; SGDK supplies controller snapshots and rendering services.

Establish the session rules

Agree on participant count, join/leave controls, pause ownership, shared versus individual progress, body blocking and what happens when everyone is down. Choose a shared camera, separate screens or another framing policy deliberately. Do not silently impose the Lab's four-player cap, theme or tuning on another game.

Pull ewrogers/sgdk:latest and verify its controller headers and implementation. Read controller routes and SGDK contracts before configuring adapters. sgdk-input covers low-level input; this skill owns the participant/session layer. It does not implement network multiplayer.

Keep device and participant ownership stable

  • Build a route table from the actual port topology. Enable detected Team

Players explicitly; EA 4-Way Play occupies both ports. Do not assume four consecutive JOY_* IDs belong to one adapter.

  • Snapshot each logical pad once after normal SDK service. Seed held-button

history after setup/rescan so a held Start cannot create a phantom join.

  • Process a fresh Start on an unused pad as Join before considering Pause.

Consume Leave edges too. Simultaneous pause requests must toggle only once.

  • Preserve each participant's device assignment until an explicit departure.

Quiet input or cached pad type is not reliable disconnect detection.

  • Rescan during setup or a controlled session change. SGDK's reset includes

VBlank processing; do not insert it into an ordinary gameplay tick.

Make shared play predictable

Calculate every player's proposed movement before applying the group constraint. A shared camera should not favor Player 1 just because that player updates first. Keep collision correction and the final camera span compatible. Let players move inward to regroup; exclude downed participants from the live framing set.

Use a bounded respawn search with walkability, group visibility and a temporary protection policy. If no candidate fits, retry later rather than spawning inside a wall. Define an all-down checkpoint separately. Pause must freeze gameplay timers, while still allowing the chosen join/resume controls.

Resolve shared pickups once. Use nearest-player ownership or another explicit rule; break equal-distance ties fairly. Keep deterministic update order and consume input edges only once even if PAL scheduling runs two simulation ticks.

See camera, respawn and testing patterns and the standalone Co-op Lab: Bellkeepers. Its C model has no SDK dependencies; the renderer uses normal SGDK APIs. It is an executable example, not a required framework.

Budget and prove the combined case

Budget all joined players, enemies, effects and HUD together. Share palettes by art role where useful; do not spend one palette per player by default. Account for hardware pieces and same-line pixels as well as logical sprite counts.

Test join/leave races, capacity, simultaneous Start, pause joins, last-player departure, all-down recovery and equal-distance pickups. Compare PAL/NTSC logic schedules and compile both release/debug builds for the base 68000. Check actual presentation and sound in an emulator, then validate intended physical pads and adapter models on a console. The CPU tour proves four-character gameplay and presentation; it does not test multitap electronics or the polling protocol.

Use sgdk-performance for measured frame costs, sgdk-raster for split-screen rendering and sgdk-hardware for physical compatibility checks when available.

For damage filtering, friendly fire and hit reactions between participants, use sgdk-combat when available. Preserve the session’s player assignments and respawn rules rather than creating a second participant registry.

관련 작업

같은 저장소의 Skills

더 많은 Skills

모든 Skills
ewrogers
커뮤니티

sgdk-ai

Implement enemy behavior in SGDK games with patrol/chase/attack states, sight cones, target selection, bounded pathfinding and staggered updates. Use when enemies see through walls, get stuck, switch targets erratically, return stale paths or cause frame spikes while searching.

설치 수
1
GitHub Stars
0
업데이트
10월 20일
ewrogers
커뮤니티

sgdk-assets

Prepare, import and troubleshoot Mega Drive graphics, palettes, spritesheets, tiles, maps, fonts and audio resources with SGDK ResComp in Docker. Use for .res files, palette or tile budgets, broken imports, sprite cutting and asset pipeline changes.

설치 수
1
GitHub Stars
0
업데이트
10월 20일
ewrogers
커뮤니티

sgdk-best-practices

Write or review SGDK C for defined arithmetic, clear module boundaries, resource lifetimes, safe queued transfers and interrupt sharing. Use for implementation quality and project code organization, rather than toolchain setup, game design or performance profiling alone.

설치 수
1
GitHub Stars
0
업데이트
10월 20일
ewrogers
커뮤니티

sgdk-cartridge

Plan and implement large SGDK cartridges with Sega/SSF bank switching, FAR resources, pinned shared code and audio, and safe SRAM access. Use when a ROM exceeds the linear address window, stage assets live in separate banks, a FAR pointer becomes invalid, or saving interferes with banked content.

설치 수
1
GitHub Stars
0
업데이트
10월 20일