Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ firstrun
**/game/assets/audio/sfx/_space-lines.mp3

**/game/images/monika/nonchalant.png

**/game/images/characters/*

!**/game/images/characters/Sam/*
276 changes: 276 additions & 0 deletions GUIDES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
# Add character sprite

**When adding a new character do the following**


- add new folder w/ sprites at `game\assets\imgs\characters`
- add new name to `game\assets\configs\custom_characters`
- add new name to `game\assets\prompts\custom_prompts`



### New folder

- Create a new folder in `game\assets\imgs\characters`
- The name of the folder should be the name of your character (Make sure the first letter is capitalized)

<img src="game/assets/imgs/help_page/folder name.png">

- Fill the folder with character sprites
- The images should ideally be 960x960

<img src="game/assets/imgs/help_page/custom char sprites.png">

### character.json

- Go to `game\assets\configs\custom_characters`
- Make a `.json` file with the title of your character. In my case it's "sam"

<img src="game/assets/imgs/help_page/sam folder json.png">

- Copy this template (replace "Sam" with your own character name)


```json

"Sam":{
"full_sprites": [],
"head": {
"angry": "angry.png",
"determined": "determined.png",
"glad": "glad.png",
"happy": "happy.png",
"laugh": "laugh.png",
"nervous": "nervous.png",
"neutral": "neutral.png",
"really angry": "really angry.png",
"really happy": "really happy.png",
"sad": "sad.png",
"surprised": "surprised.png"
},
"left": {
"explain": "",
"relaxed": ""
},
"right": {
"explain": "",
"relaxed": ""
},
"bio": "",
"image": "",
"logo": "assets/imgs/gui/logo.png",
"chibi": null,
"chibi_hover": null
}
```

Make sure the name is capitalized. For example, notice how it's "Sam" and not "sam".

Now replace the default emotions in the "head" section with the ones you actually want your character to display.

The emotions that you see ending with `.png` is the character sprites we added in
`game\assets\imgs\characters\Sam`



If your sprites are just 1 image combined together then add all of the emotions in "head" into `full_sprites` as well.

```json
"Sam":{
"full_sprites": [
"angry",
"determined",
"glad",
"happy",
"laugh",
"nervous",
"neutral",
"really angry",
"really happy",
"sad",
"surprised"
],
"head": {
"angry": "angry.png",
"determined": "determined.png",
"glad": "glad.png",
"happy": "happy.png",
"laugh": "laugh.png",
"nervous": "nervous.png",
"neutral": "neutral.png",
"really angry": "really angry.png",
"really happy": "really happy.png",
"sad": "sad.png",
"surprised": "surprised.png"
},
"left": {
"explain": "",
"relaxed": ""
},
"right": {
"explain": "",
"relaxed": ""
},
"bio": "",
"image": "",
"logo": "assets/imgs/gui/logo.png",
"chibi": null,
"chibi_hover": null
}
```


In the "left" and "right" section just add any `.png` in your character sprite folder, it doesn't matter.


```json
"left": {
"explain": "surprised.png",
"relaxed": "surprised.png"
},
"right": {
"explain": "surprised.png",
"relaxed": "surprised.png"
},
```

Now change the "bio" section to actually give info of who your character is


```json
"bio": "Sam is a college student that majors in art. He hates Monika with a passion and is constantly angry about being trapped in this world",
```

The "image" section will be what's displayed when you go to select a character. You can simply put in one of the sprites in your characters folder if you don't have a custom image.

<img src="game/assets/imgs/help_page/char select image.png">


Put the path to your image file. Eg. In my case it will be this

```json
"image": "assets/imgs/characters/Sam/angry.png",
```


The "chibi" and "chibi_hover" should be set as `null` unless you have a chibi version of the sprite you want to use.

```json
"chibi": null,
"chibi_hover": null
```

You should be done with this section now! The whole file should look like this now.

```json

"Sam":{
"full_sprites": [
"angry",
"determined",
"glad",
"happy",
"laugh",
"nervous",
"neutral",
"really angry",
"really happy",
"sad",
"surprised"
],
"head": {
"angry": "angry.png",
"determined": "determined.png",
"glad": "glad.png",
"happy": "happy.png",
"laugh": "laugh.png",
"nervous": "nervous.png",
"neutral": "neutral.png",
"really angry": "really angry.png",
"really happy": "really happy.png",
"sad": "sad.png",
"surprised": "surprised.png"
},
"left": {
"explain": "surprised.png",
"relaxed": "surprised.png"
},
"right": {
"explain": "surprised.png",
"relaxed": "surprised.png"
},
"bio": "Sam is a college student that majors in art. He hates Monika with a passion and is constantly angry about being trapped in this world",
"image": "assets/imgs/characters/Sam/angry.png",
"logo": "assets/imgs/gui/logo.png",
"chibi": null,
"chibi_hover": null
}
```


### Custom Prompts

- go to `game\assets\prompts\custom_prompts`
- Add the name of the character you want

<img src="game/assets/imgs/help_page/folder char name.png">

- Create a format that looks like this (with your own backstory)

```json

{
"sam": [
{
"role": "system",
"content": "BACKSTORY \nSam is a college student that majors in art. He hates Monika with a passion and is constantly angry about being trapped in this world. {{format}}"
}
]
}
```

- Make sure the **name** of your character is all **lowercased.** And make sure that at the end of your BACKSTORY you have `{{format}}`




# Add Default Backgrounds

**When adding a new background do the following**

- add new background image in `game\assets\imgs\bg`
- add new background name in `game\assets\configs`

Once you've added the images you want in `game\assets\imgs\bg`

- go to `game\assets\configs`
- remove the default background images (if you want, you don't have to)
- add the name of your background image in the "default" dictionary.

eg. I want to add a "park" as a default background.

The name of my background image is "park-day-1.png" so this is how I'd write it in the json

```json
"default": {
"park": "park-day-1.png",
}
```

You'll notice that there's another key in the json called "checks".
Everything inside "checks" is a backup just incase the AI doesn't correctly spell something correctly.

For example, all the default backgrounds are injected into the system prompt by default and we display a scene by using 1 of those injected scenes
but what if the AI "hallucinates" and doesn't correctly spell the default scene correctly?

"checks" is used as a potential typo that the AI may make so that it falls back onto the correct scene.

so for example

```json
"checks": {
"parks": "park-day-1.png"
}
```

maybe instead of the ai returning "park" like we instructed, it returns "parks". This check here ensures that we get the appropriate scene and not something else.
25 changes: 6 additions & 19 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,7 @@ <h2>Model Config</h2>
<b>Context Window</b>
</span>
<p>
The maximum amount of tokens (messages) that will be remembered. The few-shot prompts for monika's default prompt already takes up 1,066 tokens
(which is over the default limit if you're using a level2 <a href="header_prompt"><u>header prompt</u></a>).
The maximum amount of tokens (messages) that will be remembered.
</p>

<p>
Expand Down Expand Up @@ -592,21 +591,7 @@ <h1><b>WARNING</b></h1>
</p>

<p>
"level1" and "level2" are formatted infront of each character name in the json file, I call them "<span id="header_prompt">header prompts</span>".
These header prompts can be used to change small differences in the prompt to give varying results or change the prompt entirely.
</p>

<p>
By default "level2" is the current header prompt and gives a lengthy few-shot examples of how the ai should respond but they're too lengthy and goes over the max
token limit. (You can of course just increase the context window)
</p>

<p>
"level1" is far simpler and gives only a couple few-shot example prompts of how the ai should respond but has a higher chance of failing to respond correctly.
</p>

<p>
If you want to create your own default prompt without using those 2 levels you can but make sure you account for every character.
You can edit the backstory to your liking.
</p>
</div>
</div>
Expand Down Expand Up @@ -669,10 +654,12 @@ <h2>Why do the models sometime return "ERROR"?</h2>
</p>


<h2>Why does the game freeze?</h2>
<h2>Why does the response keep loading?</h2>

<p>
This means that the ai is generating the output. You should wait for it to be done.
If your hardware isn't that good then it could likely mean that it's just a hardware limitation. HOWEVER. If it's taking abnormally long
check the log.txt file, there may be an error in there which would have cauesed the game to be in a constant "Loading..." state.
Post your log.txt file in the discord #support channel
</p>


Expand Down
14 changes: 2 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@ To setup the mod just drag the contents into the main ddlc folder:

**Overview:** Ollama is an open-source project that allows people to setup local language models on their machine in a far more user friendly way. They have both uncensored and censored models and the models are quantized (compressed) to run on low-end devices.

**Pros**
- Run models locally on your machine
- Easy to setup
- Privacy: Even if your internet is off, it'll still work
- Uncensored: Freedom to say whatever


**Cons**
- Very Slow (depending on your hardware)
- Quality isn't that great especially compared to what some APIs offer


**Let's Start!**
- Go to https://ollama.com/download
Expand Down Expand Up @@ -133,4 +122,5 @@ You could also edit the chat file for the old world and try loading it again.

## Special thanks

Thanks to Retronika & iiTzWolfyy for the Character template gui & script used when a user first creates a realm
- Thanks to Retronika & iiTzWolfyy for the Character template gui & script used when a user first creates a realm
- sutemo for the male sprites https://sutemo.itch.io/male-character-sprite-for-visual-novel
Loading