クレジットとハンガーの設計Designing Credits and the Hangar

開発ログ / ゲームデザイン / UI設計Development Log / Game Design / UI Design

敵とボスのコンテンツを拡張したあと(敵12種・3ボスへのコンテンツ拡張)、次に取り組んだのがプレイの継続動機を作るための「クレジット」というゲーム内通貨と、それを使って自機の見た目・性能を変えられる HANGAR 画面でした。VOID STRIKERは外部アセットも通信も前提にしないシンプルな1枚もののブラウザゲームとして始まったため、この経済システムもまずは完全にオフラインで、localStorage だけで完結する形(設計上のPhase 1)として組み立てています。

After expanding the enemy and boss content (Expanding the Content to 12 Enemies and 3 Bosses), I next worked on an in-game currency called credits to provide a reason to keep playing, along with a HANGAR screen where players can spend them to change their ship's appearance and performance. VOID STRIKER began as a simple, single-page browser game that assumes neither external assets nor network access, so this economy was first built as a completely offline system using only localStorage, referred to in the design as Phase 1.

「スコアがそのまま資産になる」設計Designing Score to Become an Asset Directly

クレジットの主要な入手経路は、ゲームオーバー時にその回のスコアを100で割った値を加算する、という単純なルールにしました。複雑な実績システムやミッションを別立てで作るより、既存のスコアという指標をそのまま経済に接続したほうが、既存のプレイループを崩さずに「もっと上手くなりたい」というモチベーションに「クレジットが貯まる」という新しい価値を上乗せできると考えたためです。加算は1プレイにつき一度きりで、リトライ時に何度も加算されないよう Main.earnedCredits に直近の獲得額を保持し、次の死亡まで再加算しない設計にしています。

The main way to earn credits follows a simple rule: at game over, the run's score divided by 100 is added to the balance. Instead of building a separate, complex achievement or mission system, connecting the existing score directly to the economy preserves the current gameplay loop while adding the new value of accumulating credits to the motivation to improve. Credits are awarded only once per run. Main.earnedCredits stores the most recent amount, preventing repeated awards on retries until the next death.

紹介コードのチェックディジット設計Check-Digit Design for Referral Codes

クレジットのもう一つの入手経路として、プレイヤー同士でコードを交換できる紹介コード機能も用意しました。ここで気を配ったのは「他人のコードを総当たりで打ち込んでも、そう簡単には通らない」ようにすることです。8桁の数字のうち下1桁を、残り7桁の重み付き和(1桁目×1 + 2桁目×2 + ... + 7桁目×7 の10で割った余り)から求まる検査数字(チェックディジット)にすることで、ランダムな数字列のほとんどは形式チェックの時点で弾かれるようにしました。自分自身のコードは使えない、同じコードは1度しか使えない、といった細かいルールも、シンプルな数字コードだけで不正利用をある程度抑止するために積み重ねたものです。

Referral codes that players can exchange provide another source of credits. The main concern was preventing brute-force entry of other people's codes from succeeding too easily. Of the eight digits, the last is a check digit derived from the weighted sum of the first seven (first digit×1 + second digit×2 + ... + seventh digit×7, modulo 10). This rejects most random digit strings during format validation. Rules that prevent using your own code or using the same code more than once add further safeguards against abuse while keeping the code itself a simple number.

HANGAR画面とプレイヤー描画の衝突A Collision Between the HANGAR Screen and Player Rendering

HANGAR画面を実装する過程で見つかった小さな、しかし象徴的なバグがありました。VOID STRIKERはタイトル画面で自機のプレビューを兼ねて自機を描画し続けているのですが、この描画処理をHANGARやCODE、OPTIONといった新しい画面でもそのまま流用していたため、画面下部中央に自機が常時表示され、そこに重なる形でBACKボタンのラベルやCODE画面のキーパッド、OPTION画面の選択項目が隠れてしまうことがありました。修正はシンプルで、hangar/code/option の各状態では自機の描画そのものをスキップし、title 状態でのみ描画するようにしました。「共通処理を安易に使い回すと、思わぬところで視認性を損なう」という典型例で、UI画面ごとに何を表示すべきかを都度見直す必要性を再確認させられた修正でした。

A small but representative bug appeared while implementing the HANGAR screen. VOID STRIKER continuously draws the player's ship on the title screen as a preview. Reusing that drawing process unchanged on the new HANGAR, CODE, and OPTION screens left the ship visible at the bottom center, where it could obscure the BACK button label, CODE keypad, or OPTION selections. The fix was simple: skip player rendering in the hangar/code/option states and render it only in the title state. It was a typical example of how casually reusing shared logic can unexpectedly reduce readability, and reinforced the need to review what each UI screen should display.

スキンを「見た目だけの課金要素」にしないMaking Skins More Than Cosmetic Purchases

HANGARで購入できるスキンは、単に自機の色や形が変わるだけでなく、連射レート・弾のダメージ・追加弾の有無・拡散角といった実際の射撃性能にも差をつけています。見た目だけのコスメにすると、稼いだクレジットをつぎ込む動機が弱くなってしまうと考えたためです。とはいえ性能差が大きすぎるとゲームバランスが崩れるため、価格順に総合火力(DPS)が厳密に増加するよう数値を調整し、「高いスキンを買えば確実に報われるが、無課金でも初期スキンで十分クリアを狙える」バランスを目指しました。詳しい数値は スキン&武装カタログにまとめています。

Skins purchased in HANGAR change not only the player's color and shape, but also practical weapon performance such as fire rate, bullet damage, extra projectiles, and spread angle. If they were purely cosmetic, there would be less reason to spend earned credits on them. At the same time, large performance gaps would undermine the game's balance. I tuned the values so that overall damage per second increases strictly with price, aiming for a balance where an expensive skin provides a reliable benefit while the starter skin remains capable of clearing the game without purchases. Detailed values are listed in the skin and weapon catalog.

この先の展望Looking Ahead

現在のクレジット経済はブラウザ内で完結するPhase 1の実装ですが、将来的にはCloudflare Workers上のバックエンドと連携し、購入したアイテムの所持状態を複数端末で同期する仕組み(Phase 2)も見据えて設計しています。net.js というオプショナルな通信レイヤーをあらかじめ切り出しておき、 file:// で起動した場合や通信先が未設定の場合は完全に無効化される作りにしているのは、「オフラインで完結する」というVOID STRIKERの大前提を将来にわたって崩さないための設計判断です。

The current credit economy is a browser-only Phase 1 implementation, but its design also anticipates a future Phase 2 that connects to a Cloudflare Workers backend and synchronizes purchased-item ownership across devices. An optional networking layer called net.js was separated in advance and becomes fully disabled when the game runs from file:// or when no endpoint is configured. This design decision preserves VOID STRIKER's fundamental premise of remaining fully functional offline in the future.