How to create your own text-based game?

Creating interactive text-based games is easy if you have a good imagination and The Dark Eye basics rulebook. You don’t have to know HTML or any programming languages. The easiest way to publish your adventure on this website is simply typing it into a text file (PDF, DOC, RTF, TXT, etc.) and uploading it to our games section. If your adventure is compatible with the 5th edition of The Dark Eye rules, we turn it into an interactive adventure. If not – it will still be available for downloading and playing as a traditional solo-adventure in a text file.


If you know some HTML you can do the coding by yourself. The game phases must be divided into <div> blocks. Each <div> block should contain a unique id attribute and at least one action option. Examples:

<div id=”kitchen”> <p>You are in the kitchen. It’s filled with empty jars and a stack of dirty dished awaiting for cleaning. “Not now”, you sigh wearily.</p> <ul> <li onclick=”$(‘#kitchen’).hide(); $(‘#bedroom’).show();”>Go to the bedroom.</li> <li onclick=”$(‘#kitchen’).hide(); $(‘#toilet’).show();”>Go to the toilet.</li> </ul> </div> <div id=”bedroom”> <p>The bed looks comfortable and welcoming, but you don’t want to sleep now.</p> <ul> <li onclick=”$(‘#bedroom’).hide(); $(‘#kitchen’).show();”>Go to the kitchen.</li> <li onclick=”$(‘#bedroom’).hide(); $(‘#toilet’).show();”>Go to the toilet.</li> </ul> </div> <div id=”toilet”> <p>The smell here is so awful that you shut the door and gasp for air.</p> <ul> <li onclick=”$(‘#toilet’).hide(); $(‘#bedroom’).show();”>Go to the bedroom.</li> <li onclick=”$(‘#toilet’).hide(); $(‘#kitchen’).show();”>Go to the kitchen.</li> </ul> </div>

The first block should have “start” as an id value. The other blocks are invisible by default. The id="" attributes should never start with numbers.

With jQuery functions $().show() and $().hide() you can easily switch between locations. So if your game is a simple text-based adventure, this is all you need.

However, if your game contains attribute and/or talent tests, there are some more functions you can use.

function d1(modifier, difficulty, ‘success_location’, ‘failure_location’, adventure points);

and

function d3(modifier, attribute 1, attribute 2, attribute 3, difficulty, ‘success_location’, ‘failure_location’, adventure points);

The first function d1() simulates the 1-dice test and the second one d3() simulates the 3-dice test. Here are the descriptions of their variables.

  • modifier — is replaced with a variable of an attribute or a skill name;
  • attibute1/2/3 — is replaced with a variable of a corresponding attribute of the talent or spell;
  • difficulty – the difficulty of the test is an integer number between -19 and 19;
  • success_location — is a text string that matches the id value of the <div> you want show if the test succeeds;
  • failure_location — is a text string that matches the id value of the <div> you want to show if the test fails;
  • adventure points — is an integer number of AP the hero receives if the test succeeds.
Example:

Let’s take a ‘carouse’ talent as an example. It indicates how much alcohol a hero can handle before he gets drunk. Each talent is tested against three attributes. In case of ‘carouse’ it’s Intuition (IN), Constitution (CN) and Strength (ST). The difficulty can depend on the drink’s alcohol content. A light beer is easy to handle, so we assign 0 as test’s difficulty and 1 as adventure points. But schnapps is way stronger, so we assign 5 as test’s difficulty and 3 as adventure points.

<div id="tavern"> <p>You walk into the tavern, look around and take a seat at the nearest table. The barmaid notices you and comes over to take your order. “What would you like tonight? ‘Ferdok Pale Ale’, ‘Kosh Water’ or maybe something to eat?”</p> <ul> <li onclick="$('#tavern').hide(); d3(carouse,IN,CN,ST,0,'success','drunk',1);">A mug of ‘Pale Ale’, please.</li> <li onclick="$('#tavern').hide(); d3(carouse,IN,CN,ST,5,'success','too_drunk',3);">I’ll have some ‘Kosh Water’.</li> <li onclick="$('#tavern').hide(); $('#streets_of_ferdok').show();">Nothing, I’d better go.</li> </ul> </div> <div id="success"> <p>It doesn’t take long before the barmaid returns and hands over a mug.</p> <p>“If you’d like something else, let me know”, she smiles and goes to check on other customers.</p> <p>It’s early afternoon, so the tavern is not too crowded. The silent buzz of the customers is occasionally interrupted by dwarves’ cheering and mug clinking. The barmaid yawns stealthily into her hand. She smiles at you apologetically as she meets your gaze. You raise your eyebrows, lift your mug as a toast to say cheers and drink its contents in one gulp. The barmaid looks impressed and approaches you slowly.</p> <p>“Should I repeat your order?” she asks with a seductive smile.</p> <p>“If you keep me a company”, you smile back at her.</p> <p>The girl glances at the bartender near the counter, then bends down and whispers: “Meet me upstairs in ten minutes.”</p> </div> <div id="drunk"> <p>It doesn’t take long before the barmaid returns and hands over a mug.</p> <p>“If you’d like something else, let me know”, she smiles and goes to check on other customers.</p> <p>It’s early afternoon, so the tavern is not too crowded. The silent buzz of the customers is occasionally interrupted by dwarves’ cheering and mug clinking. The barmaid yawns stealthily into her hand. She smiles at you apologetically as she meets your gaze. You raise your eyebrows, lift your mug as a toast to say cheers and accidently knock over a jug of water. You catch it clumsily before it entirely poured out and take another sip from your mug as if nothing had happened. The bartender gives you an appraising look.</p> <p>“I think you need some fresh air!” he suggests.</p> <p>“Oh no, I’m fine”, you reply with a loud hiccup.</p> <p>“I insist”, he says threateningly.</p> <p>You don’t want any trouble, so you leave your money on the counter and leave the tavern.</p> </p> <div id="too_drunk"> <p>It doesn’t take long before the barmaid returns and hands over a mug.</p> <p>“If you’d like something else, let me know”, she smiles and goes to check on other customers.</p> <p>It’s early afternoon, so the tavern is not too crowded. The silent buzz of the customers is occasionally interrupted by dwarves’ cheering and mug clinking. The barmaid yawns stealthily into her hand. She smiles at you apologetically as she meets your gaze. You raise your eyebrows, lift your mug as a toast to say cheers and accidently knock over a jug of water. The water pours out entirely before you even realize what happened. The bartender looks at you in disgust.</p> <p>“Hey, you! Pay your bill and get out!”</p> <p>“Are you talking to me?” you ask with a loud hiccup.</p> <p>“Rahjane!” he addressed the barmaid. “Help this fellow out to the fresh air.”</p> <p>The girl approaches you and wrinkles her nose as she sees your wet pants. Then she helps you up to your feet and walks with you outside.</p> <p>“What a swine”, she mutters and closes the door.</p> </div>

If the binary result is not enough you can also perform a 3D20 check with Quality Levels. To do this use

d3ql(modifier, attribute1, attribute2, attribute3, difficulty, ‘critical_success_location’, ‘success_ql6_location’, ‘success_ql5_location’, ‘success_ql4_location’, ‘success_ql3_location’, ‘success_ql2_location’, ‘success_ql1_location’, ‘failure_location’, ‘critical_failure_location’, adventure points)

where:

  • modifier — is replaced with a variable of an attribute or a skill name;
  • attibute1/2/3 — is replaced with a variable of a corresponding attribute of the talent or spell;
  • difficulty – the difficulty of the test is an integer number between -19 and 19;
  • critical_success_location — is a text string that matches the id value of the <div> you want show if the player rolls two ones;
  • success_ql6_location — is a text string that matches the id value of the <div> you want show if the test succeeds and 16 or more skill points remain;
  • success_ql5_location — is a text string that matches the id value of the <div> you want show if the test succeeds and 13-15 skill points remain;
  • success_ql4_location — is a text string that matches the id value of the <div> you want show if the test succeeds and 10-12 skill points remain;
  • success_ql3_location — is a text string that matches the id value of the <div> you want show if the test succeeds and 7-9 skill points remain;
  • success_ql2_location — is a text string that matches the id value of the <div> you want show if the test succeeds and 4-6 skill points remain;
  • success_ql1_location — is a text string that matches the id value of the <div> you want show if the test succeeds and 0-3 skill points remain;
  • failure_location — is a text string that matches the id value of the <div> you want to show if the test fails;
  • critical_failure_location — is a text string that matches the id value of the <div> you want to show if the player rolls two twenties;
  • adventure points — is an integer number of AP the hero receives if the test succeeds.
Example

Our hero picked the locked and escaped from his cell. Now he wants to sneak behind the guard’s back and get out of the prison unnoticed. He has to perform a stealth check.

<p>The guard is sitting hunched up on a wooden chair. Listening to his wheezy snoring you can tell that he is deeply asleep.</p> <p>Would you try to <u onclick="d3ql(hide,CR,IN,AG,0,'free_all_prisoners','free_friends','steal_weapons','just_flee','just_flee','get_caught','get_killed',10);"> escape</u>?</p>

There are some more supplemental functions you can use.

resethero(); — after good night’s sleep hero’s life, astral and karma points regenerate back to normal.

location.reload(); — reset all values and restart the game. This applies if a hero dies or fails the quest.

endgame(AP); — the last option in your game must include this function. This applies to successful game ends only.

Variables

List of defined variables you can use for tests.

Attributes:
  • CR — Courage
  • CL — Cleverness
  • IN — Intuition
  • CH — Charisma
  • DX — Dexterity
  • AG — Agility
  • CN — Constitution
  • ST — Strength
Base values:
  • AP — Adventure Points
  • money — money in Hellers (1 Ducat = 10 Thalers = 100 Hellers)
  • LE — Life Energy
  • AE — Astral Energy
  • KE — Karma Energy
  • MR — Magic Resistance
  • INI — Initiative
  • speed — speed
  • ATAG — Attack for brawl, daggers and fencing weapons
  • PAAG — Parade for brawl, daggers and fencing weapons
  • ATST — Attack for other melee weapons
  • PAST — Parade for other melee weapons
  • ranged — Attack for ranged weapons
Combat techniques:
  • daggers — fight with daggers
  • fencing — fight with fencing weapons
  • axes — fight with axes and maces
  • chain — fight with chain bars
  • brawl — brawl and fight without weapons
  • swords — fight with swords and sabers
  • staves — fight with staves and spears
  • axes2 — fight with two-handed axes and maces
  • swords2 — fight with two-handed swords
  • crossbows — shoot crossbows
  • bows — shoot bows
  • throwing — throw weapons
  • dodge — dodge
  • shields — fight with shield
  • blowgun — shoot blowgun (ranged weapon)
  • chainbars — fight with chain bars
  • lances — fight with lances
  • nets — throw nets
  • whips — fight with whips
  • slingshots — shoot slingshots (ranged weapons)
Body talents:
  • fly (CR/IN/AG) — control a flying object like a witch’s broom or a magic carpet
  • trickery (CR/CH/DX) — juggle, hide items, perform tricks
  • climb (CR/AG/ST) — climb mountains, walls, trees e.t.c.
  • body_control (IN/AG/ST) — run, jump, untie ropes, balance, acrobatics e.t.c.
  • power (CN,ST,ST) — kick doors open, lift weights, blend, smash, pull heavy objects
  • ride (IN/AG/ST) — control mount animals
  • swim (AG/CN/ST) — swim, fight inside water
  • self_control (CR/CR/CN) — withstand pain, ignore physical distractions
  • sing (IN/CH/CN) — sing
  • perception (CL/IN/IN) — use five physical senses
  • dance (CH/AG/AG) — dance, remember dance steps
  • pickpocket (CR/IN/DX) — steal items without getting noticed
  • hide (CR/IN/AG) — sneak and hide
  • carouse (IN/CN/ST) — resist alcohol or drug intoxication
Social talents:
  • convert (CR/IN/CH) — convert and convince
  • seduce (CR/CH/CH) — flirt, charm
  • intimidate (CR/IN/CH) — threaten, blackmail
  • etiquette (CL/IN/CH) — show good manners
  • streetwise (CR/IN/CH) — know best people for useful info and places to get rare stuff
  • human_nature (CL/IN/CH) — understand reasons behind other intelligent creature’s behavior
  • persuade (CR/IN/CH) — sweet-talk, beg, manipulate
  • disguise (IN/CH/AG) — pretend being someone else
  • willpower (CR/IN/CH) — withstand itimidation or manipulation, resist seduction, ignore mental distractions
Nature talents:
  • track (CL/IN/IN) — find and understand tracks
  • bind (CL/DX/ST) — bind complicated knots
  • fishing (IN/DX/CN) — catch edible sea creatures
  • orientation (CL/IN/IN) — find best routes outdoors
  • herb_lore (CL/IN/DX) — know useful plants
  • animal_lore (CR/CR/CH) — know animals
  • survival (IN/AG/CN) — survive in wilderness
Lore talents:
  • gamble (CL/CL/IN) — play games of chance
  • geography (CL/CL/IN) — cartography, know places
  • chronicle (CL/CL/IN) — know history
  • theology (CL/CL/IN) — theology, religious cults
  • warfare (CR/CL/IN) — lead battle, war tactics
  • arcane lore (CL/CL/IN) — know magic in theory
  • mechanics (CL/CL/DX) — understand mechanisms
  • calculate (CL/CL/IN) — calculate
  • jurisprudence (CL/CL/IN) — know justice system
  • legend_lore (CL/CL/IN) — know fairytales and legends
  • sphere_lore (CL/IN/CH) — know the 7 spheres
  • astronomy (CL/CL/IN) — stars, time measuring, astrology
Craft talents:
  • alchemy (CR/CL/DX) — brew elixiers and poisons
  • drive (IN/CH/DX) — control vehicles
  • trade (CL/IN/CH) — evaluate, buy and sell things for a good price
  • heal_poison (CR/CL/IN) — identify and neutralize poison
  • heal_disease (CR/CL/IN) — identify and heal disease
  • heal_panic (CL/IN/CH) — suppress fears, treat mental problems
  • heal_wounds (CL/DX/DX) — take care of wounds
  • woodcraft (CL/DX/ST) — make things out of wood
  • cook (CL/IN/DX) — cook
  • leather_craft (CL/DX/DX) — make leather goods
  • paint (CL/IN/DX) — draw and paint
  • smithery (CL/DX/ST) — make things out of metal
  • music (IN/CH/DX) — play musical instruments
  • locks (IN/DX/DX) — open locks without keys
  • seafaring (DX/AG/ST) — travel by water, control a vessel
  • stone_craft (DX/DX/ST) — make things out of stone
  • tailoring (CL/DX/DX) — produce clothing
Gifts:
  • empathy (CR/IN/IN) —
  • danger_sense (CL/IN/IN) —
  • magic_sense (IN/IN/CH) —
  • predict (IN/IN/CH) —
  • supersensory (IN/IN/DX) —
  • dwarf_nose (IN/IN/DX) —
Magic spells:
  • eagles_eye (CL/IN/DX) —
  • eagles_wing (IN/DX/CN) —
  • armatrutz (CL/IN/DX) —
  • auris_nasus (CL/IN/DX) () —
  • axxeleratus (CL/IN/DX) —
  • balsam_salabunde (CL/IN/DX) —
  • bannbaladin (CL/IN/CH) —
  • mind_glance (CL/IN/DX) —
  • lightning (CL/IN/CH) — Lightning Find You!
  • corpofesso (IN/DX/CN) —
  • duplicatus (CL/IN/DX) —
  • hawkeye (CL/IN/DX) —
  • flim_flam (CR/IN/CH) —
  • fulminictus (IN/DX/CN) —
  • gardianum (CR/IN/CH) —
  • great_need (CL/IN/CH) —
  • camouflage (CL/IN/DX) —
  • witch_bile (IN/DX/CN) —
  • witch_claws (IN/DX/CN) —
  • horriphobus (CL/IN/CH) —
  • ignifaxius (CR/IN/CH) —
  • invocatio_minima (CR/IN/CH) —
  • cats_eyes (CL/IN/DX) —
  • frogs_leap (CL/IN/DX) —
  • manifesto (CR/IN/CH) —
  • motoricus (AG/DX/ST) —
  • smokescreen (CR/IN/CH) —
  • odem_arcanum (CL/IN/DX) —
  • paralysis (IN/DX/CN) —
  • penetrizzel (CL/IN/DX) —
  • psychostabilis (CR/CL/IN) —
  • terror_broom (AG/DX/ST) —
  • respondami (CR/IN/CH) —
  • salander (IN/DX/CN) —
  • meekness (CR/CH/CH) —
  • satuarias_glory (CL/IN/DX) —
  • silentium (AG/DX/ST) —
  • somnigravis (CL/IN/CH) —
  • spider_run (IN/DX/CN) —
  • without trace (IN/DX/CN) —
  • transversalis (CL/IN/CN) —
  • visibili (CR/IN/CH) —
  • oceans_floor (IN/DX/CN) —
Magic rituals:
  • arcanovi (CL/IN/DX) —
  • summon_jinn (CR/IN/CH) —
  • summon_elemental (CR/IN/CH) —
  • summon_elementmaster (CR/IN/CH) —
  • invocatio_minor (CH/CH/AG) —
  • invocatio_maior (CH/CH/AG) —
  • invocatio_maxima (CH/CH/AG) —
  • magic_blade (CL/IN/DX) —
Deont liturgies:
  • honor_duel (CR/CR/IN) —
  • encouragement (CR/CR/IN) —
  • banish_poison (CR/CL/IN) —
  • divine_sign (IN/IN/CH) —
  • heal_blessing (IN/CH/CH) —
  • holy_order (CR/CH/CH) —
  • banish_disease (CR/CL/IN) —
  • prophecy (CR/IN/IN) —
  • storm (CR/IN/IN) —
  • weapon_devotee (IN/IN/CH) —
  • wound_treatment (CL/IN/CH) —

You can define your own local variables, just make sure that they don’t match the ones that were already defined.