Visualizer for the Cadre AI game framework.
Viseur is a single page application that is accessed via web browser. It is basically a glorified log file viewer, and parses gamelogs and makes pretty graphics showing to humans what happend in that log.
Note: A pre-built version of the master branch is hosted at https://vis.siggame.io/.
- Playback of gamelogs from local files, or remote sources
- Games rendered via WebGL
- A single Viseur instance can have multiple game "modules" to be able to parse and playback different games, much like all Cadre applications
- Supports spectator mode for all games out of the box
- Developers can code UIs for to make any Cadre game human playable
- Nifty transitions to look sweet
- All settings customizable to end users and settings persist between page reloads
Viseur is a TypeScript application modeled off Node.js design paradigms, with CSS and HTML heavily utilized.
- TypeScript: wrapped up by Webpack to allow a Node.js like runtime environment.
- CSS: SASS (Syntactically Awesome Style Sheets). It's all valid CSS3, but with the hotness SASS brings in.
- HTML: Still raw HTML (no Jade or something like that), but we use Handlebars to template the HTML.
- JSDoc documentation: All code documented using JSDoc style for proper documentation generation.
Before building, you must have Node/NPM installed. That is the only requirement to build, though we do have suggested IDEs below.
- Install Node.js: download and install Node.js. Node comes with NPM (Node Package Manager) so that covers all the software you need to install normally, everything else from this point on is done via Node stuff.
- Clone this repo using git: In whatever directory you want to work out of do
git clone https://github.com/siggame/Viseur.git
- Install Viseur dependencies: navigate to the
Viseur
directory you just cloned and then runnpm install
. This reads the package.json file and downloads all the modules it requires. If that file is ever changed, just re-runnpm install
. - Statup the development server using
npm start
- In browser, go to
https://localhost:8080
.
- Type: 'npm run lint' to run the linter
- If you get CRLF and LF error run 'npm run fix' then repeat step 1
- Fix errors and repeat step 1 on ward until format is correct before you commit
- commit
The travis file is setup to automatically build and deploy the visualizer assets to the gh-docs
branch so they can be served to https://vis.siggame.io/. Generally this is the only way you should
Never deploy Viseur using npm start
, as that starts up a webpack-dev-server, which listens for file changes and rebuilds webpack.
Instead, the whole point of webpack is to build all our sources into a few files so browsers do not need to make >100 HTTP Requests for all our files.
Run npm run build
.
Grab all the files in the index of Viseur, and serve them via some simple HTTP file server. http-server works well for this.
You are free to use whatever development environment you want to work in Viseur, but we do have a recommended one.
With the following extensions:
Those tools will help analyze your code and catch errors early, before you find them in run time.
Open the root directory you cloned down (Viseur) in VSC, and it will know everything else to setup and run correctly.
With VSC installed you can use the integrated terminal to follow the above build steps, while the IDE analyzes your code for errors as you type!