IDApTIK is a browser-based hacking/network simulator game built with ReScript and PixiJS. It combines platformer gameplay with realistic network simulation, where players interact with devices (laptops, routers, servers, cameras) and use terminal/SSH mechanics to navigate networks.
npm run dev # Start development (ReScript watcher + Vite dev server)
npm run build # Production build (ReScript compile + Vite build)
npm run res:build # Compile ReScript only
npm run res:dev # ReScript watch mode only
npm run res:clean # Clean ReScript build artifacts
npm run lint # ESLint on TypeScript files
npm run dev:vite # Vite dev server only (without ReScript watcher)Dev server runs on port 8080.
- ReScript - Primary language for game logic, compiles to
.res.mjsfiles - PixiJS 8 - 2D WebGL rendering engine
- Vite - Build tool and dev server
- @pixi/sound - Audio (BGM/SFX)
- @pixi/ui - UI components
- motion - Tweening/animation library
- AssetPack - Asset pipeline (raw-assets/ -> public/assets/ + src/manifest.json)
src/
├── Main.res # Entry point
├── manifest.json # Generated by AssetPack (do not edit)
├── app/
│ ├── devices/ # Network device simulations
│ │ ├── types/ # Device type definitions
│ │ ├── LaptopGUI.res # Main terminal/filesystem interface
│ │ ├── LaptopState.res # Filesystem & process manager (Gq storage model)
│ │ ├── NetworkManager.res
│ │ └── DeviceFactory.res
│ ├── screens/ # Game screens (navigation targets)
│ │ ├── WorldScreen.res # Platformer world with device interaction
│ │ ├── LoadScreen.res # Loading screen
│ │ └── main/MainScreen.res
│ ├── player/ # Player character (physics, input, graphics)
│ ├── popups/ # Modal overlays
│ ├── ui/ # UI components (Button, Label, RoundedBox)
│ └── utils/UserSettings.res
├── engine/ # Core game engine
│ ├── Engine.res # Main orchestrator
│ ├── navigation/Navigation.res # Screen/popup stack management
│ ├── audio/Audio.res # BGM & SFX management
│ └── resize/Resize.res # Responsive canvas
└── bindings/ # JavaScript FFI bindings
├── Pixi.res # Extensive PixiJS bindings
├── PixiSound.res
├── PixiUI.res
└── Motion.res
Screen Navigation: Screens define lifecycle methods (prepare, show, hide, pause, resume, update, resize). Navigation.t manages a stack of screens/popups with asset preloading.
Device System: DeviceTypes.device interface with getInfo() and openGUI(). Factory pattern via DeviceFactory.res. Security levels: Open, Weak, Medium, Strong.
Network Topology: Star topology with central router. Features DNS resolution, traceroute, SSH between devices, zone-based layout (LAN, VLAN, External).
State Management: Functional with immutable records; mutable fields only where necessary. LocalStorage for persistence via engine/utils/Storage.res.
- Main.res creates Engine instance
- Engine initializes PixiJS Application and loads assets
- LoadScreen shown, then WorldScreen
- Player character navigates platformer world, interacts with devices
Raw assets in raw-assets/ are processed by AssetPack (via custom Vite plugin in scripts/assetpack-vite-plugin.ts) into public/assets/ with manifest at src/manifest.json. Assets are loaded by bundle name.
- Files compile to
.res.mjsalongside source - Module namespaces pattern:
module ModuleName = { ... } - FFI bindings in
src/bindings/wrap external JS libraries - Use
@rescript/corefor standard library