Getting Started
hizi engine has two main workflows depending on your role. You may need one or both.
Generating Output Files
If you're building a game engine that produces simulation results, you need hizi engine generator to convert those results into JSONL output files.
typescript
import { HiziEngineGenerator } from '@hizi.io/engine-generator';
const generator = new HiziEngineGenerator();
await generator.start('./output/');
// Record each simulation outcome
await generator.addResult({ grid: visibleSymbols }, { win, metaTags: ['big-win'] });
// Finalize the output files
await generator.end();Start here:
- Core Concepts - Understand entries, weights, scenarios, and metaTags.
- Generator Quick Start - Generate your first output files.
- Slot Game Example - Complete working example with free spins.
Frontend Integration
If you're building a game frontend that plays against a running hizi engine, you need the hizi engine SDK.
typescript
import { login, loadConfig, placeBet, collect } from '@hizi.io/engine-sdk';
const { token, backendURL } = (await login({ loginURL, launchToken })).result;
const config = (await loadConfig({ backendURL, token })).result.config;
const result = (await placeBet({ backendURL, token, stake: config.stakes[0] })).result.result;WARNING
This snippet skips error handling for brevity. Every SDK call returns a TNetworkResponse - always check response.success before accessing result. See Error Handling.
Start here:
- SDK Quick Start - Install the SDK and make your first API calls.
- Game Flow - Implement the complete game lifecycle.