Project Overview

Poi Plugin Battle Replay is a sophisticated plugin for the Poi browser that enables KanColle players to record, analyze, and replay their naval battles with detailed combat data visualization.
The project provides a comprehensive battle replay system for:
- Battle Recording: Automatic capture and storage of battle data from KanColle API responses
- Data Conversion: Seamless conversion between Poi and KC3Kai battle data formats
- Replay Visualization: Interactive battle replay interface with detailed combat animations
- Data Analysis: Comprehensive battle statistics and performance metrics
Key Innovation
What makes this project particularly interesting is its integration of steganography techniques for data encoding, real-time battle data processing, and seamless compatibility with multiple KanColle browser platforms, providing players with unprecedented insight into their naval combat performance.
System Architecture
Poi Plugin Battle Replay employs a modular Electron-based architecture that integrates deeply with the Poi browser's plugin system.
Core Components
Component | Purpose | Key Features |
---|---|---|
converter.js |
Data format conversion | Poi to KC3Kai format translation, fleet data processing |
steganography.js |
Data encoding and hiding | Image-based data storage, secure message encoding |
generateImage.js |
Visual data generation | Battle replay image creation, data visualization |
index.html |
User interface | Battle replay viewer, data management interface |
preload.js |
Electron integration | Browser window management, API communication |
Design Patterns
- Plugin Architecture: Modular design for easy integration with Poi browser
- Data Pipeline: Stream-based processing of battle data from capture to visualization
- Internationalization: Multi-language support through i18n framework
- Steganographic Storage: Secure data hiding within image files
Key Features
1. Battle Data Capture
Comprehensive battle data collection and processing:
- Real-time Recording: Automatic capture of battle API responses
- Data Compression: GZIP compression for efficient storage
- Timestamp Management: Precise battle timing and chronological organization
- Fleet Information: Complete ship and equipment data preservation
2. Data Format Conversion
Seamless interoperability between different KanColle tools:
- Poi to KC3Kai: Automatic conversion for cross-platform compatibility
- Fleet Data Mapping: Accurate translation of ship and equipment information
- Battle Structure: Preservation of combat phases and node information
- Support Fleet: Handling of node and boss support data
3. Interactive Replay System
Advanced battle replay visualization:
- Visual Replay: Animated battle sequences with ship movements
- Combat Details: Detailed damage calculations and hit/miss tracking
- Speed Control: Adjustable replay speed and pause functionality
- Battle Statistics: Comprehensive performance metrics and analysis
4. Steganographic Data Storage
Advanced data hiding and security features:
- Image Encoding: Battle data hidden within image files
- Secure Storage: Data protection through steganographic techniques
- Data Recovery: Robust extraction and reconstruction of hidden information
- Format Flexibility: Support for multiple image formats and encoding schemes
Usage Examples
Plugin Installation
# Install through Poi's plugin manager
npm install poi-plugin-sunny-replay
# Or install directly from GitHub
git clone https://github.com/Aravind-Sundararajan/poi-plugin-battle-replay.git
# Enable plugin in Poi settings
# Navigate to Settings > Plugin > Sunny's Battle Replay
Battle Data Management
// Battle data conversion
var converter = require("./converter");
// Convert Poi battle data to KC3Kai format
var battleJSON = JSON.parse(content);
var outputData = converter.convert(battleJSON);
// Generate replay visualization
var replayData = {
"sortie_id": 1,
"battles": [outputData],
"fleet": fleetData
};
Steganographic Encoding
// Encode battle data in image
var steganography = require("./steganography");
// Hide battle data in image file
var encodedImage = steganography.encode(
battleData,
baseImage,
{
"t": 3,
"threshold": 1,
"codeUnitSize": 16
}
);
// Extract hidden data from image
var extractedData = steganography.decode(encodedImage);
Technical Implementation
Technology Stack
Poi Plugin Battle Replay is built using modern web technologies with deep integration into the Electron ecosystem:
- Electron: Cross-platform desktop application framework
- Node.js: Server-side JavaScript runtime for data processing
- jQuery: DOM manipulation and event handling
- Lodash: Utility library for data manipulation
- i18n-2: Internationalization framework for multi-language support
Performance Optimizations
Optimization | Implementation | Benefit |
---|---|---|
Data Compression | GZIP compression for battle data storage | Reduced storage requirements and faster loading |
Lazy Loading | On-demand battle data loading and processing | Improved memory usage and startup performance |
Steganographic Storage | Efficient data hiding within image files | Secure data storage with minimal size overhead |
Modular Architecture | Component-based design for maintainability | Easier updates and feature additions |
Dependencies
- fs: File system operations for data storage
- lodash: Utility functions for data manipulation
- math: Mathematical operations for steganography
- path: File path manipulation utilities
- react: User interface components (v16.12.0)
- zlib: Data compression and decompression
Plugin Configuration
{
"poiPlugin": {
"title": "Sunny's Battle Replay",
"description": "Show battle replay",
"icon": "fa/video-camera",
"priority": 12
},
"windowOptions": {
"width": 1600,
"height": 900
}
}
Internationalization
Multi-language support for global KanColle community:
- English (en-US): Primary interface language
- Chinese (zh-CN): Traditional Chinese support
- Japanese (ja-JP): Native language support
- Extensible Framework: Easy addition of new languages