A browser-based behavior tree editor with Monaco integration, built with TypeScript, HTML, and CSS.
https://otdavies.github.io/WebBehaviorTree/
- Visual behavior tree editor with drag-and-drop interface
- Monaco code editor for custom node logic
- Real-time execution and debugging
- Import/Export JSON functionality
- Blackboard system for shared state
- Node.js 20 or higher
- npm
# Install dependencies
npm install
# Build TypeScript
npm run build
# Run tests
npm test
# Serve locally
npm run serveThen open http://localhost:8080 in your browser.
npm run build- Compile TypeScript to JavaScriptnpm run watch- Watch for changes and rebuildnpm run test- Run tests in watch modenpm run test:run- Run tests oncenpm run test:coverage- Run tests with coverage reportnpm run serve- Start local Python HTTP server
This project is configured to automatically deploy to GitHub Pages on every push to the main branch.
After cloning/forking this repository:
- Go to your repository's Settings
- Navigate to Pages (in the left sidebar)
- Under Source, select GitHub Actions
- The workflow will automatically deploy on the next push to
main - Your site will be available at:
https://<username>.github.io/<repository-name>/
The deployment workflow:
- Installs Node.js and dependencies
- Builds the TypeScript code
- Deploys to GitHub Pages
See .github/workflows/deploy.yml for the full workflow configuration.
.
├── src/ # TypeScript source files
│ ├── actions/ # Action-related code
│ ├── core/ # Core behavior tree logic
│ ├── editor/ # Editor functionality
│ ├── nodes/ # Node implementations
│ ├── state/ # State management
│ ├── ui/ # UI components
│ └── utils/ # Utility functions
├── styles/ # CSS stylesheets
├── tests/ # Test files
├── dist/ # Compiled JavaScript (generated)
├── index.html # Main HTML file
└── package.json # Node.js dependencies and scripts
MIT