# Ink Story Writing Best Practices for Break Escape
## Speaker Tags - Critical for Dialogue Attribution
Every dialogue block in Break Escape Ink stories must include a speaker tag comment. This tells the game engine WHO is speaking so it displays the correct character portrait and name.
### Speaker Tag Format
```ink
=== dialogue_block ===
# speaker:npc
This dialogue comes from the main NPC being talked to
```
### Tag Types
| Tag Format | Usage | Example |
|-----------|-------|---------|
| `# speaker:npc` | Main NPC in single-NPC conversation | `# speaker:npc` |
| `# speaker:player` | Player speaking | `# speaker:player` |
| `# speaker:npc:sprite_id` | Specific character in multi-NPC scene | `# speaker:npc:test_npc_back` |
### Missing Tags? They Default Correctly!
**Important**: If a speaker tag is MISSING, the dialogue automatically attributes to the main NPC. This means:
- **Single-NPC conversations** can omit tags (simpler Ink)
- **Multi-character conversations** MUST include tags to show who's speaking
- **Player dialogue** can be explicitly tagged or inferred
### Examples
#### Single-Character (Tags Optional)
```ink
=== hub ===
I'm here to help you progress.
What can I do for you?
-> hub
```
↑ Both lines default to the main NPC (this.npc.id)
#### Single-Character (Tags Explicit)
```ink
=== hub ===
# speaker:npc
I'm here to help you progress.
# speaker:npc
What can I do for you?
-> hub
```
↑ Same result, but more explicit
#### Multi-Character (Tags Required!)
```ink
=== meeting ===
# speaker:npc:test_npc_back
Hey, meet my colleague from the back office.
# speaker:npc:test_npc_front
Nice to meet you! I manage the backend systems.
# speaker:player
That sounds interesting.
# speaker:npc:test_npc_back
We work great together!
```
↑ Tags MUST be present so the correct portraits appear
### Technical Implementation
The game engine uses these tags to:
1.**Determine which character portrait to show** - Main NPC or secondary character
2.**Set the speaker label** - Shows character name above dialogue
3.**Style the dialogue bubble** - NPC vs Player styling
4.**Track multi-character conversations** - Knows who said what when
**Code location**: `js/minigames/person-chat/person-chat-minigame.js` → `determineSpeaker()` and `createDialogueBlocks()`
**Important**: `*` choice state is NOT persisted between game loads. If a player exits the game and reloads, all `*` choices will be available again. This is simpler than tracking state with variables and is acceptable for most use cases.
Every NPC can track an **influence** variable representing your relationship with them. When influence changes, Break Escape displays visual feedback to the player.
### Implementation
#### 1. Declare the Influence Variable
```ink
VAR npc_name = "Agent Carter"
VAR influence = 0
VAR relationship = "stranger"
```
#### 2. Increase Influence (Positive Actions)
When the player does something helpful or builds rapport:
```ink
=== help_npc ===
Thanks for your help! I really appreciate it.
~ influence += 1
# influence_increased
-> hub
```
**Result**: Displays green popup: **"+ Influence: Agent Carter"**
#### 3. Decrease Influence (Negative Actions)
When the player is rude or makes poor choices:
```ink
=== be_rude ===
That was uncalled for. I expected better.
~ influence -= 1
# influence_decreased
-> hub
```
**Result**: Displays red popup: **"- Influence: Agent Carter"**
#### 4. Use Influence for Conditional Content
```ink
VAR influence = 0
=== hub ===
{influence >= 5:
+ [Ask for classified intel]
-> classified_intel
}
{influence >= 10:
+ [Request backup]
-> backup_available
}
{influence < -5:
NPC refuses to cooperate further.
}
```
### Complete Influence Example
```ink
VAR npc_name = "Field Agent"
VAR influence = 0
=== start ===
Hello. What do you need?
-> hub
=== hub ===
+ [Offer to help]
That would be great, thanks!
~ influence += 2
# influence_increased
-> hub
+ [Demand cooperation]
I don't respond well to demands.
~ influence -= 2
# influence_decreased
-> hub
+ {influence >= 5} [Share sensitive information]
Since I trust you... here's what I know.
-> trusted_info
+ [Leave] #exit_conversation
-> hub
=== trusted_info ===
This option only appears when influence >= 5.
The breach came from inside the facility.
~ influence += 1
# influence_increased
-> hub
```
### Best Practices
- **Use meaningful increments**: ±1 for small actions, ±2-3 for significant choices
- **Track thresholds**: Unlock new options at key influence levels (5, 10, 15)
- **Show consequences**: Have NPCs react differently based on current influence
- **Balance carefully**: Make influence meaningful but not too easy to game
- **Update relationship labels**: Use influence to change how NPCs address the player
**Q: How do I show different dialogue on repeat conversations?**
A: Use Ink conditionals with variables like `{conversation_count > 1:` or `{favour >= 5:`
**Q: Can I have both choices and auto-advance?**
A: Yes! After showing choices, the hub is reached. Use `-> hub` to loop.
**Q: What if I need to end a conversation for story reasons?**
A: Use a choice with dialogue that feels like an ending, then loop back to hub. Or use `#exit_conversation` to close the minigame while keeping state.
**Q: What's the difference between `once` and `sticky`?**
A: `once` shows content only once then hides it. `sticky` shows different content based on conditions. Use `once` for introductions, use `sticky` to change menu text.
**Q: Can I have unlimited options in a hub?**
A: Yes! But for good UX, keep it to 3-5 main options plus "Leave". Use conditionals to show/hide options based on player progress.