# Contributing

## Setup

```powershell
python -m venv venv
venv\Scripts\pip install -e .
```

Set local runtime paths with environment variables or a local `.env` file based on `.env.example`.

Required local assets:

- a legally obtained Pokemon Red ROM
- a save state compatible with the configured reward profile

Optional path overrides are supported through the full `POKEMONRL_*` path variable set documented in [`README.md`](README.md).

## Before Opening a PR

Run the local checks:

```powershell
venv\Scripts\python -m compileall PokemonRL tools tests
venv\Scripts\python -m unittest discover -s tests -p "test_*.py" -v
venv\Scripts\python tools\verify_rewards.py
venv\Scripts\python tools\verify_ram.py
```

`verify_ram.py` is a local-only check because CI does not ship a ROM or save state.

## Guidelines

- Keep public entrypoints generic. Avoid new scope-specific names like `badge1_*` in file names.
- Put new reward tuning values in configuration files, not hardcoded Python constants.
- Prefer reusable modules in `PokemonRL/` over adding logic directly to tools.
- Preserve backward compatibility where practical by leaving thin compatibility shims for renamed scripts.
