MCPcopy Index your code
hub / github.com/Monogatari/Monogatari

github.com/Monogatari/Monogatari @v2.8.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.8.0 ↗ · + Follow
1,108 symbols 3,066 edges 153 files 196 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Monogatari

Monogatari

Built to bring Visual Novels to the modern web and take them to the next level, making it easy for anyone to create and distribute Visual Novels in a simple way so that anyone can enjoy them on pretty much anywhere, create games with features that no one has ever imagined... It is time for Visual Novels to evolve.

Website: https://monogatari.io/

Demo: https://monogatari.io/demo/

Discord: https://discord.gg/gWSeDTz

Twitter: https://twitter.com/monogatari

Community: https://community.monogatari.io/

Features

  • Responsive out of the box
  • Plays nice with Electron for Desktop apps and Cordova for mobile apps
  • Simple Syntax
  • Progressive Web App Features allowing offline game play
  • Allows you to use any kind of media supported by browsers
  • Compatible with all major browsers
  • Includes libraries for animations and particle effects
  • Allows saving/loading games
  • Extensible, you just can't imagine how much!

What do I need to get Started?

The first thing about Monogatari that you should probably know is that with it, your visual novel is a web page first and a game later. That means that Monogatari has been created specifically for the web, putting things like responsiveness (the fact that your game will adapt to any screen or device size) first. You don't necessarily need to think of your game this way as well, but you'll certainly take the most out of Monogatari if you do.

Set up your environment

To develop in Monogatari you would need the same as to develop a webpage, you just need a text editor capable of editing HTML, Javascript and CSS, which means that pretty much any text editor should work, even Windows NotePad but to make it easier, you probably want one with code syntax highlighting.

Some recommended (and free) ones include:

Take a look at them and pick the one you like the most and feel comfortable with, this will be your main tool from now on.

Now, you can always open a website by just clicking the file index.html and opening it with your browser, however there are small aspects of Monogatari that work better when served through a web server. You don't need anything fancy for this, in fact there's a perfectly fine web server you can download from the Chrome Store

As previously mentioned, the use of a web server is completely optional, you can just open your game with the browser as a file and it will run just fine, the web server will allow you to test features such as the Service Workers, needed for Monogatari's offline support and asset preloading.

Workflow

Ok so now you have the environment set up, you have some idea on what the files you got are for so how can you start developing your game?

  1. Try the game first, open the index.html file inside the directory you just unzipped and play the sample game through.
  2. Once you've played it once, open the directory (the one you unzipped) with the editor you chose to start making changes.
  3. Open the script.js file with your editor, find the variable called script, as you'll see, all the dialogs you just saw are just a simple list in there. More information can be found in the documentation.
  4. Change one of the dialogs, save the file and reload the game (just like you reload a website).
  5. Play it again and you'll see the dialog changed just like you made it.
  6. Now try adding more dialog to it and you'll quickly get how things are done.
  7. Once you've gotten yourself used to adding dialogs, add a scene as a challenge, that means you'll have to add your image file to the img/scenes/ directory , more instructions are on the link.

If you manage to do all that, congratulations! You just made your first game and are probably more familiarized with the workflow you'll be using, just make changes, save, reload, try and repeat!

Documentation

You can read the documentation at monogatari.io/v2.

The documentation source lives in the docs/ folder of this repository.

Monogatari as a Module

Monogatari's core functionality is also released as an UMD module, therefore it's possible to use it either on a browser as a global library, using ES6 modules or Node.js modules.

Browser

<script src='./monogatari.js'></script>
const monogatari = Monogatari.default;

ES6 Modules

import Monogatari from '@monogatari/core';

Node.JS

const Monogatari = require ('@monogatari/core');

Contributing

Contributions are always welcome! Read the CONTRIBUTING file to get started.

License

Monogatari is a Free Open Source Software project released under the MIT License.

Extension points exported contracts — how you extend this code

StorageInterface (Interface)
(no doc) [2 implementers]
src/lib/types/Monogatari.ts
Window (Interface)
(no doc)
src/monogatari.ts
Window (Interface)
(no doc)
src/browser.ts
PreloadBlock (Interface)
(no doc)
src/actions/Preload.ts
TextBoxProps (Interface)
(no doc)
src/components/text-box/index.ts
MigrationSaveData (Interface)
(no doc)
src/migrations/20211223-add-previous-statement-to-show-history.ts
DesktopBridge (Interface)
(no doc)
src/lib/DesktopBridge.ts
TextBoxState (Interface)
(no doc)
src/components/text-box/index.ts

Core symbols most depended-on inside this repo

get
called by 1359
src/lib/types/Monogatari.ts
contains
called by 612
src/lib/types/Monogatari.ts
setting
called by 424
src/monogatari.ts
proceed
called by 331
src/monogatari.ts
start
called by 299
src/components/type-writer/index.ts
script
called by 295
src/monogatari.ts
state
called by 202
src/monogatari.ts
element
called by 164
src/lib/Component.ts

Shape

Method 788
Class 144
Function 92
Interface 84

Languages

TypeScript100%

Modules by API surface

src/monogatari.ts120 symbols
src/components/type-writer/index.ts46 symbols
src/lib/Action.ts34 symbols
src/lib/FileSystemStorage.ts26 symbols
src/lib/types/index.ts25 symbols
src/lib/ShadowComponent.ts25 symbols
src/lib/Component.ts25 symbols
src/lib/AudioPlayer.ts25 symbols
src/actions/Dialog.ts24 symbols
src/lib/types/Monogatari.ts22 symbols
src/engine/assets.ts22 symbols
src/actions/Preload.ts21 symbols

For agents

$ claude mcp add Monogatari \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact