Skip to main content

PyPI Build Status Coverage Status Crates.io

Starcraft2 Maps with Simple, Universal Retrieval


About

The objective of this repository is to consolidate known Starcraft2 (SC2) maps for use by developers creating bots, AI agents or some other custom code project.

Simple. Effective. Useful.

The implementation of this code base is intended to not only consolidate SC2 maps into a single location, but also provide a simple interface to reliably access and use basic map information. This includes selecting a map for play (optionally specifying user-defined criteria), easily identify the .SC2Map file absolute path, identify automatically generated tags that describe the map(s) and identify any collection of maps using keywords to describe the map.

The intent is to provide a minimal (simple!) interface so that new-commers can easily use developed functionality. This small project, independent of other code, should prove more reliable to retrieve desired map information (effective!). By being simple and effective, hopefully this repository proves helpful to new and existing SC2 AI developers (useful!).

Rationale: Why Create this Repository?

  • One, single location where many SC2 AI-relevant maps are accumulated. No need to use mutliple user's repositories with their own map management systems.
  • OS/installation independent. This package manages the maps itself without the user needing to install them at a particular location.
  • Remove the burden from the user to have to know where to install the maps so their SC2 client can find the maps.
  • SC2 map editor does not appear to be compatible non-Blizzard code to programmatically extract relevant .SC2Map information.

Functional Overview

All .SC2Map files are located within the Maps subfolder or subsequent subfolders. Each subsequent subfolder encodes an attribute that describes all subsequent .SC2Map files contained within it or its subfolders. Using this format, an index file that maps attribute tags to filenames is not needed.

This repository does not prevent potential .SC2Map file redundancy. Instead, this storage approach allows files to be very easily added into the repo w/o having to additionally maintain a mapping file for each new file that's added. Allowing duplicates also allows multiple versions of the same file to exist within the repository, granted each file will have a unique set of automatic- generated attribute tags to distinguish between them.

When searching for maps given user-defined, by first restricting which maps are examined by first matching attributes first and then the map name, if specified.

The current implementation performs the lookup O(n) time where N is the number of maps managed within the repository. If N becomes large, this may need to be optomized further for timely lookups.


Installation

Dependencies

This package is mostly self-contained with only one external package dependency: six (python2 and python 3 compatibility)

Instructions

  1. Install any(?) version of python and use pip to install six.
  2. git clone https://github.com/ttinies/sc2gameMapRepo (or fork and clone your repo) to <destination>.
  3. Ensure <destination> is in your PYTHONPATH. Options:
    • pip install -e <destination> and then import sc2maptools to ensure the package was installed correctly.
    • install this package with <destination> within your own project
    • add <destination> to the environment variable: PYTHONPATH
    • .../<Python folder>/Lib/site-packages/sc2gameMapRepo/ (similar to what a pip install would do)

Refer to python-specific or non python-specific usage documents.


Troubleshooting

In the event that a map request issued by no matching map is found, an InvalidMapSelection Exception is raised. If encountered, your query must be revised to properly select maps.

EXAMPLE: given criteria Foo=True results in an exception because none of the maps exist in a subfolder named foo (ignoring folder's case).

sc2gameMapRepo.constants.InvalidMapSelection: could not find any matching maps given criteria: {'foo': True}

EXAMPLE: given criteria year=2017 and Combat=True, an exception is raised because none of the maps exist in a subfolder structure with both of these attributes in the path.

sc2gameMapRepo.constants.InvalidMapSelection: could not find any matching maps given criteria: {'year': 2017, 'Combat': True}


Further Development and Augmentation

Add New Maps?

New .SC2Map files need to be added to the Maps subfolder. The files can be placed in any subfolder structure the user desires. Each subfolder represents an attribute that describes every map file it contains, including its own subfolders. The folder name is deemed case-insensitive for the purpose of attribute identification.

The subfolder name is interpreted in one of two ways according to its format:

  1. non-numeric chars mean the attribute is interpreted with a bool value.
  2. if a numeric char is included, that char signals the beginning of an int or string typed value.

EXAMPLE: a hypothetical folder, MaxPlayers6, would be interpreted with an attribute name maxplayers with an int value 6.

EXAMPLE: all .SC2Map files within this subfolder are Ladder maps.

/Maps/Economy/

EXAMPLE: all .SC2Map files within this subfolder are official Ladder maps which are 1v1 maps released in 2018.

/Maps/Ladder/mode1v1/year2018

Add New Features to the Code?

This is an open-use repository. Feel free to fork and issue pull requests.

However, changing the defined interface is discouraged in order to promote backward compatibility. Valuable feature enhancements and bug fixes are welcome.

Anticipated Useful, To-Be-Developed Features
  • Additional language-specific interfaces beyond Python.
  • package management support: PyPi / pip and conda.
  • Accomodations for unforseen/unhandled incompatibility issues.

Credits for Single-Player Scenario author/GitHub Repositories:

Many scenarios have already been created that involve having a single agent solve a specifically defined task. These are included within this repository too for completeness.

Metadata

Release files for sc2maptool 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sc2maptool 1.1.2
File Size Uploaded Provenance
sc2maptool-1.1.2.tar.gz 68.0 MB Without provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for sc2maptool 1.1.2
File Interpreter ABI Platform
sc2maptool-1.1.2-py3.6.egg Legacy Egg format - - Details
sc2maptool-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 204.0 MB

Release files / sc2maptool-1.1.2.tar.gz

Download URL sc2maptool-1.1.2.tar.gz
Size 68.0 MB
Tags Source
SHA-256 checksum
How to use checksums
05df63e86a166d57b6d6c0951ca00edf47aaddfb1fa20e8b7aba8b2e5f0e43a5
BLAKE2b-256 checksum
How to use checksums
4c8f704840f40ca93fcb284cc09c72d191b85442894ce3c45559731548dc56df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

Release files / sc2maptool-1.1.2-py3.6.egg

Download URL sc2maptool-1.1.2-py3.6.egg
Size 68.0 MB
Tags Egg
SHA-256 checksum
How to use checksums
00ee576474d538d20cbe9379f226c89ddba52dc9ce2a745833edc49c2d5ecad5
BLAKE2b-256 checksum
How to use checksums
4d82f3375304056700ce9a7c2d7ba2a03b9a9e94f39e8a80b698a9e16242ae69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

Release files / sc2maptool-1.1.2-py3-none-any.whl

Download URL sc2maptool-1.1.2-py3-none-any.whl
Size 68.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6bca71e53842b0b6a95ec297d5f180dc6ef52457fb7be81ab7ce741606e71957
BLAKE2b-256 checksum
How to use checksums
e1d831e4aa68a7eb3afc72f479da6546733bc98159ff5329ec9d31021603e3c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.6

Security for sc2maptool 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page