https://github.com/adia-dev/ai-fighting-game
https://github.com/adia-dev/ai-fighting-game
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/adia-dev/ai-fighting-game
- Owner: adia-dev
- Created: 2025-02-08T23:42:46.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-14T19:22:44.000Z (12 months ago)
- Last Synced: 2025-02-28T09:05:01.017Z (12 months ago)
- Language: C++
- Size: 8.69 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Fighting Game Project
A 2D fighting game with neural network-powered AI opponents, built with SDL2 and ImGui.
## Features
- Real-time 2D combat system with combos, blocking, and special moves
- Neural network AI opponents that learn and adapt
- Debug visualization tools for AI decision making
- Customizable character animations and hitboxes
- Training mode for AI agents
- Cross-platform support (Windows, macOS, Linux, Web)
## Prerequisites
### Desktop Build
- CMake 3.15+
- C++17 compatible compiler
- SDL2 development libraries
- SDL2_image development libraries
- SDL2_ttf development libraries
### Web Build
- Emscripten SDK
- Python 3.x (for local development server)
## Building
### Desktop Build
```bash
# Clone the repository
git clone https://github.com/adia-dev/ai-fighting-game.git
cd ai-fighting-game
# build directory
make
# or
make -j$(nproc)
# Run the game
./build/Debug/bin/fighting-game
```
### Web Build
```bash
# Make sure you have sourced the Emscripten environment
source /path/to/emsdk/emsdk_env.sh
# Build using Emscripten makefile
make -f Makefile.emscripten
# Start local development server
make -f Makefile.emscripten serve
```
Then open `http://localhost:8000` in your web browser.
## Controls
- **Left/Right Arrow**: Move
- **Space**: Jump
- **A**: Attack
- **B**: Block
- **D**: Dash
- **Tab**: Toggle Debug UI
- **Escape**: Close Debug UI
## Development
### Adding New Features
1. Character Animations:
- Add animation frames to `assets/animations/`
- Define hitboxes in animation JSON files
- Register animations in `PiksyAnimationLoader`
2. AI Behaviors:
- Extend the state space in `State.hpp`
- Add new action types in `ActionType`
- Modify reward calculations in `RLAgent`
## Configuration
The game can be configured through:
- Command line arguments
- Config files in `assets/config/`
- In-game debug UI
Key configuration options include:
- Physics parameters
- AI learning rates
- Combat mechanics
- Graphics settings
## Acknowledgments
- SDL2 development team
- Dear ImGui library
- [Piksy](https://github.com/adia-dev/piksy) for animation tooling