A JavaFX-based Civil War military command simulation application that provides tactical order generation and decision-making tools for military history enthusiasts, educators, and game developers.
- Overview
- Features
- Screenshots
- Installation
- Usage
- Project Structure
- Development
- Testing
- Contributing
- Roadmap
- License
Civil War General is a desktop application that simulates military command decision-making during the American Civil War period. The application currently focuses on Stage 1 functionality: a command selection tool that randomly generates tactical orders from a predefined set of Civil War era military commands.
The long-term vision includes AI-driven tactical decision-making based on:
- General attributes and experience
- Real-time battlefield conditions
- Troop state and morale
- Supply situation and logistics
- Historical accuracy and tactical doctrine
- Random Command Generation: Intelligent selection from predefined tactical orders
- Order Management: Load, validate, and manage military commands from JSON files
- Interactive UI: Clean, military-themed JavaFX interface
- Order History: Session-based tracking of generated commands
- Data Validation: Comprehensive order integrity checking
- Extensible Architecture: Designed for future AI integration
- Attack Forward - Direct frontal assault tactics
- Attack Flank - Flanking maneuver operations
- Defend Forward - Defensive positioning strategies
- Retreat Backward - Tactical withdrawal procedures
Screenshots will be added as the UI is developed and refined.
- Java Development Kit (JDK) 23
- Maven 3.9 or higher
- Git (for cloning the repository)
-
Clone the repository
git clone https://github.com/dev-ricks/Civil-War-General.git cd Civil-War-General -
Build the project
mvn clean compile
-
Run the application
mvn javafx:run
When running tests in an IDE, you may need to add VM options to allow reflection across module boundaries:
--add-opens com.devricks.civilwargeneral/com.devricks.civilwargeneral=ALL-UNNAMED
--add-opens com.devricks.civilwargeneral/com.devricks.civilwargeneral.orders=ALL-UNNAMED
--add-opens com.devricks.civilwargeneral/com.devricks.civilwargeneral.ai=ALL-UNNAMED
--add-opens com.devricks.civilwargeneral/com.devricks.civilwargeneral.controllers=ALL-UNNAMEDmvn clean package
java -jar target/Civil-War-General-1.0-SNAPSHOT.jar-
Launch the Application
- Run the application using Maven or the executable JAR
- The main window (800x600) will appear with the Civil War General interface
-
Generate Commands
- Click the "Generate Command" button to randomly select a tactical order
- Generated orders appear in the command history list
- Each order displays the command name and detailed description
-
View Command History
- All generated commands for the current session are displayed in the scrollable list
- Orders include tactical details and strategic context
The application loads default orders from src/main/resources/com/devricks/civilwargeneral/default-orders.json. You can modify this file to add custom tactical orders following the JSON schema:
{
"name": "Command Name",
"description": "Detailed tactical description",
"id": 1
}Civil-War-General/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/devricks/civilwargeneral/
│ │ │ ├── CivilWarGeneral.java # Main application entry
│ │ │ ├── ai/
│ │ │ │ └── CommandSelector.java # Order selection logic
│ │ │ ├── controllers/
│ │ │ │ ├── MainView.java # Main UI controller (View)
│ │ │ │ ├── MainViewPresenter.java # Presentation logic
│ │ │ │ └── MainViewUI.java # UI interface contract
│ │ │ └── orders/
│ │ │ ├── Order.java # Order data model
│ │ │ ├── Orders.java # Order collection manager
│ │ │ ├── OrdersLoader.java # Data loading interface
│ │ │ └── OrdersLoaderImplementation.java # Classpath loader
│ │ └── resources/
│ │ └── com/devricks/civilwargeneral/
│ │ ├── default-orders.json # Default tactical orders
│ │ └── main-view.fxml # Main UI layout
│ └── test/
│ └── java/ # Comprehensive test suite
├── pom.xml # Maven configuration
├── README.md # This file
├── REQUIREMENTS_STAGE_1.md # Stage 1 requirements
├── REQUIREMENTS_STAGE_2.md # Stage 2 requirements
├── ARCHITECTURE.md # Architectural documentation
├── API.md # API reference
├── CONTRIBUTING.md # Contribution guidelines
└── .gitignore # Git ignore rules
- Java 23 - Core programming language
- JavaFX 17.0.12 - Desktop UI framework
- Maven 3.9+ - Build automation and dependency management
- Jackson 2.15.2 - JSON processing library
- JUnit 5.12.2 / Mockito 5.17.0 - Testing framework
- ControlsFX / BootstrapFX - Enhanced UI controls
The application follows the Model-View-Presenter (MVP) pattern:
- Model Layer:
OrderandOrdersclasses for data management - View Layer:
MainView(JavaFX/FXML) implementingMainViewUI - Presenter Layer:
MainViewPresentercoordinating between Model and View - Service Layer:
CommandSelectorandOrdersLoaderfor business logic
-
Clone and navigate to the project
git clone https://github.com/dev-ricks/Civil-War-General.git cd Civil-War-General -
Install dependencies
mvn clean install
-
Run in development mode
mvn javafx:run
-
Generate documentation
mvn javadoc:javadoc
- Follow standard Java naming conventions
- Use meaningful variable and method names
- Include comprehensive JavaDoc comments
- Maintain consistent indentation (4 spaces)
- Keep methods focused and concise
# Run all tests
mvn test
# Run tests with coverage
mvn test jacoco:report
# Run specific test class
mvn test -Dtest=OrderTest- Unit Tests: 80%+ code coverage
- Integration Tests: End-to-end workflow validation
- UI Tests: User interaction and display verification
We welcome contributions to the Civil War General project! Please see CONTRIBUTING.md for detailed guidelines.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Ensure you have Java 17+ and Maven installed
- Fork and clone the repository
- Import the project into your IDE (IntelliJ IDEA recommended)
- Run
mvn clean compileto verify setup - Start developing!
- Random order selection from predefined sets
- Model-View-Presenter (MVP) architecture
- JSON-based order configuration and loading
- Order validation and management
- Comprehensive unit and integration test suite (100+ tests)
- Industry-standard Javadoc documentation
- Contextual Data Models (Battlefield Conditions & Troop States)
- AI-based command selection algorithms (Weighted Suitability)
- Enhanced UI with Tactical Context panel
- AI Reasoning display
- Historical accuracy improvements
- Multi-unit command coordination
- Real-time battle simulation
- Historical scenario recreation
- Multiplayer support
- Advanced AI opponents
- Interactive Civil War history lessons
- Tactical analysis tools
- Historical battle recreations
- Educational assessment features
This project is licensed under the MIT License - see the LICENSE file for details.
- Historical tactical references from Civil War military manuals
- JavaFX community for UI framework support
- Maven ecosystem for build automation
- Open source contributors and testers
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Project Wiki
Civil War General - Bringing tactical decision-making to the digital battlefield
Made with ⚔️ for military history enthusiasts and tactical simulation fans