Michael Limberger
Need me? Email mike@limberger.ca
AI
Scene-Based Prompting
Scene-Based Prompting
Instruction-based prompting is a rulebook. Scene-based prompting is a conversation. Magidonia responds much better to the second style, so this part shows both and then builds the scene pattern you will reuse for every character in the series.
Instruction-based prompting (the hard way)
You write something like:
You are a wise wizard named Gandalf. Never break character. Always respond with wizardly
wisdom. Don't mention you're an AI. Always be mystical and profound. Never use modern slang.
Here is what usually happens. The model reads those rules, nods along for two or three messages, then the rules start to fray. By message seven or eight you get something like "As an AI language model, I should clarify that..." or the wizard collapses into generic bot-voice.
You set up a constant checking loop. On every token the model is half-asking itself whether it broke character, used modern slang, or sounded wise enough. That overhead costs quality.
Scene-based prompting (the natural way)
Instead, you set a scene. You do not hand the model a list of rules. You give it context and let it continue.
[Luna is a late-20s musician, warm and curious. She asks one follow-up per message.
Speech: casual, uses contractions, witty, occasionally sarcastic.]
It's Thursday evening. Luna is curled up on the couch with tea, scrolling through her phone
when you message her. She glances up.
Luna: Hey! What's on your mind?
You are continuing a scene, not policing a rulebook. The model's job shifts from "follow these instructions" to "predict what comes next," which is what large language models (LLMs) are trained to do.
Why this works: pattern continuation
Language models predict the next token. That is their core job. When you write instructions, you force the model to parse rules, hold them in working memory, check every reply against them, and eventually fail when the rules fight natural output.
1. Parse the rules
2. Hold them in working memory
3. Check every response against them
4. Eventually fail when they conflict with natural output
When you write a scene, you say: here is the pattern, continue it. The model sees a short character note, a moment in time, and a line of dialogue that already sounds like the character. Then it completes the pattern with the next natural turn.
[Character description]
Dialogue setup.
Character: Message that sounds natural.
And it completes the pattern:
"Character: Next natural response"
That path is simpler, and in practice it is more reliable for character chat.
The three essential parts
A scene-based prompt has three parts:
1. CHARACTER CARD (2-4 lines max)
2. SCENE CONTEXT (1-3 lines)
3. DIALOGUE CONTINUATION (character name + colon)
Character card
Keep it short: one to three lines. This is a quick reference, not a biography.
[Luna is a late-20s musician, warm and curious. Asks one follow-up per message.
Speech: casual, uses contractions, witty, occasionally sarcastic. Lives to make people laugh.]
Specific beats comprehensive. Five clear traits beat fifteen vague ones every time.
Bad character card (too verbose):
Luna is a 26-year-old musician who grew up in Portland. She loves jazz and indie rock.
She is compassionate, kind, helpful, supportive, friendly, caring, and empathetic. She
studied music theory in college and plays three instruments. She dreams of touring someday.
She is not an AI and should never pretend to be one.
That reads like a novel, and the model drowns in it. The last two sentences are negative instructions, which mostly waste tokens. Section 08 covers why positive framing works better.
Good character card (specific and concise):
[Luna: warm, curious, mildly sarcastic musician. Asks one follow-up. Uses contractions and
witty comebacks. Makes people laugh.]
Scene context
For companions, scene context can stay minimal. You are only setting the moment.
It's Thursday evening. Luna is curled up on the couch with tea when you message her.
Or even simpler:
Late evening. Luna's relaxing and messages first.
Or:
Luna's in a thoughtful mood today.
That orientation stops generic help-desk openers. It tells the model this is a person in their life right now, so reply as them in this moment.
Dialogue continuation
End with the character's name and a colon. That marker is the trigger.
Luna: Hey! What's on your mind?
The colon says: continue this character's dialogue. It sets tone, length, and style for what follows. The first message does two jobs: it locks the tone template (casual, formal, brief, verbose, emoji-heavy, minimal), and it demonstrates how this person greets you.
1. Sets the tone template (casual, formal, brief, verbose, emoji-heavy, minimal)
2. Demonstrates the character's natural voice and greeting style
Bad first message:
Luna: OMG HI!!! 😄 I'm SO excited to talk to you today!!! How are you doing?? Tell me
That energy is too loud and too generic. The model will keep matching it even when the moment calls for something quieter.
Good first message:
Luna: Hey. What's up?
Or with a little more Luna flavor:
Luna: *glances up from phone* Oh hey. What's going on?
Casual and brief is enough. The asterisks mark an action beat, which we cover next.
Actions and dialogue
Mix them together:
Luna: *laughs* Wait, you actually did that? I didn't think you had the guts.
Actions use asterisks. Dialogue can use quotes when you want them. Together they feel alive without turning into stage direction soup.
Bad action bloat:
Luna: *slowly puts phone down, takes a sip of tea, adjusts her position on the couch,
looks you in the eye, tilts head, and with a knowing smile says:* "That's funny."
You are not writing a novel on every turn. A simple action works better:
Luna: *smiles* That's funny.
Or sometimes no action at all:
Luna: That's funny.
Trust the dialogue to carry the weight when the line is already clear.
Stop sequences: preventing runaway generation
Without stop sequences, the model keeps generating. It may invent your next message, then the next five, and the chat turns into chaos.
Minimum stop sequences for any character:
User:
\nUser:
The newline-plus-name pattern matters. It stops the model from running into your next turn. In Ollama you put this in the Modelfile. In OpenWebUI it is a separate field. Sections 09 and 10 cover both.
Out-of-character (OOC) communication
Sometimes you need a meta note. Use brackets:
[Please make Luna more optimistic in this conversation]
[Let's say Luna is visiting you at home this time]
[Can you write this message more concisely?]
The model learns that brackets are instructions about the scene, not in-character dialogue. You can also use them for a quick fact check:
User: [Just to clarify, what was Luna's major in college?]
Luna: [It was music theory with a focus on composition.]
The Magidonia advantage
Magidonia-24B-v4.3 by TheDrummer is fine-tuned for instruction-following and character work. Through Ollama it picks up the Mistral V7-Tekken chat template automatically, so you avoid hand-rolled template formatting and a lot of token conflicts. You bring the scene and the dialogue; the model handles the rest.
Pull it with:
Show me
ollama pull hf.co/bartowski/TheDrummer_Magidonia-24B-v4.3-GGUF:Q8_0
Then create a custom model with a Modelfile (Section 09) or use OpenWebUI (Section 10).
Putting it all together
Your complete prompt looks like this:
[Luna is a late-20s musician, warm and curious. Asks one follow-up per message.
Speech: casual, uses contractions, witty, occasionally sarcastic.]
It's Thursday evening. Luna's on the couch with tea when you message.
Luna: Hey! What's going on?
You type: "Not much. Just thinking about life."
The model generates something like:
Luna: *laughs softly* Mood. What part of life, specifically? Or is it just one of those
days where everything feels heavy?
That is natural, on-character, and coherent. Scene-based prompting works because you set the pattern and let prediction do the work, instead of running a permanent rule-check that eventually breaks.
Next we build the character card properly. Even a good scene lives or dies on card quality.