Giter VIP home page Giter VIP logo

felinesystem2's Introduction

icon FelineSystem2

An open source remake of the CatSystem2 visual novel engine.

Demo

A makeshift demo of the current version can be found here.

screenshot

Controls

Click/Scroll - Advance text

Ctrl/Enter - Advance text, hold to skip

SPACE - Hide message window

f - Toggle fullscreen

1-9 - Select choice

Shift + Alt + 1-9 - Quick save to slot 1-9

Shift + 1-9 - Quick load from slot 1-9

Features

  • Multi-platform (WASM, Windows SDL2)
  • Raw KIF archive decryption
  • HG-3 image decoding and caching
  • Custom-built CatScene recursive-descent parser

KIF Database Structure

FelineSystem2 implements a custom database of the game's KIF archives and assets, stored as a binary file.

Archive Table

Data Type Value Description
char[len] ArchiveName NULL-terminated filename of the KIF archive
uint32 EntryCount Number of entries in archive
unsigned char IsEncrypted 0x01 if archive is encrypted, 0x00 otherwise
byte[4] FileKey Blowfish key for decrypting entries (Only exists if IsEncrypted is 0x01)
0x00 TableEnd Signifies end of table

Archive Item Entry

Data Type Value Description
char[len] FileName NULL-terminated deobfuscated filename
uint32 Offset The offset to the entry's data
uint32 Length The length of the entry's data

Notes

Parser

  • If statements must contain a whitespace after the closing parenthesis of the condition
    • if (#300==0) #(950+#300)=512
  • Operators follow C-Style left-to-right precedence and associativity
  • Integers and strings are the only data types that exist
    • #300=0
    • str 50 bg02
  • Variable names can only be integers
  • Variable names can be dynamically evaluated
    • #(950+#300)=512

Script

  • blend argument specifies the alpha value that the image will be displayed at
    • cg 0 blend 255 will display a completely opaque CG while cg 0 blend 0 will display a completely transparent CG
  • rdraw command after an image specifies the duration to fade to the target opacity
    • rdraw 30 will take 30 frames to fade the image from alpha 0 to the target alpha (e.g. 255 by default)
    • Units are likely in frames at 60fps (0.0167s/frame) regardless of the game's refresh rate setting
    • An rdraw command will apply to all images within a script block (from a user input to the next wait command)
  • wait command without arguments will block until any time-based command completes
    • wait after a rdraw 30 command will wait for the 30 frames taken to completely fade in the images before proceeding to the next command
  • wait with arguments behaves differently from standalone wait
    • wait 60 will block for 60 frames before proceeding to the next command
    • wait 60 will not be aware of any time-based commands like rdraw and will not block until rdraw completes
    • wait is sometimes used along with wait 60 consecutively
  • cg 0 attr 1 (70+0) (80+0)
  • cg 0 attr 2 (75+0) (85+0)
    • Assigns the BaseX, BaseY values of the specified image cg 0 to the variables #(75+0) and #(85+0) respectively

Special Thanks

felinesystem2's People

Contributors

kokseen1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

felinesystem2's Issues

fg implementation is wrong

fg uses coordinates from the attr command, but the values from attr 1 is unknown.

  • cg 4 attr 1 (70+4) (80+4)
  • cg 4 attr 2 (75+4) (85+4)

When fg is used, text is hidden unintentionally for a short moment due to separate sections. This is a text hiding/showing logic problem.

Handle looping animations

	wait
	bgm 0 bgm03
	se 0 loop se152b
	se 0 fade 0 50 50
	pl 1 blend 0
	pl 2 blend 0
	eg 1 parts_gaitou 512 288 0 1
	eg 2 parts_gaitou 512 288 0 2
	pl 1 rot 0 0 90
	pl 2 rot 0 0 90
	wait
	pl 1 move 0 0-512 576+144
	pl 2 move 0 0-2560 576+720
	wait
	bg 1 bg15 0 0-288 0 0
	bg 2 bg15_d 0 0+288 0 0
	bg 1 mcarc 900 0 360 0 32 0
	bg 2 mcarc 900 0 360 0 32 0
	wait
	pl 1 blend 255
	pl 2 blend 255
	pl 1 mcmove 200 1024+2560 288-720
	pl 2 mcmove 200 1024+512 288-144
	pl 1 mcscalecos 200 200 200 0% 0% 0% 100% 100% 100%
	pl 2 mcscalecos 200 200 200 100% 100% 100% 0% 0% 0%
	wait

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.