Skip to main content

Collection of Python tools to help with game development

Project description

GameDevTools

License Python


Overview ✅

GameDevTools is a collection of Python tools and utilities used in the game development


Table of Contents 📚


Features ✨

  • Modules to copy a folder or files to a remote location or cloud drive (Amazon S3)

Requirements ⚙️

  • Python 3.10 or newer

Usage Examples 🔧

  • uepyscripts.tools.archives.rotate_archives : this module allows to archive the result of packaging your game, in a shared folder. The arguments are:

    • directory_path : The folder where to archive the packages. Note that this module will copy the archives in a sub-folder named after the current date with the format YYYYMMdd. If a folder already exists with the same date, it will suffix with an incrementing counter _XX
    • keep_count : How many versions of the packages you want to keep in directory_path. This will remove the extraneous sub-folders to only keep keep_count items.
    • folder_output_file_name : Path to a text file where to write the path to the folder where the archive was copied. This is useful if you plan to use this folder for other tasks, such as sending a message in slack, or uploading the archives to an amazon S3 bucket
  • uepyscripts.tools.archives.upload_archives : this module allows to upload to an amazon S3 bucket all the files inside a folder. The arguments are:

    • local_folder : The folder where to find the files to upload
    • bucket_name : The S3 bucket name
    • region : The region of the bucket
    • access_key and secret_key : The keys to access the bucket
    • destination_folder : The folder where to upload in the bucket. As with rotate_archives, a sub-folder with the date will be used, and if the folder exists, a suffix will be added.
    • keep_count : Same as with rotate_archives, this is used to control how many archives you want to keep.
    • output_file : Path to a text file where the uploaded files URLs will be stored. This can be used in your jenkinsfile to be sent to a slack channel for example.

Here's an example of how we use these 2 modules in our jenkinsfiles:

stage( 'Rotate Archives' ) {
    pwsh """
        . "Scripts/PyScripts/.venv/Scripts/ue-tools-archives-rotate.exe" `
          --directory_path = "//nas/Versions/OurGame/Development/WIP" `
          --keep_count = "-1" `
          --folder_output_file_name = "${env.WORKSPACE}/Saved/Temp/latest_archive_Development.txt"
    """

    def folder_name = readFile "${env.WORKSPACE}/Saved/Temp/latest_archive_Development.txt"
    slackSend( channel: '#channel', message: "New Development build available : ${folder_name}" )
}

stage( 'Upload Archives' ) {
    def file = readFile "${env.WORKSPACE}/Saved/Temp/latest_archive_Development.txt"

    pwsh """
        . "Scripts/PyScripts/.venv/Scripts/ue-tools-archives-upload.exe" `
            --local_folder = "${file}" `
            --bucket_name = "artifacts" `
            --region = "eu-west-3" `
            --access_key = "XXXXX" `
            --secret_key = "YYYYY" `
            --destination_folder = "Development/" `
            --keep_count = "-1" `
            --output_file = "${env.WORKSPACE}/Saved/Temp/uploaded_files_Development.txt" `
    """

    def uploaded_files = readFile "${env.WORKSPACE}/Saved/Temp/uploaded_files_Development.txt"
    def lines = uploaded_files.split('\n')

    if ( lines.size() > 0 ) {
        def message = 'Uploaded builds:\n'

        lines.each { String line ->
            def parts = line.split(' : ', 2)
            if (parts.size() == 2) {
                def url = parts[0].trim()
                def filename = parts[1].trim()
                message += "<${url}|${filename}>\n"
            }
        }

        slackSend( channel: '#channel', message: message )
    } else {
        slackSend( channel: '#channel', color: 'danger', message: 'No files were uploaded' )
    }
}

Development & Testing 🧪

  • Setup dev environment and install dependencies:

    .\setup_venv.ps1
    .\.venv\Scripts\Activate.ps1
    
  • Linting & formatting

    • Use ruff check ., ruff format . and mypy .

Contribution Guide 🤝

We welcome contributions — please follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/your-change
  3. Run lint locally
  4. Submit a pull request describing the change

Support & Troubleshooting ❓

  • Check Config/ and uepyscripts/internal/config.py for project-specific settings.
  • If buildgraph fails, ensure Config/Project has a valid BuildgraphPath and the UAT tool is accessible.
  • When reporting issues, include:
    • Python version
    • Unreal Engine version
    • Exact command and full logs

License & Credits 📝

License: MIT — see the LICENSE file.

Maintainers: Michael Delva and contributors (see AUTHORS or repository metadata).

Changelog: See CHANGELOG.md


Made with ❤️ for Game Dev developers — contributions and feedback are welcome! If this helped you, consider starring the repository. ⭐

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gamedevtools-1.0.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file gamedevtools-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: gamedevtools-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for gamedevtools-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62e1ab8615971cb8d0ddbfdd7e184275880eb3b3d589d542feea138aad2fc073
MD5 c2ecb867d303828374db5582d9a8c678
BLAKE2b-256 888bf98b08d9952d2e720c68f0592aab6ece010f45372ab76b464c84bf1b8191

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page