Movement ranges with terrain costs, routes, threat ranges, an approach AI that walks round walls, turn order in two schemes and pre-battle deployment - the groundwork of a grid battle.ENGLISHGrid Movement & Turn Order SystemHow far can it go? Which way does it walk? Whose turn is it? Where does the squad start? Every tactics project writes these first and finds them brittle the moment terrain costs or the turn-order scheme change. This package is that groundwork, driven by data.WHAT IT DOES- Movement ranges that accumulate terrain costs. Plain 1, forest 2, marsh 3 - and because costs are expanded in order, the way returned is always the cheapest: two cells at 1 beat one at 3.- Routes come back with the range. Every reachable cell carries the cheapest way to it, so hovering cell after cell to preview a route never repeats the search.- Movement profiles are data, not an enum. "On foot", "flying" and "swimming" are ScriptableObjects: flying ignores both the costs and the walls, swimming crosses the marsh for 1 but cannot enter the forest. You never build a terrain-by-profile table.- Passing and stopping are separate questions. An ally may be crossed but not stood on; an enemy blocks the way; an incorporeal unit passes through both. One setting each.- Threat ranges in one call: every cell an enemy could strike after moving, which is the overlay players most want - whether standing here means being hit.- An approach AI that measures closeness by the distance actually walked. Judged by the straight line, the cell in front of a wall looks closest and the unit never moves again; spreading costs outwards from the target into a distance field fixes that, and it goes round.- Turn order in two schemes: team phases (your side moves everyone, then the enemy) and initiative (one unit at a time by speed, sides interleaved). Switching is a different settings asset. A look-ahead method feeds an initiative bar.- Pre-battle deployment from a zone and a formation, with blocked slots shunted to the nearest free cell so a deployment never fails for want of one square. Several squads deploy side by side.- Square grids with or without diagonals, and hexes.IS IT CUSTOMIZABLE?Yes, in the three places that decide whether an asset can enter a project that already exists.It does not know your board. Tilemap, a plain two-dimensional array, squares in 3D - implement two small interfaces and it works. Cells are plain Vector3Int, so there is no bespoke coordinate type to learn.It has no UI. The colour of a range, the shape of a route arrow, the look of an initiative bar: those are the character of your game. The package returns cells and verdicts; the demo shows a complete worked example of drawing them.It has no combat maths. Damage, accuracy and skills are out of scope, which makes it easiest to adopt for people who have already written theirs.TRY IT IN TWO MINUTESA showcase scene is included. One menu click builds it; pressing Play auto-runs fourteen captioned scenes covering every feature, looping forever with no input, with the cost of reaching each cell drawn on it. The demo contains no imported image, audio clip or font. A self-check menu runs 140 checks in memory and prints the result to the Console.----------------------------------------------------------------JAPANESEGrid Movement & Turn Order Systemどこまで動けるか。どう通るか。誰の番か。どこに並べるか。タクティクスを作れば必ず最初に書くことになり、地形コストや行動順の方式を後から変えると壊れやすい——このアセットはその土台を、データ駆動で提供します。できること・地形コストを積み上げる移動範囲。平地 1・森 2・沼 3。コスト順に探索するので、返るのは常に一番安い行き方です(コスト 3 の近道より、コスト 1 を 2 回の方が安い)。・経路は範囲と一緒に返ります。到達できる全マスに最短経路が付いてくるため、カーソルを合わせるたびに経路を引き直しても探索はやり直されません。・移動タイプは列挙型ではなくデータです。「歩行」「飛行」「水上」は ScriptableObject で、飛行はコストも壁も無視、水上は沼をコスト 1 で渡り森には入れない、といった設定ができます。地形 × 移動タイプの表を作る必要はありません。・通過と停止は別の問いです。味方は通れるが止まれない、敵は通せんぼ、幽体は両方通り抜ける——それぞれ設定 1 つです。・危険域が 1 行で返ります。その敵が移動してから攻撃できる全マス、つまり「ここに立ったら殴られるのか」という、プレイヤーが最も欲しがる表示です。・接近 AI は近さを「実際に歩く距離」で測ります。直線距離で判断すると壁の手前が一番近いことになって一歩も動けなくなりますが、目標から広げた距離マップを使うことで確実に回り込みます。・行動順は 2 方式。陣営フェーズ制(自軍が全員動いてから敵軍)とイニシアチブ制(素早さ順に 1 体ずつ)。切り替えは設定アセットの差し替えだけで、次の順番を返すメソッドが行動順バーをそのまま作れます。・出撃前の配置はゾーンと陣形から。塞がっている位置は近くの空きマスへ振り替わるので、1 マス足りずに配置できないという詰み方をしません。複数部隊を横に並べる機能もあります。・四角(斜めなし/あり)と六角に対応。Q: カスタマイズできますかA: はい。既存プロジェクトに入れられるかを決める 3 箇所で可能です。Tilemap でも自前の二次元配列でも 3D のマス目でも、小さなインターフェースを 2 つ実装すれば動きます。セルは素の Vector3Int なので、独自の座標型を覚える必要もありません。UI を持ちません。範囲の色も経路の矢印も行動順バーの形もゲームの個性です。本アセットはセルと判定結果を返し、描画例はデモに丸ごと入っています。戦闘計算も持ちません。ダメージ・命中・スキルは対象外で、すでに戦闘を作ってある人ほど素直に組み込めます。実演シーンを同梱しています。メニュー 1 クリックで構築し、再生するだけで 14 場面が字幕付きで自動再生されます(操作不要・無限ループ、各マスに到達コストの数字つき)。デモには画像・音声・フォントを 1 つも含みません。自己診断メニューは 140 項目をメモリ上で検証して結果を Console に出力します。ENGLISHFeatures:- Cost-ordered movement search (Dijkstra) returning reachable cells, the cost of each, and the cheapest route to any of them- Terrain as ScriptableObjects: entry cost, impassability, a blocks-sight flag and a display colour- Movement profiles as ScriptableObjects: ignore terrain costs, ignore impassable terrain, per-terrain overrides, pass through allies, pass through enemies- Separate handling of passing through a cell and stopping on it- Attack ranges with a minimum range, ignoring terrain and units as reach normally does- Threat ranges combining movement and reach in one call- An approach query using a distance field spread from the target, with a desired stand-off distance for units with reach- Retreat and reachable-target queries for AI- Turn order in two schemes - team phases and initiative - with look-ahead for an order bar, teams not listed in the settings still given a phase, and fallen units skipped- Formation patterns with built-in column, line abreast, wedge, ring and block presets- Deployment planning against a zone, with nearest-free-cell fallback, unplaced-slot reporting and side-by-side squad offsets- Square grids with or without diagonals, and offset hex coordinates, for both adjacency and distanceExtensibility:- ITacticsUnit, IBoard and IUnitLocator adapt whatever board and characters you already have- Cells are UnityEngine.Vector3Int; no bespoke coordinate type- Every query is a pure function holding no state, so the player's overlays and the AI's reasoning share one calculation- SimpleBoard and SimpleUnitLocator are included as ready-made implementationsDependencies and compatibility:- Unity 2022.3 LTS or newer; no additional packages and no third-party plugins- Works with either input backend; the asset reads no input- 2D and 3D alike; the asset draws nothing- Works with or without Tilemap- Assembly definitions isolate runtime, samples, demo and demo editor codeIncluded:- Full C# source, 22 files- Four minimal samples: a unit implementation, a board implementation, one turn of a battle, and deployment- A showcase scene generated from one menu click, using no imported image, audio or font asset- A self-check menu running 140 checks and printing the result to the Console- Documentation in English and Japanese, including XML documentation comments and inspector tooltips in both languages----------------------------------------------------------------JAPANESE機能:・コスト順の移動探索(ダイクストラ法)。到達マス・各マスのコスト・任意のマスへの最短経路を返します・地形は ScriptableObject(進入コスト・通行不能・射線を遮るフラグ・表示色)・移動タイプも ScriptableObject(地形コスト無視/通行不能無視/地形ごとの上書き/味方通過/敵通過)・「通り抜け」と「そこで止まる」を別々に判定・最小射程つきの攻撃範囲(射程は地形もユニットも無視)・移動と射程を合成した危険域を 1 行で取得・目標から広げた距離マップによる接近判定。射程持ち向けに「この距離で止まる」指定つき・AI 用の撤退判定と、今のターンに攻撃できる相手の抽出・行動順 2 方式(陣営フェーズ制/イニシアチブ制)。行動順バー用の先読み、設定に無い陣営のフェーズ、倒れたユニットの除外に対応・陣形パターン(縦列・横列・楔形・輪形・方陣の作り置きつき)・配置計画(ゾーン指定・近い空きマスへの振り替え・未配置スロットの報告・複数部隊の列オフセット)・四角(斜めなし/あり)と列ずらし六角。隣接判定と距離計算の両方に対応拡張性:・ITacticsUnit / IBoard / IUnitLocator で既存の盤面とキャラクターをそのまま接続・セルは UnityEngine.Vector3Int。独自の座標型はありません・各問い合わせは状態を持たない純粋関数なので、プレイヤーの表示と AI の判断が同じ計算を共有します・すぐ使える SimpleBoard / SimpleUnitLocator を同梱依存と互換性:・Unity 2022.3 LTS 以降。追加パッケージ・外部プラグイン不要・どちらの入力バックエンドでも動作(入力を読みません)・2D / 3D 双方(描画を行いません)・Tilemap の有無を問いません・アセンブリ定義で本体・サンプル・デモ・デモ用エディタを分離収録:・フル C# ソース 22 ファイル・最小サンプル 4 本(ユニット実装/盤面実装/1 ターンの回し方/配置)・メニュー 1 クリックで生成される実演シーン(画像・音声・フォントの持ち込みゼロ)・140 項目の自己診断メニュー(結果は Console へ出力)・英語/日本語のドキュメント(XML コメント・インスペクタのツールチップも日英併記)AI (Claude by Anthropic) was utilized as an engineering assistant during the package creation process for the following tasks:1. Refactoring and modularizing C# code to ensure high quality, loose coupling, and framework-agnostic design.2. Generating documentation drafts, API reference guides, and English/Japanese README files.All system architecture, logic design, functional requirements, and final code reviews were explicitly defined and verified by human hands. The package has been thoroughly compiled and tested within Unity to guarantee stability and performance.




