Status: ~93% Complete | Backend: 100% β | UI: 93% β
A complete TypeScript conversion of the Adobe AIR/Flash-based ObjectBuilder application for OpenTibia object editing.
Built with: TypeScript, React, Electron, Node.js
- Node.js 18+
- npm or yarn
- TypeScript 5.0+
npm installnpm run build# Start Electron application (desktop app with UI) β USE THIS TO RUN THE APP
npm run start:electron
# Start backend only (keeps running, for testing)
npm start
# Start CLI interface (interactive)
npm run cli
# Development mode (watch backend)
npm run dev
# Development mode (Electron with hot reload)
npm run dev:electronNote: To run the desktop application, use npm run start:electron. The npm start command runs the backend only (useful for testing).
object-builder/
βββ actionscript-blueprint/ # β οΈ ORIGINAL ACTIONSCRIPT CODE (Reference Only)
β βββ README.md # See this folder's README for details
βββ src/ # Backend TypeScript code
β βββ main.ts # Application entry point
β βββ cli.ts # CLI interface
β βββ ob/ # Object Builder specific
β β βββ commands/ # Command pattern (39 commands)
β β βββ workers/ # Background processing
β β βββ settings/ # Settings management
β β βββ utils/ # Utilities
β βββ otlib/ # Open Tibia library
β βββ core/ # Core classes
β βββ things/ # Thing type system
β βββ sprites/ # Sprite system
β βββ storages/ # Storage implementations
β βββ loaders/ # File loaders
βββ electron/ # Electron main process
β βββ main.ts # Main process
β βββ preload.ts # Preload script
βββ ui/ # React UI
β βββ src/
β βββ components/ # React components
β βββ contexts/ # React contexts
β βββ services/ # Services
β βββ hooks/ # Custom hooks
βββ dist/ # Build output
The actionscript-blueprint/ folder contains the original ActionScript source code from the Adobe AIR version. This folder serves as a reference blueprint for the TypeScript conversion and should be used when:
- Implementing new features or fixing bugs
- Understanding the original architecture
- Ensuring feature parity
See actionscript-blueprint/README.md for more details.
-
Complete Backend System
- File operations (create, load, merge, compile, unload)
- Thing operations (new, update, import, export, replace, duplicate, remove, find, optimize, convert)
- Sprite operations (new, add, import, export, replace, remove, find, optimize)
- Image encoding (PNG, JPEG, BMP, GIF)
- File saving with progress tracking
-
Storage & Data Management
- Version storage (XML-based)
- Sprite dimension storage
- Thing type storage (with metadata readers/writers for all client versions)
- Sprite storage (with compression support)
- Settings persistence
-
File Format Support
.datfiles (metadata) - All client versions (1-6).sprfiles (sprites) - All client versions.obdfiles (Object Builder Data) - With LZMA compression.otfifiles (Object Builder File Info) - JSON/OTML format
-
Utilities
- Client merger
- Sprite optimizer
- Frame durations optimizer
- Frame groups converter
- Sprite finder
- UI Enhancements - Enhanced sprite rendering, animation support
- Additional Dialogs - Find, Import/Export dialogs
- Testing - Comprehensive test suite
- Backend System - 100% complete
- UI Framework - React 18 with Electron
- Core Components - Main window, panels, editor, dialogs
- Electron Integration - Menu, file dialogs, window management
The CLI provides an interactive interface for testing backend functionality:
npm run clistatus- Show application statuscreate <dat> <spr>- Create new project filesload <dat> <spr>- Load existing project filescompile- Compile current projectunload- Unload current projectgetthing <id> <cat>- Get thing by ID and categorylistthings <cat>- List things in category (item/outfit/effect/missile)help- Show help messageexit- Exit the CLI
OB> status
OB> load C:\path\to\Tibia.dat C:\path\to\Tibia.spr
OB> listthings item
OB> getthing 100 item
OB> compile
OB> exitThe application uses a command pattern for worker communication:
UI/CLI β WorkerCommand β WorkerCommunicator β ObjectBuilderWorker β Storage/Operations
- ObjectBuilderWorker: Main background processing class
- WorkerCommunicator: Handles command routing and communication
- WorkerCommand: Base class for all commands
- ThingTypeStorage: Manages thing types (items, outfits, effects, missiles)
- SpriteStorage: Manages sprite data
- VersionStorage: Manages client version information
- SpriteDimensionStorage: Manages sprite dimension configurations
- Supports client versions 1-6
- Version-specific metadata readers/writers
- Extended attributes support
- Transparency support
- Improved animations support
- Frame groups support
- All client versions supported
- Compression support
- Sprite indexing and management
- LZMA compression
- Version 1-3 support
- Complete thing data serialization
Settings are stored in OS-specific directories:
- Windows:
C:\Users\<username>\.objectbuilder\settings\ - Linux/Mac:
~/.objectbuilder/settings/
Settings file: ObjectBuilderSettings.otcfg (JSON format)
- Objects list amount: 100
- Sprites list amount: 100
- Language: en_US
- Default frame durations: 100ms for all categories
# Compile TypeScript
npm run build
# Watch mode
npm run dev- TypeScript strict mode enabled
- EventEmitter for event handling
- Node.js fs for file operations
- sharp/canvas for image processing
- xml2js for XML parsing
- lzma-native for compression
- Create command class in
src/ob/commands/ - Register callback in
ObjectBuilderWorker.register() - Implement callback method in
ObjectBuilderWorker - Add CLI command if needed in
src/cli.ts
Main worker class that handles all background processing.
Key Methods:
createNewFilesCallback()- Create new project filesloadFilesCallback()- Load existing filescompileAsCallback()- Compile projectnewThingCallback()- Create new thingupdateThingCallback()- Update existing thingimportThingsCallback()- Import thingsexportThingCallback()- Export thingoptimizeSpritesCommand()- Optimize sprites
ThingTypeStorage
load(filePath)- Load from .dat filecompile(filePath)- Compile to .dat filegetThingType(id, category)- Get thing by IDaddThing(thing)- Add new thingreplaceThing(thing)- Replace existing thing
SpriteStorage
load(filePath)- Load from .spr filecompile(filePath)- Compile to .spr filegetSprite(id)- Get sprite by IDaddSprite(pixels)- Add new spritereplaceSprite(id, pixels)- Replace sprite
Use the CLI interface to test functionality:
npm run cli(To be implemented)
Settings not loading:
- Check that
~/.objectbuilder/settings/directory exists - Verify file permissions
File operations failing:
- Check file paths are correct
- Verify file permissions
- Ensure files are not locked by another process
Worker not responding:
- Check console for error messages
- Verify all dependencies are installed
- Check that TypeScript compiled successfully
MIT License - See LICENSE file for details
Original ActionScript/AIR version by https://github.com/Mignari. TypeScript conversion by ChatGPT and Siz.
- Original Repository
- π Documentation -
β οΈ READ ALL DOCS BEFORE WORKING - Complete documentation guide - Documentation Index - All documentation files
- Development Guide - Development setup
- Architecture - System architecture
- Current Status - Detailed status
- Project Status - Overall progress
- Backend conversion (100% complete)
- React UI framework integration
- Electron desktop app
- Core UI components
- Dialog system
- Enhanced sprite rendering
- Animation support
- Comprehensive test suite
- Performance optimization
- Additional utility dialogs