TH185: character names on the market selection screen, from world.txt
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 27
- Forks
- 15
- Avg merge
- 15h 24m
- Merged PRs (30d)
- 1
Description
The one remaining problem is that some character names will always appear greyed out. To understand why this happens, and how one might fix it, we need to understand how the whole system works to begin with:
When the game loads the character names from world.txt, it will add whitespace characters before and after the name. The game will also create text strings made up only of whitespace that are the same length as the character names (including the whitespace).
The game will call draw_ctext and, and use a format string of %s%s%s. The game calls draw_ctext 3 times with parameters as pictured in this graphic. Note that "Real character name" includes the whitespace, in all graphics

Every row in this crudely drawn graphic represents a set of parameters for a draw_ctext call, every column represents an indivdual parameter for the draw_ctext call in question. Every call to draw_ctext will draw to a different surface (ANM VM), with all the surfaces being overlayed ontop of eachother. The reason ZUN does this is because ZUN's text rendering code doesn't allow using different colors with only one draw_?text call
The exact same code is also reused for the 2 character names right below, except this time the calls look like this:

And for the tutorial stage, the same code is used once again, but with these parameters:

The problem mentioned at the start of this issue occurs because thcrap will replace both the real character names and the whitespace with a new string, causing a grey character name to overlay the yellow one. To solve this, thcrap would need to replace whitespace strings with strings that use the layout engine to create the exact right amount of whitespace for the translation string, or that entire code would have to be completely rewritten.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how names from world.txt reach the draw_ctext call sites and how the ANM VM surfaces are overlaid. Compare the real-name and whitespace strings for the character and tutorial entries; done means translated names render in the intended color without a grey whitespace overlay.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- game-dev, localization
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100