sphiratrioth666 commited on
Commit
2909df3
·
verified ·
1 Parent(s): 790817b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -3
README.md CHANGED
@@ -1,3 +1,26 @@
1
- ---
2
- license: cc-by-nc-4.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ ---
4
+ I was experimenting with Silly Tavern lorebooks and I found a great way of implementing pre-defined random events or actions when particular circumstances occur. It allows steering the scenario automatically, simulating a TTRPG experience (rolling dice with random roleplaying results) or steering a {{char}} behavior very precisely the way we want.
5
+
6
+ How to do it:
7
+
8
+ 1. Create a lorebook in Silly Tavern (I will not teach you that, you need to understand how it's done, how it's used on your own this time. In short, it is usually used for storing and triggering actual lore information but we'll be using it uch more creatively!)
9
+
10
+ 2. Create the entries group in your lorebook - add multiple entries, each representing random events you want to happen in a given situation (like table of results of dice rolls in TTRPG). Each entry must have: a) the same trigger words, b) position = at Depth (System), c) depth = 1, d) order = 100, e) trigger = 100, f) Prevent further recursion option on (entry will not activate other entries), g) group weight = [100 divided by number of entries in our group, i.e. if we roll 1d10 aka 10 positions, each entry has a group weight = 10, if we roll 1d6, each entry has a group weight = 16 (round lower to the whole values)], h) sticky = 10 or 20 (it makes the instruction for LLM remain active for a given number of the following messages - so it actually triggers logically within the scene, LLMs seem to understand it and do things under logical circumstances in the scene".
11
+
12
+ Options: You can theoretically change the weights to trigger different events with different probabilities. For simplicity, you can also match all separate "dice results" with a given fiction result or a TTRPG system DC (something like: we roll 1d6, we fail at 1-3 so: 1 = {{user}} will fail in {{user}}'s' action, 2 = {{user}} will fail in {{user}}'s' action, 3 = {{user}} will fail in {{user}}'s action', 4 = {{user}} will succeed in {{user}}'s action etc.'). I rather prefer having equal weights and repeated entries rather than messing with the weights. We never know, which actual RNG simulator a given software will use so this way - we take control of that forcing the real, equal distribution. It's also why Excell RNG for dice rolling is more realistic than dice rolling apps, just if you're curious (I'm working in game dev).
13
+
14
+ 3. Write instructions inside of the entries. They must be short, clear and include a specific word: "WILL". It seems to be very, very important. Otherwise, it might not work - at least with Mistral models and their fine-tunes.
15
+
16
+ Template: {{char}} will [ACTION YOU WANT] or [EVENT] will [HAPPEN}.
17
+ Something like: "enemies will attack {{user}}" or "road ahead will be blocked".
18
+
19
+ Again, it seems that a word "will" is the best working trigger. Here, maybe "OOC" instructions would also be a good idea but since keys at depth = system are inserted already as instructions inside of a prompt itself (I checked, they're [INST] (...) [/INSTR] for Mistral), I'm not sure if it makes any sense.
20
+
21
+ TRICKS:
22
+ Trick 1: depending on the use-case, you will need a couple of such entry groups (like different "dice rolls" for social encounters, different for random events in the world and different for dungeons exploring). IT WORKS VERY WELL.
23
+ Trick 2: you can also steer {{char}}'s behavior precisely using this method to stick to the personality better (it seems to work better than pure card definitions).
24
+ Trick 3: in NSFW, you can add variety - positions, behaviors, extra stuff and flavor to {{char}} better than using normal, random lorebooks in a classical manner. It works VERY WELL.
25
+ Now, if you know another way or any other, great and actually working idea - share it with me, I'd gladly hear it. I am aware that there's a dice-rolling extension for silly tavern but it does not operate within prompts. It may be rolled personally and then triggered the positions only - so skipping the auto-RNG mechanism within a lorebook if you prefer rolling a die on yourself. That is the only addition to the trick, which I am aware of but as I said - feel free to share your tricks.
26
+ All of that has been found because I wanted a scenario to trigger specific events during a battle simulation, I couldn't force it to do it through a card and through a lorebook normally - so I started experimenting.