Kai Chronicles is a game player for Lone Wolf game books. Books 1 - 29 are playable. The game player can run as a website.
This is a fork from the original "Kai Chronicles" as tonib stopped development in November 2021.
This repository does not contain game books data. Data must be downloaded from the Project Aon web site. REMEMBER that game books data is under the Project Aon license, so:
- You cannot put this application on a public web server (only on your local machine, for your own use). The only place where this game can be published is on the Project Aon web site. It's available here : https://kaichronicles.projectaon.org
- You cannot redistribute the game books data in any way
Download dependencies
npm install
Download the Project Aon game data:
npm run downloaddata
or
npm run downloaddata --url=<repository_URL>
This will require Node.js (any recent version) and the git client on your path.
npm run serve
Open your browser on http://localhost:3000.
Optional method for running a local website only to play the game
- Download and install Docker and make sure it's is in your PATH environment variable
- Using a terminal (Linux or iOS) or PowerShell (Windows 10) navigate to the project's directory
- Type
docker build -t kai:1.18 .
- Type
docker run -p 8080:8080 kai:1.18
- Open http://localhost:8080
More information about this method here
Game rules for each book are located at www/data. "mechanics-X" are the game rules for the book X. "objects.xml" are the game objects
There is (unfinished) documentation for rules, object formats and save game file format.
The game rules implementation are at src/ts/controller/mechanics and www/controller/mechanics.
If you add "?debug=true" to the game URL, some debug tools will appear. You also can use the browser Developer Tools to prepare the Action Chart to test individual sections. For example, in the console you can execute things like:
kai.actionChartController.pick('axe')
kai.actionChartController.increaseMoney(-10)
You can run ESLint with this command:
npm run lint
A "guide" to develop new books can be found at doc/README-developing.md
Kai Chronicles has been extended to act as a PWA. It can be added to the home screen of a mobile phone, or as an app in Windows. The app will continue to function offline due to caching of assets, though the books are not predownloaded, so starting a New Game will fail unless you have already started the book before.
Of course, asset caching complicates development, not least because webpack-dev-server doesn't play nice with the precaching mechanism (GoogleChrome/workbox#1790). Therefore, the caching and PWA functionality should be disabled while developing.
If you want to specifically develop PWA features:
- Comment out:
if (environment !== EnvironmentType.Development)
in app.ts - Make your changes to the app
- Run:
npm run predist
to regenerate the service worker code - Run a dedicated http server other than webpack-dev-server:
npx http-server ./www
- Open the app at:
http://localhost:8080
After finishing, be sure to reverse the change from step 1 before committing changes. Hopefully this process can be improved in the future, but there shouldn't be frequent changes to the PWA functionality.
Tests are run with Selenium Web Driver and Jest. Currently tests will run only with Chrome, and Selenium will need a "browser driver". See https://www.selenium.dev/documentation/en/webdriver/driver_requirements for installation instructions. Tests are located at src/ts/tests. Be sure Typescript for node.js is compiled before running tests:
npm run test
npm run dist
This will create a dist folder ready to be published on a web server.
GPLv3 (see LICENSE file). This application uses the following third-party code / resources:
- The HTML rendering, books XML processing and Project Aon license HTML contains code taken from Lone Wolf Adventures, by Liquid State Limited
- The Lone Wolf logo and splashes are taken directly, or adapted, from the Spanish Project Aon
- Button icons are create by Delapouite, Lorc and Willdabeast, and distributed from http://game-icons.net/ (CC License)
- Bootstrap (MIT)
- Toastr (MIT)
- FileSaver.js (MIT)
- jQuery (jQuery license)
- xml.js, code taken from http://syssgx.github.io/xml.js/ (CC License)