System requirements
G3Engine runs in the browser and requires Node.js for local development.Node.js
Version 20 or higher
Package manager
npm, yarn, pnpm, or bun
Browser
Chrome, Firefox, Safari, or Edge (WebGL 2.0 support)
OS
macOS, Windows, or Linux
G3Engine uses Three.js WebGL rendering. Make sure your browser supports WebGL 2.0. Most modern browsers do.
Clone the repository
Clone from GitHub
Clone the G3Engine repository to your local machine:The
app directory contains the Next.js application.Install dependencies
Install all required packages using your preferred package manager:This installs:
- Next.js 16.1.6 - App Router framework
- React 19.2.3 - UI library
- Three.js 0.183.2 - 3D rendering engine
- @react-three/fiber 9.5.0 - React renderer for Three.js
- @react-three/drei 10.7.7 - Useful helpers for R3F
- @xyflow/react 12.10.1 - Visual scripting nodes
- Zustand 5.0.11 - State management
- Solana Web3.js - Blockchain integration
- TypeScript 5 - Type safety
Project structure
Understand the key directories and files:Key dependencies explained
Three.js ecosystem
- three - Core 3D rendering library
- @react-three/fiber - React renderer for Three.js (declarative 3D)
- @react-three/drei - Helpers like
OrbitControls,TransformControls,Grid,GizmoHelper
Visual scripting
Blockchain
State management
- Scene graph (objects, materials, transforms)
- Editor state (play mode, transform mode, selection)
- History (undo/redo)
- Web3 state (wallet connection, network)
- AI chat state
Development scripts
Thepackage.json includes these scripts:
Available commands
npm run dev
npm run dev
Starts the Next.js development server with hot module replacement.
- Runs on
http://localhost:3000 - Auto-reloads on file changes
- Shows detailed error messages
- Fast Refresh for React components
npm run build
npm run build
Creates an optimized production build.
- Compiles TypeScript
- Bundles and minifies JavaScript
- Optimizes images and assets
- Generates static pages where possible
- Outputs to
.next/directory
npm run start
npm run start
Starts the production server.
- Requires running
npm run buildfirst - Serves the optimized build
- Runs on
http://localhost:3000by default
npm run lint
npm run lint
Runs ESLint to check code quality.
- Uses
eslint-config-nextrules - Checks TypeScript types
- Reports warnings and errors
TypeScript configuration
G3Engine uses TypeScript for type safety. Thetsconfig.json is configured for Next.js:
@/* path alias lets you import like:
Troubleshooting
Port 3000 already in use
Port 3000 already in use
If port 3000 is occupied, Next.js will prompt you to use a different port. You can also specify a custom port:
Module not found errors
Module not found errors
If you see “Module not found” errors, try:
- Delete
node_modules/andpackage-lock.json - Run
npm installagain - Restart the dev server
WebGL context lost
WebGL context lost
If you see “WebGL context lost” in the console:
- Close other browser tabs using GPU
- Update your graphics drivers
- Try a different browser
- Reduce scene complexity (fewer objects)
TypeScript errors
TypeScript errors
If TypeScript shows errors but the app runs:
- VS Code may be using the wrong TypeScript version
- Press
⌘⇧P(Mac) orCtrl+Shift+P(Win) - Type “TypeScript: Select TypeScript Version”
- Choose “Use Workspace Version”
Next steps
Now that your environment is set up:Build your first scene
Follow the quickstart to create a simple 3D game
Understand the editor
Learn about panels, tools, and keyboard shortcuts
Explore the API
Deep dive into the technical architecture
Configure Web3
Set up Solana and EVM wallet integration