[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-112917":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":15,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":24,"updatedAt":25,"readmeContent":26,"aiSummary":27,"trendingCount":16,"starSnapshotCount":16,"syncStatus":15,"lastSyncTime":28,"discoverSource":29},112917,"TsukiREbuild","waifwu\u002FTsukiREbuild","waifwu","Tsukihime remake decompiled and rebuilt for web, windows and android","",null,"JavaScript",77,13,4,2,0,15,23,8,54.24,false,"main",[],"2026-11-23 20:32:53","2026-11-23 16:50:50","# TsukiREbuild\n\nThe Tsukihime remake, *Tsukihime -A piece of blue glass moon-*, rebuilt to play in a web browser, on Android, and as an app on Windows, macOS and Linux. The game's engine was rewritten in JavaScript and WebGL2, and that new engine plays the game's own scripts, pictures, voices, music and movies. Wherever the port had to decide how something looks, sounds or moves, the answer was taken from the game itself and checked against it frame by frame.\n\n**[▶ Play online](https:\u002F\u002Farcueid.date\u002F)** · ⬇ Download: **[Windows](https:\u002F\u002Farcueid.date\u002Fdesktop\u002FTsukihime-win-x64.zip)** (2.9 GB) · **[Android](https:\u002F\u002Farcueid.date\u002Fandroid\u002Ftsukihime.apk)** (2.8 GB) · macOS and Linux: [build it](#on-windows-macos-and-linux)\n\n> An unofficial, non-commercial fan project, not affiliated with TYPE-MOON or Aniplex. Please support the official release.\n\n## Contents\n\n- [Play it](#play-it): in a browser, on Android, on Windows, macOS and Linux, from this folder\n- [Controls](#controls): mouse and keyboard, touch, controller\n- [How it plays](#how-it-plays): the opening page, language, saves, skipping, movies, Ciel-sensei\n- [Under the hood](#under-the-hood): loading, fonts, opening a particular scene\n- [The repository](#the-repository): what is where, making the assets again, tests\n- [Deployment](#deployment): how arcueid.date is served\n- [Credits](#credits)\n\n## Play it\n\n### In a browser\n\nOpen **[arcueid.date](https:\u002F\u002Farcueid.date\u002F)** in Chrome or Firefox, on a computer, a phone or a tablet. Nothing is installed: the game's files arrive as you play, and saves stay in the browser.\n\nThe site opens on a page with five tabs: **ABOUT** (what this is and how it was made), **GITHUB**, **DOWNLOAD** (the apps below), **SAVE DATA** (your saves to and from the game's own save file), and **PLAY ONLINE**, whose PRESS ANY BUTTON starts the game.\n\nIt plays in **English** (the fan translation), in **Japanese** (the original game's own text) or in **Chinese** (a Chinese fan translation of the original): three plates on PLAY ONLINE, above the prompt, choose. See [Language](#language).\n\n**It does not work in Safari.** The movies are AV1 video, which Safari plays only on Apple's newest hardware (it has no decoder of its own), and the game has not been tried there.\n\n### On Android\n\n**[Download Tsukihime.apk](https:\u002F\u002Farcueid.date\u002Fandroid\u002Ftsukihime.apk)** (2.8 GB). It is the whole game in one app, in English, with Japanese and Chinese a download inside it (below): every picture, voice, song and movie is inside it, so it needs no connection to play. Its one permission is the internet, which it uses only to look for and download its own updates from arcueid.date.\n\n1. Download it on the phone itself. It is large, so Wi-Fi is best.\n2. Open it from the browser's downloads. Android asks whether that browser may install apps: allow it.\n3. Install. As much space again must be free while it installs; afterwards the download can be deleted.\n\nIt needs Android 8 or newer and plays in landscape, by touch, as the site does on a phone. It opens on the site's opening page with four plates, ABOUT, GITHUB, SAVE DATA and PLAY; SAVE DATA's Import and Export use the phone's own file picker, so a `savedata000` goes between the app, the site and the Switch game. Android's Back gesture does what the game's own Back button does, and leaving the app makes the automatic save. Saves are kept in the app, apart from the website's, and a newer APK installs over the old one with them kept. **It updates itself:** when it opens with a connection it looks on arcueid.date for a newer version, asks, and downloads only the files that changed (usually a megabyte or so); the saves stay. How it is built: [web-dev\u002Fandroid\u002FREADME.md](web-dev\u002Fandroid\u002FREADME.md).\n\n### On Windows, macOS and Linux\n\nThe whole game as a desktop app, in English (Japanese and Chinese are downloaded inside it when first chosen), with every picture, voice, song and movie inside it and no connection needed to play. It is the same web port in a window of its own (Electron), opening on the site's opening page with four plates: ABOUT, GITHUB, SAVE DATA and PLAY. SAVE DATA's Export and Import use the system's own file dialogs. Closing the window makes the automatic save. Saves are kept in the app's own data folder, apart from the website's, and stay when a newer version replaces the app. **It updates itself:** when it opens with a connection it looks on arcueid.date for a newer version, asks, and downloads only the files that changed; the saves stay.\n\n**Windows** (10 or newer, 64-bit): **[download Tsukihime-win-x64.zip](https:\u002F\u002Farcueid.date\u002Fdesktop\u002FTsukihime-win-x64.zip)** (2.9 GB).\n\n1. Right-click the file and choose Extract All, into a folder of its own. There is nothing to install.\n2. Open `Tsukihime.exe` in that folder. Windows may say it does not know the publisher: More info, then Run anyway.\n\n**macOS and Linux** have no download yet (the site's storage has no room for them). The app is the same one, and one command builds it from this repository, which carries the game's files:\n\n```bash\ngit clone --depth 1 https:\u002F\u002Fgithub.com\u002Fwaifwu\u002FTsukiREbuild\ncd TsukiREbuild\nweb-dev\u002Fdesktop\u002Fbuild.sh mac      # on a Mac: web-dev\u002Fdesktop\u002Fout\u002FTsukihime-mac-universal.dmg\nweb-dev\u002Fdesktop\u002Fbuild.sh linux    # web-dev\u002Fdesktop\u002Fout\u002FTsukihime-linux-x86_64.AppImage\n```\n\nIt needs Git, Node.js with npm, and about 20 GB free while it builds; the first run fetches Electron. The Mac app is for macOS 13 or newer, Apple silicon and Intel: open the `.dmg` and drag Tsukihime to Applications. The Linux one is for 64-bit (x86) systems: `chmod +x` it and open it (it needs FUSE, `libfuse2`; without it, add `--appimage-extract-and-run`). How it works: [web-dev\u002Fdesktop\u002FREADME.md](web-dev\u002Fdesktop\u002FREADME.md).\n\n### On your own computer\n\n```bash\npython3 web\u002Fserver.py 8765\n```\n\nThen open http:\u002F\u002Flocalhost:8765. It needs Python 3, with no packages, and the `web` folder: everything the game uses is in `web\u002Fassets\u002F` (2.8 GB). **Those files are not in the repository**, since they are the game's own: `python3 web-dev\u002Ftools\u002Ffetch_assets.py` brings them from the site, once (see [The game's files](#the-games-files)). Nothing else in the repository is read, so the `web` folder can be moved by itself. The browser needs WebGL2, AVIF, Opus and AV1 video; Chrome and Firefox have them all.\n\n## Controls\n\n### Mouse and keyboard\n\nThe interface is made for a mouse and a keyboard. The story itself (pictures, text, sound, movies) plays as the game plays it; the screens around it keep the game's art and follow one rule:\n\n- **The mouse.** What is under the pointer lights up, one click chooses it, a right click goes back, and the wheel scrolls. On the story screen a click advances, a right click opens the system menu, the wheel up opens the log and down advances, and a middle click hides the text (any click shows it again). The pointer goes out of sight when it rests over the story. A click draws the game's touch ring. There is no Back button on the screens: a right click (or Esc) is Back everywhere, and a button's caption shows only while the pointer is on it.\n- **The quick bar.** Move the mouse to the top of the picture. It is the game's own bar and buttons (previous scene, previous message, auto, skip, next scene, Q.SAVE, Q.LOAD, voice) with LOG, HIDE, SAVE, LOAD, CONFIG, FULL and MENU after them, cut from the same art. Pointing at a button shows what it does and its key. Any click sends the bar up again. The two scene buttons and Q.LOAD ask first, starting on No.\n- **The keys.** One map for every screen, shown on the config's Controls page, where a click on a key (or Enter) and then the new key changes it; Esc cancels, Backspace clears, and \"Reset to defaults\" puts them back.\n\n| Action | Default key |\n|---|---|\n| Advance text | Enter, Space |\n| Fast forward while held | Ctrl (everything, or only read text when Fast forward is \"Read\") |\n| Skip read text on \u002F off | S |\n| Auto mode on \u002F off | A |\n| Log | L, Page Up |\n| Previous message | R |\n| Hide text | H |\n| Replay voice | V |\n| Quick save, quick load | Q, W |\n| Return to previous scene, jump to next scene | P, N |\n| Quick bar by keys | Up (then Left \u002F Right, Enter; Esc closes) |\n| System menu | Esc |\n| Full screen | F |\n| Save, Load, Config | none until you give them one |\n\nThe game goes full screen when it is started from PLAY ONLINE, and after that at any click, until F (or the quick bar's FULL) takes it out; F again puts it back. Esc still opens the menu in full screen, where the browser allows it.\n\nIn every menu the arrows move, Enter or Space chooses, Esc or Backspace goes back, Tab changes the config's page (Shift + Tab the other way), Page Up \u002F Page Down scroll, and Home \u002F End go to the first \u002F last. The bar along the bottom of each screen says what is there.\n\n- **Choices** start with nothing selected: the pointer lights a row and a click takes it; Up \u002F Down or the wheel pick a row (Left \u002F Right the first or last) and Enter takes it. Rows the story has not opened yet are shown but cannot be picked. The story's own yes \u002F no questions also start on neither: point and click, or Up for No and Down for Yes.\n- **The log** shows every page so far, the one on screen too, one under another as the text window drew them, opened at the newest. The wheel, the scroll bar and Page Up \u002F Page Down scroll it, and scrolling on past the end closes it. A click on a line (or Up \u002F Down and Enter) asks \"Quick Jump?\" (starting on No) and goes back to that line; a line with a voice has a speaker mark at its left, and a click on it (or V on the cursor's line) plays the voice again.\n- **The config.** Its System page has its words at one size, 28 px, on every device: the translated art had the rows' names, the choices, the toggles and the samples at five different sizes, so the three pictures that carry them are drawn again as the game starts (`app\u002Fjs\u002Fconfart.js`). A click on a slider's bar puts the knob there, and it can be dragged; minus and plus step 1 (50 for the auto mode waits) and repeat when held; holding Enter on a slider, Left \u002F Right step it; the wheel or a drag scrolls the page.\n- **The gallery.** In the CG viewer a click or Left \u002F Right change the picture, Enter toggles fill and fit, Up \u002F Down, + \u002F - or the wheel zoom, dragging moves the picture and Home resets it. In the Music Player a click on the position bar moves the track there.\n- **The flowchart** can be drawn larger, up to three times (the port's own: the game's has one size). Ctrl with the wheel, or a touchpad's pinch, zooms about the pointer; + \u002F - step it and 0 brings back the game's size. Zoomed, it takes the screen's whole width, the wheel and a drag move it across as well as down (Shift with the wheel goes sideways), and the arrow keys keep the selected scene in view.\n\nThe chapter in the system menu's header, on each save row and down the flowchart's left side is written out as text, one line each, in the look of the game's pictures of them (the translated pictures had to break long names over two small lines to fit the game's cells). The system menu's header (and Save, Load and Config under it) names the music playing: \"Audio Track\", and under it a turning disc and the title. From the title the gallery opens on the game's own one-second fade, without the 0.35 s stop the game makes after it.\n\n### Touch: phones and tablets\n\nA device played by touch gets a touch interface: one whose first pointer is a finger that cannot hover (`(hover: none) and (pointer: coarse)`), which means phones and tablets. A laptop with a touch screen, a narrow desktop window and a tablet with a mouse attached keep the mouse and keyboard interface, which is unchanged. `?touch=1` in the address forces the touch interface and `?touch=0` the other; it is decided once, as the page loads.\n\n**The opening page** works held either way: held upright it has a layout of its own, over a taller column. By touch its five plates are in two rows either way: ABOUT, GITHUB and DOWNLOAD over SAVE DATA and PLAY ONLINE. **The game plays in landscape.** Once PLAY ONLINE has started it, a phone held upright shows a screen asking for it to be turned, and everything is held under it (the story's clocks, sound, movies, the screens' own motion) until it is. The picture is the game's 1920 x 1080 stage, fitted inside the screen's safe area: on a phone wider than 16:9 it stands in the middle with black beside it, clear of a notch and of the home bar. The game goes full screen when it is started, and where the browser lets a page do so, landscape is locked there. The page itself does not scroll, zoom or select: pull to refresh, double-tap and pinch zoom and the long-press menu are off.\n\n| On the story | |\n|---|---|\n| Advance text | Tap |\n| Control panel | Swipe down on the picture, or tap its top edge |\n| Log | Swipe up |\n| Fast forward while held | Keep a finger on the picture (everything, or only read text when Fast forward is \"Read\") |\n| Hide text | Tap with two fingers (any tap shows it again) |\n| Pass a movie | Tap (it asks first where a click does) |\n\nThe control panel is the quick bar at a finger's size: the same fifteen buttons, the game's own plates at one and a half times their size in three rows of five, each with its name under it. A tap on a plate does it and sends the panel up; a tap anywhere else, or a swipe up, only sends it up. The first time a story starts, a band across the top names the gestures until the panel has been pulled down once.\n\nA choice takes two taps, as the game's own touch screen did: the first lights the row, a tap on the lit row takes it. Yes \u002F No questions are drawn larger and answer at one tap.\n\nIn the menus whatever is pressed lights up, and its tap chooses it. Lists move under the finger. Back is the game's own touch Back button, which slides in at the bottom right of every screen that has a way back (on a question it is No). There is no hint bar along the bottom on a touch device.\n\n- **Title.** The logo is smaller and the rows twice their size under it.\n- **System menu, Save, Load.** The column's rows stand further apart. Save rows are a finger's size as they are.\n- **Config.** Drawn larger across the whole width, without the column (Back returns to it). A slider follows a finger that moves along it, and a tap on its bar puts the knob there; a finger that moves up or down scrolls the page instead. Minus and plus step at a tap and repeat when held. The Controls page lists these gestures in place of the keys.\n- **Log.** Tap a line for Quick Jump, and the speaker mark at its left to hear its voice again. Pulling on up past the newest line closes it.\n- **Gallery.** In the CG viewer a tap or a swipe to the left goes to the next picture and a swipe to the right to the one before; two fingers zoom, up to four times the fitted size, and one moves a picture that has been made larger. The viewer's Back button leaves two seconds after the last touch and returns at the next. In the flowchart a tap on a scene shows it at the right, and a tap on the scene shown opens it; two fingers zoom it, up to three times, and one moves it once it is larger.\n\nAll of it is made from the game's own interface art: the Back button, the panel's plates and strip, the notice window and the auto mode's ring on the rotate screen, the speaker mark in the log. Story playback is the same on every device. Tried on a phone (Android 17, in Chrome and in the app) and in Chrome's touch emulation at 390 x 844 upright and 667 x 375, 844 x 390, 932 x 430 and 1024 x 768 in landscape.\n\n### Controller\n\nA controller works as a second way to play: A advances and chooses, B cancels or stops skipping, Y opens the system menu, X the log, up the quick bar, down advances, R skips, L is auto (the config's page after \u002F before in the menus), ZR fast forwards while held and ZL rewinds. The right stick moves the cursor in the menus as the D-pad does, and the left stick scrolls.\n\n## How it plays\n\n### The opening page\n\nThe game opens on the same page every time, for everyone (`app\u002Fjs\u002Fhome.js`). It is built from the game's art: the mode panel's strip with five of its plates relettered (ABOUT, GITHUB, DOWNLOAD, SAVE DATA, PLAY ONLINE), over Config's inner panel. Each plate shows its own page:\n\n- **ABOUT**: what this project is and how it was made, from decompiling the game to testing the port against it (the sections are in `app\u002Fjs\u002Fwelcome.js`).\n- **GITHUB**: what is in the repository, and a link to it.\n- **DOWNLOAD**: the game as an app that needs no connection. Windows and Android each have what the app needs, how to install it, and its download; macOS and Linux have the steps to build the same app from the source.\n- **SAVE DATA**: that the file is the Nintendo Switch game's own save format, what this browser holds now (scenes, pictures and music as the game's screens count them, the saves made here, the file last imported), four plates: EXPORT SAVES, IMPORT SAVES, REMOVE DATA, which takes an imported file out again, and LOAD 100% SAVE, which warns before it loads (see [Saves](#saves)).\n- **PLAY ONLINE**: what the browser version needs, and the title's PRESS ANY BUTTON. A click or tap on that page, or Enter, starts the game. Browsers play no sound until the page has been clicked, so this press is that click, and the game opens with its sound on. On a touch device the page also says how to play by touch.\n\nIt opens with no tab chosen, showing the game's logo and a line naming the plates, so a stray tap starts nothing. It is skipped only for an address that opens a scene (`?script=...`). An address ending in `#download` opens it on DOWNLOAD.\n\n**In the Android and desktop apps** the same page has four plates: ABOUT, GITHUB, SAVE DATA and PLAY (the site's PLAY ONLINE under the app's name for it). There is no DOWNLOAD. PLAY has the site's three language plates over its prompt, and the app's updates under it: where things stand, the version in use, and a plate that looks again (`app\u002Fjs\u002Fupdate.js`; how an update is fetched and kept is in [web-dev\u002Fandroid\u002FREADME.md](web-dev\u002Fandroid\u002FREADME.md) and [web-dev\u002Fdesktop\u002FREADME.md](web-dev\u002Fdesktop\u002FREADME.md)). What a browser does for the page the app does itself (`app\u002Fjs\u002Fapphost.js`): Export's file goes where the player chooses, Import opens the system's file picker, and a link opens in the system's browser. By touch the four plates are in one row.\n\n### Language\n\nPLAY ONLINE has three plates over its prompt, ENGLISH, 日本語 and 中文 (the L key goes through them too). The choice is kept in the browser; choosing another one loads the page again in it, back on PLAY ONLINE. `?lang=ja`, `?lang=zh` or `?lang=en` in the address chooses it for one visit. The Android and desktop apps are built in English, without `web\u002Fassets\u002Fja` and `web\u002Fassets\u002Fzh`, and have the same three plates on PLAY: the first time 日本語 or 中文 is chosen there, the app asks, with the size, and downloads that language's files from arcueid.date as it downloads an update (Japanese about 104 MB; Chinese, laid over Japanese, 9 MB more). Later updates keep them. An address cannot ask for a language there.\n\n- **English** is the Tsukihimates translation, which the port's files are made from.\n- **Japanese** is the original game: its dialogue, its scripts where the translation rewrote them (241 of the 549), its system messages, scene names, flowchart notes and music titles, its interface art, the pictures with writing on them, and its movies with writing on them (the prologue and the chapter titles; the openings and endings stay the translation's). Only what differs is kept, under `assets\u002Fja\u002F`, listed in `assets\u002Fja\u002Findex.json` (`app\u002Fjs\u002Flang.js`); the picture and system tables are the shared ones with Japanese's few differing entries laid over them.\n- **Chinese** is the Chinese fan patch of the original game (月姬REMAKE汉化补丁 v2.13, by Letdo1945). The patch changes the original's files and none of its code, so the game runs it as it runs Japanese, and here it is laid over Japanese: `assets\u002Fzh\u002F` holds only what the patch shows that Japanese does not (its lines, with the original engine's own rows for them; its system messages, scene names, flowchart notes and music titles; the interface art it redrew; two chapter titles; its three fonts, cut down to the letters it uses), and a file is looked for there first, then under `assets\u002Fja\u002F`, then in the shared files. The pictures with writing on them stay the original's, as in the patched game. The prologue is the original's movie with the patch's Chinese lines set over it as subtitles, at the frames the patch shows them (the patch's own copy of the movie is not used); the openings and endings are the translation's, as in Japanese. Made by `web-dev\u002Ftools\u002Fbuild_zh.py`.\n- **Japanese and Chinese text is set as the original engine sets it**: the game's own face (Chinese: the patch's), 28 cells to a row, rows 81 px apart, furigana centred over their words. Where each row breaks is the engine's own decision, taken from a build of the unpatched executable and written into the text (`web-dev\u002Ftools\u002Fja_rows\u002FREADME.md`); rows, letters and furigana fall within a pixel of the game's frames.\n- **Saves and progress are the same ones in all three.** A save made in one language loads in the other at the same line, which is written again in the language in use (`app\u002Fjs\u002Flangsave.js`), and the Load screen shows its note in the language in use; what has been read, the flowchart and the gallery do not depend on the language.\n- The port's own words (the hint bar's keys, the quick bar's captions, the Controls page, the opening page) stay English, except the hint bar's labels, which take the game's own Japanese or Chinese ones, and in Chinese the Controls page (`app\u002Fjs\u002Fwords.js`).\n\n### Saves\n\n100 save slots, a quick save, and 39 automatic saves. As in the game a save holds the latest checkpoint (a scene's start, a choice, or the first line of a page), so loading shows that page from its first line. The automatic save is made when you return to the title from the system menu (which asks nothing outside a gallery replay), and here also when the page is closed during a story, or the Android app is left, or the desktop app is closed. The save screen lists all 100 slots by number, starting on the lowest empty one. The load screen lists everything there is to load, newest first: the slots in use, the quick save and the automatic saves, each named. Continue loads the save written last. In the story's Save and Load, Left gives the menu's column the cursor and Right gives it back to the row you were on. Some chapters ask \"Save Progress?\"; Yes opens the save screen and the story goes on when it closes.\n\nSaves and progress are kept in the browser, so clearing its site data removes them, and another browser starts empty. A save of an ordinary scene is about 13 KB; the browser allows about 5 MB in all.\n\n**Export, import, remove.** The opening page's SAVE DATA tab lists what the browser holds now and has three plates. The file is the Nintendo Switch game's own save, `savedata000` (4,091,904 bytes; `app\u002Fjs\u002Fgamesave.js` has its layout, read from the game's code). **EXPORT SAVES** (E) writes the settings and progress as a `savedata000` the original game reads. **IMPORT SAVES** (I) loads the settings and progress of a `savedata000`: the flowchart, the pictures and music of the gallery, the opening movies, what has been read, every global variable. The browser's own settings and progress are put aside, not lost, and **REMOVE DATA** takes the imported file out again and puts them back as they were. The saves made in the port (the list, the automatic saves, the quick save) are the browser's own throughout, and the file's 140 save records are not read or written: a file imported and exported again still has its own, byte for byte. The key bindings stay with the browser (`app\u002Fjs\u002Fsavefile.js`). Next to REMOVE DATA is **LOAD 100% SAVE**: pressed, it warns in the game's Yes \u002F No window that it is not recommended and only for those who have finished the game, and on Yes loads a finished game's progress (every scene, picture, song and ending; `app\u002Fjs\u002Ffullsave.js`, made by `web-dev\u002Ftools\u002Fmake_fullsave.py` from a 100% save) the same way, but leaves the settings as they are; REMOVE DATA takes it out again.\n\nOn the very first start (before the prologue has played) the game opens straight on the opening movie, which asks before it can be passed (\"Skip intro video?\"); the title, its cautions and the story follow. After that it starts with the logos and the notice, and New Game goes straight to the story.\n\n### Skipping and rewinding\n\nSkipping waits at text you have not read when Fast forward is \"Read\" (the default) and goes on by itself at read text; on \"Full\" it passes everything. Choices do not turn it off; the Skip key or button does (the pad's B too), and so does opening the system menu.\n\nRewinding (and the log's Quick Jump) goes back up to 800 points in the current session; loading a save starts the trail again. What has been read is kept in the browser from now on, so text read before this existed counts as unread. Quick load asks first, as the game does, and shows the quick save's picture.\n\n### Movies\n\nThe movies are MP4 files with AV1 video (SVT-AV1 at constant quality 24, from the game's H.264) and the game's own AAC sound, copied without re-encoding. Every frame keeps its place and time. All 45 are AV1, 0.42 GB where the game's are 1.76 GB. No movie may be over 95 MB, so that no file in `web\u002F` is too large for a host such as GitHub; one that would be is made at a coarser quality until it fits, which `ed03_ciel` and `op2_ciel` needed.\n\nThe two opening songs cannot be passed the first time they play; after that a click or key asks \"Skip opening animation?\", in the gallery too. The end credits ask \"Skip Outro?\" every time. The prologue asks \"Skip intro video?\" on its first showing and passes without asking after that. Each question starts on No and holds the movie while it is up. The system menu does not open over a movie.\n\n### Ciel-sensei and endings\n\nAfter a bad end the game offers its \"Teach Me, Ciel-Sensei!\" episode: a card, then \"Enter hint corner (No. n)?\". Yes plays the episode and then returns to the title; No returns to the title at once. The Ending List in the gallery lists the episodes begun, and endings reached before this version could play them are counted once from the scenes completed and text read. Rebuild `gallery.json` with `build_gallery.py` to get the list.\n\n## Under the hood\n\n### Loading\n\nNothing waits for the whole game: each file is fetched when it is first used, and the ones that will be needed soonest are fetched before that (`app\u002Fjs\u002Fpreload.js`).\n\n- **From the opening page on.** While the opening page is up (on later visits, while the logo plays) the game fetches, in this order: what the next screen needs (on a first visit the opening's script, picture and movie; later the logo, the title's art and its movie; the interface sounds and the title's music), then the story's own screen (the text window and its marks, the choices, the questions, the quick bar, the fonts, the first scene's pictures and sounds), then the menus (system menu, log, Save, Load, Config, the speech balloons), then the gallery and flowchart art. At most four of these are read at once, so a file the game asks for itself never queues behind them.\n- **As the story runs.** At every message the script is read ahead: the pictures, sound effects, music and voices of the next 300 commands (about a dozen messages), and from 2,500 commands away the movies and the scripts it can jump to, which are read on from where they start. Voices are left out while skipping or switched off.\n- **Movies.** A movie that is coming is given a player of its own, which starts reading the file as a browser reads any movie. When the movie plays, that player takes the place of the page's, so it starts at once from what has been read. Two are kept ready at most. The title's movie is made ready again whenever the title is about to come back (a story's end, Return to Title, the gallery).\n- **Sounds in packs.** The 16,460 voices, 1,284 sound effects and 9 interface sounds are also kept in 658 packs of about 1.5 MB (`assets\u002Fpack`, made by `tools\u002Fbuild_packs.py`): the files end to end as they are, in the order the story first uses them, so the pack with a line's voice has the next lines' too. The game asks for the pack and cuts each sound from it, which is about 27 times fewer requests than a file a sound. A pack is named by a hash of its content, so a browser can keep it for good; `assets\u002Fpack\u002Findex.json` names the index in use. Music and movies are not packed. Where there are no packs, or a pack cannot be read, each sound is read from its own file. The site carries the voices and sound effects as packs alone; the loose files, which `build_packs.py` makes the packs from, come from `convert_all.py` and stay with whoever builds the assets.\n- **After PLAY ONLINE.** On a first visit, pressing PRESS ANY BUTTON brings the game's \"Loading\" window with a count, until what the next screen and the story's first screen use has been read and the first movie can start. It is not shown when that is so already, and it never holds longer than 20 seconds.\n\nWhat has not arrived when it is wanted is fetched then.\n\n### Fonts\n\nSeuratPro and Inter are always used from the page's own files. Every other font is looked for on the system first, in the order given. Where none of a row's fonts is installed, a free backup that ships in `app\u002Ffonts\u002F` is used instead (the last column), so text never falls to a generic face. The backups have names of their own (\"Gelasio Bundled\" and so on), so they never take over from an installed font. They hold Latin, accents and punctuation only: Japanese and symbols come from the system, which always has them. Gelasio has Georgia's widths and Arimo has Arial's, so lines break where they would. Each backup's licence is beside it (SIL OFL, the Ubuntu Font Licence, the GUST Font License). Letters drawn on canvases (the plates, the config's words) wait at start for any backup they will need (`main.js` `CANVAS_FONTS`), and a system that has the fonts fetches nothing.\n\n| Font | Used for | Then | Backup (included) |\n|---|---|---|---|\n| Georgia | The story, choices, the log, Yes \u002F No questions | Times New Roman | Gelasio |\n| SeuratPro M | Speech balloons (`assets\u002Ffonts\u002F`, the game's own) | Georgia | Gelasio |\n| Inter | Gallery lists, Music Player, the hints, Controls page (`app\u002Ffonts\u002F`) | | (included itself) |\n| Helvetica | Flowchart cards, the config's words | Arial | Arimo |\n| Apple Chancery | Chapter names, the story's old-fashioned lettering | Lucida Calligraphy, Monotype Corsiva, URW Chancery L, TeX Gyre Chorus | TeX Gyre Chorus |\n| Hoefler Text | Day numbers beside chapter names | Palatino Linotype, Palatino, Book Antiqua | TeX Gyre Pagella |\n| PT Sans Narrow | The words on the plates | Ubuntu Condensed, Arial Narrow | PT Sans Narrow |\n| Ubuntu Condensed | Chapters on save rows and the flowchart | PT Sans Narrow, Arial Narrow, Roboto Condensed | Ubuntu Condensed |\n| Ubuntu | The day on a save row | Helvetica Neue, Segoe UI | Ubuntu Light |\n| Eurostile | The Audio Track label | Microgramma, DIN Alternate, Bahnschrift | Inter |\n| System font | Scene names in the menus, short notices | | (the system's own) |\n\nThe game itself carries `ja\u002FTT_TsukuMin-D.ttf`, `ja2\u002FTT_TsukuGo-D.ttf`, `ja3\u002FFOT-SeuratPro-M.otf`, `ja3\u002FSeuratPro-M.otf` and `exfont_nx01.bffnt`.\n\n### Opening a particular scene\n\nAdd these to the address:\n\n| | |\n|---|---|\n| `\u002F?script=00_02` | Opens that script by name (capitals matter) |\n| `\u002F?script=89` | The same by its number, 0 to 548 |\n| `\u002F?script=04_00_ARC04_4_1&pc=500` | Runs through to command 500, then plays normally |\n| `\u002F?script=04_00_ARC04_3&label=LBL_008` | Starts at a label inside the script. Nothing before it has run, so the screen stays empty until the scene next draws a picture |\n| `&mute` | No sound at all, with any of these |\n\nScript names start with the day, then 00 for Arcueid's route or 01 for Ciel's: `04_00_ARC04_10`, for one, is the last scene of Arcueid's fourth day. `00_00` to `00_02` are the prologue and `QA_01` to `QA_24` the Teach Me, Ciel-sensei episodes; all 549 are in `assets\u002Fscripts\u002Findex.json`. A scene opened this way starts with the story's flags empty, so one that depends on earlier choices can branch differently than in play. It also skips the opening page, so sound begins at your first click.\n\n## The repository\n\n| Folder | What is in it |\n|---|---|\n| `web\u002F` | The game as served: `app\u002F` (engine, interface, styles, fonts), `assets\u002F` (the game's converted files: not in the repository, see below) and `server.py`. It runs by itself. |\n| `web-dev\u002F` | What makes and checks it: `tools\u002F` (conversions from a game dump), `tests\u002F`, `smoketest\u002F`, `audit\u002F` (the parity audit and the function map), `android\u002F` (the Android app), `desktop\u002F` (the Windows, macOS and Linux app) |\n| `web-research\u002F` | The first size research and its tools ([FINDINGS.md](web-research\u002FFINDINGS.md)) |\n| `tools\u002Fcloudflare\u002F` | The deployment ([below](#deployment)) |\n\nTests, with Node.js and no packages: `node --test web-dev\u002Ftests\u002F*.test.mjs`. Every script at full speed, listing errors: `python3 web-dev\u002Ftools\u002Fdev_server.py 8770`, then open http:\u002F\u002Flocalhost:8770\u002Fsmoketest.html. What the parity audit in `web-dev\u002Faudit\u002F` found and what changed is in [FIXES.md](web-dev\u002Faudit\u002FFIXES.md).\n\n### The files\n\n**Engine (`web\u002Fapp\u002Fjs\u002F`)**\n\n- `vm.js`: script commands\n- `textbox.js`, `audio.js`, `main.js`: text, sound, input and settings\n- `renderer.js`: layers, blur, blend modes, crossfades; `transform.js`: where a layer goes (parents, pivots, panel clips and links)\n- `animation.js`: the game's motion tracks, interpolation and animation clock\n- `effects.js`: screen and layer shake, ambient sway and text shake; `screenfx.js`: the RGB split, speed lines and film grain\n- `random.js`: the game's `rand()`, which a sway and the speed lines draw from\n- `reflow.js`: takes out the English patch's forced line breaks, so the text box wraps the lines itself\n- `preload.js`: what is fetched before it is asked for (see [Loading](#loading))\n\n**Interface (`web\u002Fapp\u002Fjs\u002F`)**\n\n- `ui.js`: the game's screens, drawn with its interface art; `uifx.js`: what moves on them, timed as the original (the title's fade, logo, glow, dust, background and music by progress, the cautions, the system menu's fade, background bands, sparkles and cursor)\n- `home.js`: the opening page; `welcome.js`: its ABOUT tab's text; `gamesave.js`: the original game's save file, read and written; `savefile.js`: the browser's side of its Export and Import\n- `gallery.js`, `unlocks.js`, `endings.js`: the title's GALLERY as the game has it (CG Gallery, Music Player, Flowchart, Movie, Ending List). The CG and music tables are read from the executable; a picture unlocks when it is shown (or by STCG), a track when it is played, a movie when it is played. The Ending List shows an ending or bad end once its \"Teach Me, Ciel-Sensei!\" episode has begun, and plays the episode again ([ANIMATIONS.md](web-dev\u002FANIMATIONS.md#endings-and-ciel-sensei))\n- `flowchart.js`, `flowchart-model.js`: the flowchart, from the game's own rows, links, titles, notes and thumbnails. Scenes appear once played; scenes that every path to a played scene must pass count as played too\n- `chapters.js`: the chapters' days and names, as text; `confart.js`: the config's System page with its words at one size\n- `keys.js`: the keyboard map; `touch.js` with `touch.css`: the touch interface; `touchfx.js`: the ring drawn where the screen is clicked\n\n**Tools (`web-dev\u002Ftools\u002F`)**\n\n- `build_core.py`: scripts, dialogue and tables; `build_images.py`: how large each image needs storing\n- `convert.py`, `convert_all.py`: images to AVIF, voices and music to Ogg Opus without re-encoding, sound effects to Opus, the movies' pictures to AV1 with their sound copied, the balloon font copied\n- `fetch_assets.py`: brings the game's files from the site into `web\u002Fassets` (`web-dev\u002Fassets-manifest.txt` lists them)\n- `needed.py`, `check_assets.py`: what the game can ask for, and whether it is all there; `build_packs.py`: the voices and sounds in packs\n- `build_ui.py`: the game's interface art (and the film grain static; `build_ui.py \"$PWD\" NOISE_PARTS` adds just that; `PARTS`, the start-up notice and cautions from `parts.hed`, likewise)\n- `build_animations.py`, `build_effects.py`: the game's motion tracks and colour effect presets\n- `build_gallery.py`, `build_flowchart.py`, `native_flowchart.py`, `build_system.py`, `build_sounds.py`: the gallery, flowchart and system tables, and the interface's own sounds\n- `build_ja.py`: Japanese, the original game's own files where they differ from the translation's (`assets\u002Fja\u002F`); `ja_rows\u002F`: how the original engine's row breaks were read\n- `decode_save.py`: reads a save of the original game and prints its progress as the web version keeps it\n\n### The game's files\n\nThe game's own files, converted for the browser (pictures, music, voices, movies, scripts, tables: 10,517 files, 2.8 GB), are **not in this repository**. They are copyrighted, and the site serves them from its own storage. What the repository keeps is the list of them, `web-dev\u002Fassets-manifest.txt`: each file's MD5, size and path under `web\u002Fassets`.\n\n```bash\npython3 web-dev\u002Ftools\u002Ffetch_assets.py            # everything, from the site into web\u002Fassets\npython3 web-dev\u002Ftools\u002Ffetch_assets.py --tables   # only the scripts and tables (about 42 MB): enough for the tests\npython3 web-dev\u002Ftools\u002Ffetch_assets.py --check    # downloads nothing; says what is missing or different\n```\n\nA file already there with the listed size and MD5 is left alone, so a run that was stopped goes on where it was. `web\u002Fassets\u002F` is ignored by git. The local server, the tests (`--tables` is enough) and the app builds need the files; each says so when they are missing. The other way to get them is to make them from your own copy of the game, below.\n\n### Making the assets again\n\nOnly if `web\u002Fassets\u002F` has to be rebuilt. From the repository root, with the dump in place, the patch in `mods\u002Fjapan`, the packages in `web-research\u002F.venv` and `ffmpeg` on the path, built with `libsvtav1` (the movies are encoded with it):\n\n```bash\nweb-research\u002F.venv\u002Fbin\u002Fpython -I web-dev\u002Ftools\u002Fbuild_core.py \"$PWD\"\nweb-research\u002F.venv\u002Fbin\u002Fpython -I web-dev\u002Ftools\u002Fbuild_images.py\nweb-research\u002F.venv\u002Fbin\u002Fpython -I web-dev\u002Ftools\u002Fbuild_ui.py \"$PWD\"\nweb-research\u002F.venv\u002Fbin\u002Fpython -I web-dev\u002Ftools\u002Fbuild_flowchart.py\nweb-research\u002F.venv\u002Fbin\u002Fpython -I web-dev\u002Ftools\u002Fbuild_gallery.py \"$PWD\"\nweb-research\u002F.venv\u002Fbin\u002Fpython -I web-dev\u002Ftools\u002Fbuild_system.py \"$PWD\"\nweb-research\u002F.venv\u002Fbin\u002Fpython -I web-dev\u002Ftools\u002Fbuild_sounds.py \"$PWD\"\nweb-research\u002F.venv\u002Fbin\u002Fpython -I web-dev\u002Ftools\u002Fconvert_all.py \"$PWD\" --jobs 6\npython3 -I web-dev\u002Ftools\u002Fbuild_packs.py\npython3 web-dev\u002Ftools\u002Fcheck_assets.py\n```\n\n`convert_all.py` makes what `tools\u002Fneeded.py` lists: what the port can ask for, and nothing it makes for itself, so not the game's pre-blurred pictures. It is safe to stop and resume. `check_assets.py` says whether anything is missing.\n\nThe core build also exports the original engine's motion tracks and colour effect presets (`STEC`). To add them to an existing web copy:\n\n```bash\nweb-research\u002F.venv\u002Fbin\u002Fpython -I web-dev\u002Ftools\u002Fbuild_animations.py \"$PWD\"\nweb-research\u002F.venv\u002Fbin\u002Fpython -I web-dev\u002Ftools\u002Fbuild_effects.py \"$PWD\"\n```\n\nThese need the Japanese port's prepared `data\u002Ftsuki\u002Fanalysis\u002Fmain.bin` and `data\u002Ftsuki\u002Fgen\u002Fmain`; the exporter checks the image's fingerprint before reading its tables. Motion, shake and sway run in the browser; see [ANIMATIONS.md](web-dev\u002FANIMATIONS.md) for command coverage and remaining differences.\n\n## Deployment\n\nThe live version is [arcueid.date](https:\u002F\u002Farcueid.date\u002F). A push to `main` that changes `web\u002F`, `tools\u002Fcloudflare\u002F` or the deployment workflow publishes through GitHub Actions (`tools\u002Fcloudflare\u002Fdeploy.py`); the workflow can also be started from the Actions tab.\n\n**How it is served.** The R2 bucket `tsukirebuild-assets` holds the whole site: the app's files (`web\u002Fapp`) at its root and the game's files under `assets\u002F`. The bucket is the domain's custom domain, so Cloudflare serves it directly, behind its cache. No Worker runs for it, so nothing counts against the Workers request allowance, and a file already in Cloudflare's cache is not read from R2 again. Three rules on the zone (set in the Cloudflare dashboard, not in this repository) make that work:\n\n- a URL rewrite: `\u002F` is the bucket's `index.html` (R2 has no index page of its own);\n- a cache rule: everything from the bucket may be cached, each file for as long as it says;\n- a cache rule: the game's media and the content-named sound packs are kept 30 days, at the edge and in the browser.\n\nEach object is stored with its lifetime: 30 days for the game's media (`assets\u002Fvoice`, `img`, `se`, `bgm`, `movie`, `sys`, `fonts`) and the sound packs and their index in `assets\u002Fpack`, which are named by their content; 5 minutes for `index.html`, the tables and the interface art, so that those follow a deployment by themselves.\n\n**Versioned scripts.** The deployment also stores every app file but `index.html` (scripts, styles, icons, fonts) under `v\u002F\u003Cversion>\u002F`, the version a hash of those files, and the `index.html` it stores loads them from there. Those copies are kept 30 days, since a changed app is a new folder. A page therefore runs only the set of scripts it was published with, never a new `main.js` against an old `vm.js` while caches catch up; earlier versions stay in the bucket for pages still open or still cached. The plain files stay at the bucket's root too. `python3 tools\u002Fcloudflare\u002Fdeploy.py --stage DIR` writes the app as a deployment stores it into a folder, with `assets\u002F` a link to `web\u002Fassets`, to try the site locally. When the lifetime rule changes in `deploy.py`, the next deployment sets it again on every object already stored. A media file converted again reaches players who already have it only when their copy expires: give it a new name if it must arrive at once.\n\n**What the apps update from.** Each deployment also stores `update\u002Fapp.json`: every app file with its size and SHA-256, and, under a name made from its content (`update\u002Fassets-\u003Chash>.txt`), the list of the game's files the apps carry with their MD5 (`web-dev\u002Fassets-manifest.txt` without `ja\u002F`). It is stored after every file it names and before the page. `v\u002F\u003Cversion>\u002F` also gets `index.html` as it is in `web\u002Fapp`, which is the page the apps take. The Android and desktop apps read that description when they open, and download what they were not built with (`web-dev\u002Ftools\u002Fapp_manifest.py` writes it, here and in the app builds; `web\u002Fapp\u002Fjs\u002Fupdate.js` reads it). So a push that changes the app or the manifest reaches installed apps by itself, and the two big downloads need replacing only when the app's own code changes (`SHELL` in `web\u002Fapp\u002Fjs\u002Fapphost.js`).\n\n**The Android app** is not part of the deployment: at 2.8 GB it is too large for the repository, so `android\u002Ftsukihime.apk` is uploaded to the bucket by hand, with the type `application\u002Fvnd.android.package-archive` and `Content-Disposition: attachment; filename=\"Tsukihime.apk\"`. A new build must be signed with the same key, so that it installs over the old one. On this plan Cloudflare does not cache files over 512 MB, so the APK is read from R2 at each download, which costs nothing.\n\n**The earlier address.** [tsukirebuild.pages.dev](https:\u002F\u002Ftsukirebuild.pages.dev\u002F) is a Cloudflare Pages project that forwards to the domain, path and query kept (a `_redirects` file written by the deployment). Its Worker (`web\u002Fcloudflare\u002Fworker.js`) still answers `\u002Fassets\u002F*` from the bucket there. Saves are kept by the browser for each address separately, so progress made at the Pages address does not appear on the domain.\n\n**The deployment** stores the app: it compares file checksums and uploads new or modified app files to the bucket, then publishes the Pages project. Previous objects are kept for open browser sessions and rollbacks; nothing is deleted from the bucket. **The game's files are not part of it**: they are in the bucket under `assets\u002F` and a deployment leaves them alone (it refuses to run if `web\u002Fassets` is tracked again). To change them, whoever has the files runs `python3 tools\u002Fcloudflare\u002Fdeploy.py --assets web\u002Fassets` with R2 credentials: it uploads new and changed assets, deletes nothing, and writes `web-dev\u002Fassets-manifest.txt` again, to be committed. GitHub stores its credential in the encrypted repository secret `CLOUDFLARE_API_TOKEN` and the token's ID in the repository variable `CLOUDFLARE_API_TOKEN_ID`. The credential needs account-level `Pages Write` and `Workers R2 Storage Bucket Item Write` scoped to `tsukirebuild-assets`; update both values when rotating it.\n\n## Credits\n\n- **The game.** The Tsukihime remake, *Tsukihime -A piece of blue glass moon-*, and all of its story, art, music and voices belong to TYPE-MOON, Aniplex and the other rights holders. This project is unofficial and non-commercial, and is not affiliated with or endorsed by them. Please support the official release.\n- **English text.** The English script comes from the Tsukihimates fan translation patch.\n- **Chinese text.** The Chinese script, interface art, fonts and prologue subtitles come from the Chinese fan translation patch 月姬REMAKE汉化补丁 (v2.13), by Letdo1945 and its translators.\n- **Built on.** The native port this grew from is based on the SuperMarioWonderRecomp recompilation framework by BelmanteGu. Ryujinx's shader translator was used offline; Ghidra for decompilation; FFmpeg, SVT-AV1 and Pillow for the conversions.\n- **Fonts.** Inter, Gelasio, Arimo and PT Sans Narrow under the SIL Open Font License; Ubuntu and Ubuntu Condensed under the Ubuntu Font Licence; TeX Gyre Chorus and Pagella under the GUST Font License. Each licence is beside its font in `web\u002Fapp\u002Ffonts\u002F`.\n- **How it was written.** Built with Claude, Anthropic's AI model, under human direction: the goals, the decisions and the playing and judging of every result were human, and most of the code was written by the AI.\n","TsukiREbuild 是一款将视觉小说《月姬 -A piece of blue glass moon-》逆向重构并跨平台重制的开源项目，支持在网页、Windows、Android 及 macOS\u002FLinux 上运行。项目基于 JavaScript 与 WebGL2 重写游戏引擎，原生解析原始脚本、图像、语音、音乐和 AV1 视频，严格对齐原版表现（逐帧校验）。提供多语言支持（日\u002F英\u002F中），本地存档兼容原版格式，并支持离线游玩（Android 版内置全部资源）。适用于希望在现代设备上无障碍体验原版《月姬》重制版的玩家及视觉小说技术爱好者。","2026-11-24 04:44:35","CREATED_QUERY"]