Thank you for your interest in contributing to GameDev! This guide will help you set up your development environment and make your first contribution.
# Clone the repo
git clone https://github.com/maikramer/GameDev.git
cd GameDev
# Install a package in dev mode
cd Shared && pip install -e '.[dev]'
# Run tests
make test-shared- Python 3.10 or higher
- Git
- CUDA (optional, for GPU features)
Each package has its own virtual environment. For example, to work on Text2D:
cd Text2D
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Linux/Mac
# .venv\Scripts\activate # Windows
# Install in development mode
pip install -e '.[dev]'# Install all packages with dev dependencies
for dir in Shared Text2D Text3D Paint3D Part3D GameAssets Texture2D Text2Sound Skymap2D Rigging3D; do
if [ -d "$dir" ]; then
echo "Installing $dir..."
cd "$dir"
pip install -e '.[dev]' 2>/dev/null || pip install -e .
cd ..
fi
donemake testmake test-shared # Shared library
make test-text2d # Text2D
make test-text3d # Text3D
make test-paint3d # Paint3D
make test-part3d # Part3Dcd Shared
pip install pytest-cov
pytest --cov=src --cov-report=htmlSome tests require CUDA. They will be skipped automatically if CUDA is not available:
# These will skip if no GPU
pytest Shared/tests/test_gpu.py
pytest Text3D/tests/test_gpu_exclusive.pyWe use Ruff for linting and formatting.
# Check for issues
ruff check .
# Auto-fix issues
ruff check . --fix# Check formatting
ruff format --check .
# Auto-format
ruff format .We recommend using pre-commit hooks to automatically run linting before each commit:
# Install pre-commit
pip install pre-commit
# Install hooks
pre-commit install
# Run manually
pre-commit run --all-files- Line length: 120 characters max
- Quotes: Double quotes (
"...") - Indentation: 4 spaces (or run
ruff format .) - Imports: Sorted, with
isortstyle - Type hints: Recommended for new functions
Use Google-style docstrings:
def generate_image(prompt: str, seed: int | None = None) -> Image.Image:
"""Generate an image from a text prompt.
Args:
prompt: The text description of the image.
seed: Random seed for reproducibility.
Returns:
Generated PIL Image.
Raises:
ValueError: If prompt is empty.
"""
if not prompt:
raise ValueError("Prompt cannot be empty")
return _generate(prompt, seed)git checkout main
git pull origin main
git checkout -b feature/my-new-feature- Write your code
- Add tests
- Update documentation
- Follow the code style
# Run tests for your package
make test-shared
# Run linting
ruff check .
ruff format --check .git add .
git commit -m "feat: add new feature description"We use conventional commits:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, no logic change)refactor:Code refactoringtest:Adding or updating testschore:Maintenance tasks
- Fork the repository on GitHub
- Clone your fork locally
- Create a branch for your changes
- Make your changes and commit them
- Push to your fork on GitHub
- Open a Pull Request against the
mainbranch
## Description
Brief description of the changes.
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Code refactoring
## Testing
Describe how you tested your changes.
## Checklist
- [ ] My code follows the style guidelines
- [ ] I have performed a self-review of my code
- [ ] I have commented my code where necessary
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix/feature worksGameDev/
├── Shared/ # Shared utilities (logging, GPU, HF helpers)
├── Text2D/ # Text to 2D sprite generation
├── Text3D/ # Text to 3D model generation
├── Paint3D/ # 3D texture painting
├── Part3D/ # Part-based 3D generation
├── GameAssets/ # CLI for combining all tools
├── Texture2D/ # 2D texture generation
├── Text2Sound/ # Text to sound effects
├── Skymap2D/ # 2D skybox generation
├── Rigging3D/ # 3D rigging (Rust + Python)
└── Materialize/ # Rust crate for Materialize3D
If you get CUDA out of memory errors:
- Reduce batch size
- Use
--low-vramflag (where available) - Close other GPU applications
Set your HuggingFace token:
export HF_TOKEN=your_token_hereMake sure you're in the correct virtual environment:
source .venv/bin/activate- Open an issue on GitHub
- Check the troubleshooting guide
By contributing, you agree that your contributions will be licensed under the project's license.