Build System
The TYPE Game Engine is built on top of Electron, providing a desktop application that combines game development tools with runtime execution.
Electron Integration
Current Electron Architecture
Game Runtime Process
The game renderer is where the TYPE engine executes:
Future Editor Integration
A React-based editor is planned for integration with the engine:
Build Process
The TYPE engine uses a dual-configuration build system with Electron and Vite:
Configuration Flow
Build Process Details
electron.vite.config.ts responsibilities:
- Sets up Electron main process compilation
- Configures preload script with security policies
- Prepares renderer process shells
- Manages Electron-specific optimizations
- Coordinates the overall build pipeline
vite.config.ts responsibilities:
- Bundles TypeEngine and sub-engines
- Processes game components and systems
- Handles asset optimization and loading
- Creates game runtime bundle for interpretation
Integration flow:
- electron.vite.config.ts runs first to establish Electron core
- Core setup triggers vite.config.ts for game file processing
- Game files are bundled and made available to Electron core
- Electron core interprets and executes the game bundle
File System Integration
Electron provides secure file system access for project management:
Available Build Commands
Command | Description |
---|---|
pnpm dev | Start development mode with hot reloading |
pnpm build | Build application for production |
pnpm build:linux | Build Linux distributables |
pnpm build:mac | Build macOS distributables |
pnpm build:win | Build Windows distributables |
Development vs Production
Development Mode
- Hot reloading for both main and renderer processes
- Source maps for debugging
- Unoptimized bundles for faster compilation
- Development server for asset serving
Production Build
- Optimized and minified bundles
- Asset optimization and compression
- Code splitting for better performance
- Platform-specific packaging
Build Performance
The dual-configuration system allows for optimal build performance by separating Electron core concerns from game logic bundling, enabling independent optimization strategies.
Security
The build process maintains Electron security best practices with context isolation and secure preload scripts to prevent security vulnerabilities.