I WAS A KING
Night Court, Foreign Armies, Linux Stability, and GUI Parity
Since V30.119, IWAK has expanded from a court-decision game into a royal governance simulation featuring a day-and-night ruling cycle, policy fatigue, court collapse, foreign invasion, multiple endings, and Steam/Linux launch integrity.
This cumulative patch note consolidates the major changes from **V30.119 Night Action Mode** through V31.10 Linux GUI Parity Update.
1. Night Action Mode
Every five turns, the King briefly steps away from daytime affairs and enters the night phase.
Night Action Choices
A. Open a book and review the affairs of state
B. Privately summon the Chief Royal Secretary
C. Visit the King's old teacher
D. Train in martial discipline
E. Go incognito and listen to the night market
F. Take a late royal meal and recover
G. Spend time with the Crown Prince
Each action includes a dedicated first-person cutscene, scene token, night BGM, screen transition, and changes to state indicators. Repeating the same action accumulates a separate Night Habit Fatigue penalty.
After the result of a night action is displayed, the player must press Enter to proceed to the next day.
Continue your reign?
Press Enter to greet the next day.
If a night action causes a major indicator such as the Treasury, Public Support, or councillor trust to collapse, the Admonition check is performed immediately rather than waiting for the next day.
---
2. Foreign Invasion System
When diplomatic relations with a neighboring state fall below a certain threshold, that state begins mobilizing its army.
| Difficulty | Mobilization Threshold |
| Easy | Relation 0 or lower |
| Normal | Relation 1 or lower |
| Hard | Relation 2 or lower |
Once mobilization begins, the player receives a two-turn warning period.
Foreign army arrives in 2 turns
Foreign army arrives in 1 turn
Foreign troops have appeared at the border
If relations recover before the army arrives, the invasion preparations can be cancelled.
Emergency Invasion Agenda
A. Dispatch troops to defend the frontier
B. Send tribute and reparations to turn the army back
C. Block the strategic passes and prepare for a prolonged defense
D. Send one final envoy to negotiate a withdrawal
E. Entrust the border response to the Chief State Councillor
Ignoring the invasion agenda causes border raids every turn, directly damaging the Treasury, Public Support, and Royal Authority.
The Diplomacy tab is now connected to live neighboring-state data.
- Current diplomatic relations
- Trade trust
- Diplomatic tension
- Estimated turn of foreign army arrival
- Whether the army has reached the border
- Latest diplomatic report
3. Unified Admonition System
Several previously separate collapse counters have been unified into the **Admonition** system.
| Condition | Result |
| Treasury reaches 0 | Admonition +1, Royal Authority -1 |
| Left Councillor trust reaches 0 | Admonition +1 |
| Right Councillor trust reaches 0 | Admonition +1 |
| Public Support falls below 0 | Admonition +1 |
| Councillor resignation or court collapse | Admonition +1 depending on the situation |
| Three Admonitions | Immediate deposition and game over |
The same unresolved condition does not add another Admonition every turn. If the condition recovers and later collapses again, it is treated as a new event.
Treasury reaches 0 for the first time
→ Admonition +1 / Royal Authority -1
Treasury remains at 0
→ No additional Admonition
Treasury recovers, then returns to 0
→ Admonition +1 / Royal Authority -1
4. Policy Fatigue
Repeating the same policy direction rapidly reduces the absolute effect of both rewards and penalties.
| Consecutive Repetitions | Effect Multiplier |
| 1–2 | ×1.0000 |
| 3 | ×0.3679 |
| 4 | ×0.1353 |
| 5 | ×0.0498 |
streak 1–2:
multiplier = 1.0
streak >= 3:
multiplier = 1 / e^(streak - 2)
Daytime Policy Fatigue and Night Habit Fatigue are calculated independently.
5. Dramatic Endings and Final Ledger
Different endings are shown depending on the collapse of Royal Authority, exhaustion of the Treasury, collapse of Public Support, deposition through accumulated Admonitions, runaway Rumor, invasion, or successful completion of the reign.
────────────────────────────────────────
[REIGN ENDED]
Reason the reign ended
────────────────────────────────────────
[ENDING] Ending Title
Narrative description of the ending
────────────────────────────────────────
[CAUSE OF DEATH]
Final cause of collapse
────────────────────────────────────────
| Element | Display Color |
| ENDING / REIGN ENDED / CAUSE OF DEATH | Pure white |
| Ending description and reason for termination | Pale gold |
| Divider lines | Dark gold |
In English mode, internal Korean game-over reasons are converted into English before being displayed.
Achievements unlocked during the current run are shown immediately above the Final Ledger.
[Achievements Unlocked] I Am the State · Sage King · Literati Purge
[Final Ledger]
...
6. English Mode and Councillor Dialogue Improvements
The remaining output paths where Korean could appear in English mode have been cleaned up.
- Follow-up agenda titles, descriptions, and choices
- Foreign invasion warnings and emergency agendas
- Unknown-input messages
- Local model status messages
- Indicator-change notices
- Reign-ending and ending text
- Final Ledger and achievements
- Help and command results
English choices that sounded like passive report titles have been rewritten as direct royal commands.
Emergency Stores Sent for This Situation
→ Send Emergency Stores
A Statute Written Around This Matter
→ Draft a Governing Statute
Royal Auditors Summoned Over This Report
→ Summon Royal Auditors
LLM Councillor Dialogue Restrictions
The prompt and post-processing stages now restrict the following kinds of statements:
- Meta-comments referring to prompts, models, or rules
- Sentences explaining the model's own reasoning process or response structure
- Direct emotional expressions
- General statements that merely repeat information already visible on screen
- Explanations of facts the player already knows
The following sentence is also explicitly blocked:
> The wiser question is how much disorder the court can endure while the decree takes root.
Square brackets are removed from the Scribe's direct speech.
7. Court Output and GUI Improvements
Removed Repetitive System Labels
Result
Alignment
Record
The player now sees only the actual decree, its consequences, Admonitions, and events.
Text Readability
- Councillor dialogue is displayed 2pt smaller than the default text
- Agenda descriptions and choice descriptions are displayed 2pt smaller
- The reduced size is preserved across wrapped lines
- Option titles use pure white: `#FFFFFF`
- Ending titles use white, while descriptions use pale gold
Panels and Buttons
- Removed the `Court Trust / Council Trust` heading
- Reorganized the Left and Right Councillor trust rows
- Removed the black seam between the trust panel and state panel
- Strengthened the glass style of the right-side settings panel
- Adjusted the position and spacing of the lower control area
Font-setting buttons use a dark brown interior with gold text and a gold border in their default state. While pressed, the interior fills with gold and the text turns black.
Input Welcome Text
Welcome to the palace of Joseon, stranger.
8. Scrolling, Input, and Decision Gap
Scroll Optimization
- Coalesced continuous mouse-wheel events at approximately 32 ms intervals
- Throttled rail-drag calculations
- Cached wrapping and height calculations for completed log output
- Recalculate layout only when the window size or font size changes
- Added page-style up and down buttons
- Automatically move to the latest output after entering an agenda choice or command
Decision Gap
| Item | Setting |
| Location | Pause control in the right-side settings area |
| Range | 0.0–4.0 seconds |
| Step | 0.5 seconds |
| Status Message | The councillors are weighing the matter... |
Blank Enter remains blocked during normal agendas and is allowed only at explicit gates such as beginning a new game or continuing after the night phase.
9. Retire Button and Demo CTA
The former Close button has been renamed:
Retire
Pressing the button or closing the window during an active reign triggers the following Steam achievement:
YOU_RESIGNED
Restarting does not count as resignation.
At the end of the demo version, the game may display a background zoom, a Steam Store CTA, and store navigation through Enter or mouse click. This feature is disabled in the full version.
Linux Stability Patches
10. V31.5 — Linux Payload Entry Contract
The Linux launch path no longer attempts to find the Windows executable `iwak.exe`.
1. iwak.py
2. payload/iwak.py
3. Linux-native `./iwak` fallback
The following files are not used as Linux launch candidates:
iwak.exe
IWAK.exe
iwak.pkg
The launch chain is:
Steam
→ IWAKLinuxGuiLauncher
→ IWAKLinuxRoyalGui
→ iwak.py / Linux-native payload
11. V31.6 — Linux Launcher Permissions and Self-Test
The uploaded `IWAKLinuxGuiLauncher` was confirmed to be an ELF64 Linux binary, but its executable permission had remained at `0644`.
The main executables are now installed with `0755` permissions.
IWAKLinuxGuiLauncher
IWAKLinuxRoyalGui
iwak
Additional validation includes:
- ELF 64-bit x86-64 validation
- Blocking accidental Windows PE files
- Executable permission 0755 validation
- Detection of `noexec` mounts
- Verification that external filesystems preserve executable permissions
- Launcher `--self-test`
The self-test checks the presence and launch conditions of the Launcher, Royal GUI, payload, `iwak.py`, `iwak_UI120_3.py`, `loading_messages.csv`, `config/`, `art/`, and `libsteam_api.so`.
12. V31.7 — Native Operating System Cursor Restored
The experimental Dark Souls-style lantern mouse pointer has been removed.
On some systems, the native cursor could become completely invisible if it was hidden before the lantern overlay was successfully created. The game now uses the operating system's standard mouse pointer during both day and night scenes.
13. V31.8 — Steam Fail-Closed Gate and Linux Korean IME Stability
## Steam Fail-Closed Gate
The main Linux entry point remains `IWAKLinuxGuiLauncher`.
Steam
→ IWAKLinuxGuiLauncher
→ SteamAPI.Init
→ App ID verification
→ IWAKLinuxRoyalGui
SteamAPI.Init failure
→ Exit code 11
Steam App ID mismatch
→ Exit code 12
The Royal GUI is launched only after Steam authentication succeeds.
Linux Korean Output and UTF-8 Handling
We fixed an issue where conflicting `LC_ALL`, `LANG`, `LC_CTYPE`, and `XMODIFIERS` values in the Steam launch environment could corrupt or suppress Korean text.
- Preserve valid UTF-8 locales
- Correct only invalid or non-UTF-8 locales
- Correct `LC_ALL` when it overrides other locale values
- Use `C.UTF-8` when no valid UTF-8 locale is available
ibus / Fcitx / Fcitx5 Detection
ibus session → XMODIFIERS=@im=ibus
Fcitx/Fcitx5 → XMODIFIERS=@im=fcitx
Existing valid values are preserved. If the input method cannot be identified, the game does not force one arbitrarily.
First-Character IME Composition Fix
The startup welcome text is no longer inserted as actual text inside the Tk Entry widget. This prevents the first consonant or syllable from disappearing, preedit cancellation, and the first input behaving as though the keyboard were still in English mode.
Automated Korean Input/Output Test
The packaged Linux GUI is given the following string for a UTF-8 round-trip test:
한글 입출력 왕명
If stdin and stdout do not match, the Linux depot build is not treated as complete.
Linux Build Script Stability
`uv` bootstrap logs are now sent to stderr, while stdout returns only the actual executable path.
14. V31.9 — Linux Image Rendering and Windows GUI Parity
We fixed an issue where backgrounds and cutscene images could fail to appear on some Linux systems, leaving only a black screen.
Previous behavior:
Pillow import succeeded
→ Try ImageTk.PhotoImage
→ ImageTk failed
→ Return False
→ Native Tk fallback never ran
New behavior:
1. Decode and resize the PNG with Pillow
2. Try `ImageTk.PhotoImage(..., master=root)`
3. On failure, fall back to `tk.PhotoImage(..., master=root)`
4. Use the default background only if both methods fail
Additional improvements:
- Explicit Tk root for every ImageTk object
- Retain background image references
- Stabilized glass panel images
- Added scroll rail image fallback
- Added Scene PNG decode checks
- Added Xvfb-based image-rendering self-tests
- Removed development-machine absolute paths from the Linux spec
### Windows GUI Parity
Areas kept consistent with the Windows version:
- Main window size and panel coordinates
- Backgrounds and cutscenes
- Trust and state dashboards
- Diplomacy tab
- Night action screen
- Ending screen
- Log Canvas
- Input field and scroll UI
- Glass panel
- Lower control buttons
- Text size and wrapping
- Button colors and pressed states
Linux-specific areas remain limited to UTF-8 locale handling, ibus/Fcitx integration, the Linux payload resolver, ELF and executable-permission checks, Linux logging, and self-tests.
15. V31.10 — Linux DPI Scaling Parity
We fixed an issue where the Linux GUI could appear nearly twice as large under XWayland or high-DPI environments.
When Linux Tk automatically adopted a 144–192 DPI environment, fixed Canvas coordinates remained unchanged while fonts and native widgets could become 1.5–2 times larger.
V31.10 normalizes the Linux GUI to the same 96 DPI baseline as the Windows version.
Reference window size: 1180 × 760
Tk scaling: approximately 1.3333
Reference DPI: 96
Example diagnostic log:
[IWAK LinuxRoyalGui] Tk scaling:
native=2.6667,
applied=1.3333,
effective_dpi=96.0
To preserve the system Tk scaling:
IWAK_PRESERVE_SYSTEM_TK_SCALING=1
To specify a custom scaling value:
IWAK_TK_SCALING=1.5
The full and demo build pipelines now include a self-test that simulates a 2× DPI environment and verifies that it is normalized back to the 96 DPI baseline.
16. Detailed Version History
| Version | Major Changes |
| V30.119 | Night Action Mode, A–G actions, Night Habit Fatigue, night phase every five turns |
| V30.120 | Six night cutscenes, scene token API, night entry and exit transitions |
| V30.121 | Three night BGM tracks, adjusted crisis-background conditions, more varied background exposure |
| V30.122 | Removed the five-second decree input limit, moved countdown to immediately before a new game |
| V30.123 | Expanded ending narratives, adjusted Royal Authority penalty at Treasury 0 |
| V30.124 | Renamed Close to Retire, added `YOU_RESIGNED` achievement |
| V30.125–128 | Improved English follow-up agendas and input, fixed output order, balanced fonts, removed Scribe background |
| V30.129–131 | Refined right-side panel, trust layout, Enter gate, removed Council Trust title |
| V30.132–134 | Stabilized night backgrounds, transitions, and input lock; added Decision Gap, page scrolling, and demo CTA |
| V30.135–137 | Unified Admonitions, restored Treasury 0 double penalty, added scroll cache, Final Ledger, and i18n cleanup |
| V31.0 | Foreign invasion, two-turn countdown, forced border crisis, live Diplomacy tab data |
| V31.1 | Command-style English choices, font buttons, Joseon welcome message |
| V31.2 | LLM dialogue restrictions, Scribe bracket filter, removed repeated labels, immediate night Admonition checks |
| V31.3 | Stabilized UI120.3 import and startup bootstrap |
| V31.4 | Fixed English unknown-input and ending reasons, ending colors and separators, general GUI cleanup |
| V31.5 | Linux payload entry contract, blocked `.exe` lookup |
| V31.6 | Launcher 0755 permissions, ELF validation, noexec detection, self-test |
| V31.7 | Removed lantern cursor, restored native operating system cursor |
| V31.8 | Steam fail-closed gate, Linux Korean IME and UTF-8 stability, build-path stabilization |
| V31.9 | Linux ImageTk fallback, PNG validation, Windows GUI parity |
| V31.10 | Linux 96 DPI normalization, fixed 2× enlargement issue |
17. Current Linux Launch Conditions
Steam
→ IWAKLinuxGuiLauncher
→ Steam authentication and App ID verification
→ Integrity conditions pass
→ IWAKLinuxRoyalGui
→ iwak.py / Linux-native payload
SteamAPI.Init failure
→ Abort launch
App ID mismatch
→ Abort launch
Missing critical executable
→ Abort launch
ELF / permission / self-test failure
→ Depot build fails
UTF-8 / image / DPI self-test failure
→ Depot build fails
---
18. Final Summary
Rule the court by day and govern yourself by night. Neglect diplomacy, and foreign armies will reach the border. After three Admonitions, even the throne itself will disappear. On Linux, Korean text, images, DPI scaling, and the Steam launch path have been rebuilt to behave as closely as possible to the Windows version.
IWAK's LLM assists with input interpretation and councillor dialogue, but the consequences of each choice, indicator changes, achievements, and endings are still determined by the game's rules.
