View Format: Multi-Page Single Page

Simple Enemy Forge

Generate Complete Enemy Databases, Squads, Spawn Tables, and More in Minutes.

Troubleshooting

Solutions for common issues you may encounter when using Simple Enemy Forge.

Generation Issues

Database asset not created after generation

Simple Enemy Forge uses a two-phase generation process. The first phase writes C# scripts, triggers AssetDatabase.Refresh(), and waits for Unity's domain reload. The second phase (triggered by [InitializeOnLoad]) creates the asset from a temporary JSON file.

  • Wait for compilation — After clicking Generate, Unity's progress bar should show "Compiling Scripts". Wait for it to finish completely.
  • Check the Console — Look for errors with the [Simple Enemy Forge] prefix. If the first phase fails, the second phase never runs.
  • Check SessionState — The second phase uses SessionState flags (e.g., SimpleEnemyForge_WaitingForCompilation). If Unity crashes during compilation, the flag may be left in a stale state. Restarting Unity clears SessionState.
  • Check the output folder — Verify the target folder path in Step 1 (Setup) exists and is writable.

Compilation errors after generation

  • Duplicate type names — If you generate two databases with the same Class Prefix, you'll get duplicate type errors. Use unique prefixes for each database.
  • Missing namespace — Generated code uses using SimpleEnemyForge;. Make sure the Simple Enemy Forge Runtime assembly definition is accessible from your generated code's location.
  • Regenerate — If files got corrupted, delete the generated {Prefix}Type.cs, {Prefix}Database.cs, and {Prefix}DatabaseEditor.cs files, then generate again from the wizard.

Custom editor not showing in Inspector

  • Check the Editor file — Ensure {Prefix}DatabaseEditor.cs exists in the same folder as the database asset (or in an Editor folder).
  • Reimport — Right-click the editor script and select Reimport to force Unity to pick up the [CustomEditor] attribute.
  • Lock/unlock the Inspector — Sometimes toggling the Inspector's lock button forces a refresh of the custom editor.

Schema Import Issues

Import says "0 items imported"

  • Check JSON format — The import expects a specific JSON structure with top-level arrays matching the forge type (e.g., "enemies" for Enemy Forge, "squads" for Squad Forge). AI-generated JSON sometimes uses different field names.
  • Validate required fields — Every item needs at minimum a code and name field. Items missing these are skipped.
  • Check the result popup — The import shows a popup with imported count, skipped count, and any errors/warnings. Read the messages for specific issues.

AI-generated JSON won't import

  • Use Full JSON export — When exporting a schema for AI, use "Full JSON" mode. This includes the complete JSON format example with field names and types that the AI should replicate exactly.
  • Check the definitions section — The JSON format example includes a "definitions" section that tells the AI which property names to use. If definitions are missing, the AI may guess wrong field names (e.g., "name" instead of "label" for categories, "options" instead of "entries").
  • Strip markdown — If the AI wrapped the JSON in a code block (```json ... ```), remove the markdown markers before importing.
  • Validate JSON syntax — Use a JSON validator to check for syntax errors (missing commas, unmatched brackets, trailing commas).

Values not mapping correctly

  • Category values — Categories use integer indices (0-based) into the entry list, not the entry strings themselves. If the AI provides string values, they won't map. The schema instructions tell the AI to use indices.
  • Flag values — Flags must be true/false, not 0/1 or "yes"/"no".
  • 3-choice dialog — When importing, a dialog asks whether to Replace All, Cancel, or Keep Existing (for definitions) / Add to Existing (for data). Choose the appropriate option for your use case.

Wizard Issues

Can't proceed to next step

  • Check validation — Each step validates required fields before allowing navigation. Common blockers: empty Class Prefix, duplicate codes, no output folder selected.
  • Class Prefix rules — Must start with a letter, contain only letters and digits, and be a valid C# identifier. No spaces, underscores, or special characters.

Linked database shows 0 enemies

  • Check interface — Dependent wizards (Squad, Spawn, Scaling, Wave) require an enemy database that implements ISimpleEnemyDataSource. If you manually created a ScriptableObject without implementing the interface, it won't be detected.
  • Regenerate enemy DB first — The enemy database must be fully generated (including the .asset file) before linking it to dependent wizards.
  • Multi-DB merging — You can assign multiple enemy databases. Duplicate codes are resolved with first-DB-wins: the first database's version takes priority.

Data lost after domain reload

  • This is expected — Wizard data is stored in memory (EditorWindow state) and survives most domain reloads via Unity's serialization. However, some complex data structures may not survive. Always generate before closing Unity.
  • Use templates — If you frequently lose configuration, save your setup as a template file via the schema export feature. You can re-import it later.

Custom Editor Issues

Inspector shows "Element 0", "Element 1" instead of custom editor

  • Missing editor file — The generated {Prefix}DatabaseEditor.cs must be in an Editor folder or an Editor assembly. If it was accidentally deleted, regenerate from the wizard.
  • Assembly mismatch — If you moved the database script outside the Simple Enemy Forge assembly, the generated editor may not find the type. Keep generated files together.

Editor performance slow with many entries

  • Use pagination — The generated editor includes pagination. Toggle off "Show All" and set a reasonable page size (20-50 items). Pagination is also available in wizard builder steps.
  • Collapse foldouts — Keep foldouts collapsed for entries you're not actively editing. Expanded entries render all property fields, which adds up.

Browse button not showing enemy/squad references

  • Link databases — The generated editor's browse functionality depends on finding the referenced database assets. Make sure the databases are in the same project and haven't been renamed or moved.

SAF Integration

For SAF-specific troubleshooting (detection issues, modifier references, safe round-trip), see the dedicated SAF Integration Troubleshooting section.

SIF Integration

For SIF-specific troubleshooting (loot table linking, detection lifecycle, safe round-trip), see the dedicated SIF Integration Troubleshooting section.

General Tips

Check the Console

All Simple Enemy Forge log messages are prefixed with [Simple Enemy Forge]. Filter the Console by this prefix to see only SEF-related messages, warnings, and errors. Generation progress, import results, and detection events are all logged here.

Export Before Experimenting

Before making major changes to your property definitions or trying a new template, export your current schema as Full JSON. This gives you a complete backup that can be re-imported if something goes wrong. The JSON file contains all definitions and data.

Generate Incrementally

Start with Enemy Forge alone. Once your enemy database is working, add Squad Forge, then Spawn Forge, and so on. This makes it easier to identify which forge is causing an issue. Each forge can be generated independently.

Use Templates

SEF includes 6 genre templates (RPG, Soulslike, Survival, Tower Defense, Sci-Fi, RTS) with pre-configured property definitions. Start with a template and customize from there rather than building from scratch. Templates populate all 7 forges at once.