An open API service indexing awesome lists of open source software.

https://github.com/adia-dev/ai-fighting-game


https://github.com/adia-dev/ai-fighting-game

Last synced: 11 months ago
JSON representation

Awesome Lists containing this project

README

          

# Fighting Game Project


Game Screenshot

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