Card-Forge / Card-Forge/forge

Malformed JSON in dialog/defeatDialog properties across 15 .tmx map files (32 objects)

Open
#11,670 0 comments 0 reactions 0 assignees View on GitHub
Adventure
Dominant language
Java
Stars
2.7k
Forks
1.1k
Avg merge
1d 1h
Merged PRs (30d)
158

Description

While building tooling to translate Adventure Mode's NPC/enemy dialog, I ran a JSON parser over every `dialog`/`defeatDialog` property embedded in the `.tmx` files under `forge-gui/res/adventure/common/maps/map`. 32 objects across 15 files contain malformed JSON — missing commas between array elements, mismatched brackets, or corrupted `options` blocks — that fails to parse as valid JSON.

These are presumably pre-existing bugs in the English source data, unrelated to any i18n work: `JSONStringLoader` (the Java code that parses this at runtime) would fail the same way on these objects and fall back to the generic error dialog, so these NPCs/enemies likely already show broken dialog in-game today, regardless of language.

**Two representative examples:**

`demontower/portal_2.tmx`, object 83 — the `options` array is missing its opening structure entirely:
```json
[
{
"text":"The inscription reads: Congratulations Adventurer! Just for finding this place you have won a prize!",
"options":Happily walk toward your prize" }
]
}
]
```

`main_story/temple_of_gideon/town.tmx`, object 224 — missing commas between array elements and an unclosed brace:
```json
[
{
"text":"You pry the key away from the mayor's cold, dead (and dead again) hands. Now that you have it, there's not much between you and Liliana.",
"options":[
{"name":"(continue)"
}
{"action":[{"deleteMapObject": 278}, {"deleteMapObject": -1}]}
]
}
]
```

**Full list (file — object id — parser error):**

```
demontower/portal_2.tmx — object 83 — Expecting value: line 4 column 15
magetower/magetower_14_horrors.tmx — object 103 — Expecting ',' delimiter: line 9 column 4
magetower/magetower_14_horrors.tmx — object 104 — Expecting ',' delimiter: line 9 column 4
magetower/wastetown..tmx — object 103 — Expecting ',' delimiter: line 9 column 4
magetower/wastetown..tmx — object 104 — Expecting ',' delimiter: line 9 column 4
main_story/temple_of_gideon/graveyard.tmx — object 254 — Expecting ',' delimiter: line 8 column 4
main_story/temple_of_gideon/graveyard.tmx — object 268 — Expecting ',' delimiter: line 11 column 10
main_story/temple_of_gideon/keep.tmx — object 224 — Expecting ',' delimiter: line 19 column 4
main_story/temple_of_gideon/steppe.tmx — object 240 — Expecting ',' delimiter: line 18 column 2
main_story/temple_of_gideon/town.tmx — object 224 — Expecting ',' delimiter: line 7 column 2 (and a second error at line 9 column 4)
main_story/temple_of_liliana/bog.tmx — object 240 — Expecting ',' delimiter: line 18 column 2
main_story/temple_of_liliana/forest.tmx — object 187 — Expecting ',' delimiter: line 6 column 5
main_story/temple_of_liliana/graveyard.tmx — object 254 — Expecting ',' delimiter: line 8 column 4
main_story/temple_of_liliana/graveyard.tmx — object 268 — Expecting ',' delimiter: line 11 column 10
main_story/temple_of_liliana/keep.tmx — object 224 — Expecting ',' delimiter: line 19 column 4
main_story/templeofchandra.tmx — object 7 — Expecting ',' delimiter: line 9 column 4
main_story/templeofchandra.tmx — object 8 — Expecting ',' delimiter: line 9 column 4
main_story/templeofchandra.tmx — object 9 — Expecting ',' delimiter: line 8 column 4
main_story/templeofchandra.tmx — object 15 — Expecting ',' delimiter: line 8 column 4
main_story/templeofchandra.tmx — object 19 — Expecting ',' delimiter: line 9 column 4
main_story/templeofchandra.tmx — object 170 — Expecting ',' delimiter: line 19 column 4
main_story_defend/waste_town_abandoned.tmx — object 75 — Expecting ',' delimiter: line 4 column 4
main_story_defend/waste_town_abandoned.tmx — object 95 — Expecting ',' delimiter: line 4 column 4
main_story_defend/waste_town_abandoned.tmx — object 96 — Expecting ',' delimiter: line 4 column 4
main_story_explore/dig_site_1.tmx — object 86 — Expecting property name enclosed in double quotes: line 7 column 2
main_story_explore/dig_site_1.tmx — object 102 — Expecting ',' delimiter: line 10 column 4
main_story_explore/dig_site_1.tmx — object 103 — Expecting ',' delimiter: line 10 column 4
main_story_explore/frostbitten_cavern_1.tmx — object 24 — Expecting ',' delimiter: line 7 column 17
monastery/unhallowed_abbey_2F.tmx — object 109 — Expecting ',' delimiter: line 9 column 4
monastery/unhallowed_abbey_2F.tmx — object 110 — Expecting ',' delimiter: line 9 column 4
monastery/unhallowed_abbey_2F.tmx — object 111 — Expecting ',' delimiter: line 9 column 4
monastery/unhallowed_abbey_2F.tmx — object 116 — Expecting ',' delimiter: line 6 column 2
naktamun/naktamun.tmx — object 43 — Expecting ',' delimiter: line 13 column 5
```
Here is the patch
[fix-malformed-tmx-dialog-json.patch](https://github.com/user-attachments/files/31355372/fix-malformed-tmx-dialog-json.patch)

Assited by Claude Fable

Contributor guide

Open the contributing guide

Research direction

Start with the 15 .tmx files and 32 object IDs listed in the issue, using the supplied patch as the proposed change. Check each dialog or defeatDialog property with the JSONStringLoader or equivalent parser; done means all listed properties parse as valid JSON without the reported errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.