{"id":13677665,"url":"https://github.com/Kowalski1024/SC2-Map-Segmentation","last_synced_at":"2025-04-29T11:31:33.942Z","repository":{"id":215654683,"uuid":"717428781","full_name":"Kowalski1024/SC2-Map-Segmentation","owner":"Kowalski1024","description":"SC2 Map Segmentation is a Python plugin for the Starcraft 2 API. It provides automated segmentation of SC2 maps into smaller regions.","archived":false,"fork":false,"pushed_at":"2024-01-05T19:55:52.000Z","size":2988,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-02T13:19:01.945Z","etag":null,"topics":["ai","bot","sc2","segmentation-automation","starcraft2"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kowalski1024.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-11-11T13:14:17.000Z","updated_at":"2024-01-05T19:15:54.000Z","dependencies_parsed_at":"2024-01-05T18:27:17.004Z","dependency_job_id":"a1f56c6d-8272-41c5-993d-644e67fcfaae","html_url":"https://github.com/Kowalski1024/SC2-Map-Segmentation","commit_stats":null,"previous_names":["kowalski1024/sc2-map-segmentation"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kowalski1024%2FSC2-Map-Segmentation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kowalski1024%2FSC2-Map-Segmentation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kowalski1024%2FSC2-Map-Segmentation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kowalski1024%2FSC2-Map-Segmentation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kowalski1024","download_url":"https://codeload.github.com/Kowalski1024/SC2-Map-Segmentation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224163711,"owners_count":17266556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","bot","sc2","segmentation-automation","starcraft2"],"created_at":"2024-08-02T13:00:45.472Z","updated_at":"2024-11-11T19:32:33.221Z","avatar_url":"https://github.com/Kowalski1024.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":["Python Libraries"],"readme":"# Starcraft 2 Map Segmentation\nThis is a plugin for the Python SC2 API, [python-sc2](https://github.com/BurnySc2/python-sc2).\n\n**SC2 Map Segmentation** provides fully automated segmentation for Starcraft 2 maps. The goal is to offer functionality similar to [SC2MapAnalysis](https://github.com/spudde123/SC2MapAnalysis), but with a focus on dividing the map into smaller regions. This is a feature not currently available in SC2MapAnalysis. Additionally, SC2 Map Segmentation identifies passages between these regions, such as choke points and ramps. It also includes a basic implementation of the Dijkstra pathfinding algorithm.\n\nPlease note that this project is still under development and may not have as many features as SC2MapAnalysis at this time.\n\n### Example of segmentation\n![SiteDeltaAIE segmentation](data/map_pool/SiteDeltaAIE.png)\nTop view of the map: https://liquipedia.net/commons/images/7/77/Site_Delta.jpg\n\nOther examples from _Sc2 AI Arena 2023 Season 3_ map pool are in [data/map_pool](data/map_pool) folder.\n\n### How it works\nThe algorithm operates by identifying key locations (referred to as 'seed points') on the map, such as expansions, ramps, etc. It then scans the surrounding area for the nearest unpathable/unbuildable tiles.\n\nTiles that create a large angle between the previous tile and the seed point are filtered out. Points that are significantly distant from the previous point are identified as potential choke points. These choke points are then marked on the map.\n\nExample of depth scan, white point is seed point, greed points are scanned points, red lines are choke points:\n![Depth scan image](data/depth_scan.png)\n\nNext, the algorithm performs a flood fill operation from the seed point, avoiding crossing through any choke points.\n\nFinally, the map undergoes a cleanup process. This includes steps such as removing small regions and merging regions that are in close proximity to each other.\n\n## Installation\n1. Clone this repository\n2. Install requirements\n3. Copy `mapsegmentation` folder to your project\n\n## Usage\nAn example of usage can be found in [examples/reaper_pathfinding.py](examples/reaper_pathfinding.py). This is a simple bot that finds a path to the enemy base for a Reaper unit using the Dijkstra algorithm.\n\nThe segmented map can be serialized using pickle and saved to a file for future use.\n\nThere are three main data classes that represent the segmented map, which can be found in the [mapsegmentation/dataclasses](mapsegmentation/dataclasses) folder:\n- `SegmentedMap`: Contains all segments and passages between them.\n- `Region`: Represents a single segment of the map.\n- `Passage`: Represents a passage between regions.\n\n\n## Limitations, Future Work, and Contributions\n\n- The current segmentation algorithm may produce asymmetrical regions.\n- The algorithm does not yet identify cliff passages where units, like Reapers, need to jump multiple times to traverse.\n- The feature set is not as extensive as that of MapAnalysis.\n\nContributions are welcome and greatly appreciated. If you're interested in contributing, please feel free to submit a pull request. Any help is valuable as my time to work on this project is limited.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKowalski1024%2FSC2-Map-Segmentation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKowalski1024%2FSC2-Map-Segmentation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKowalski1024%2FSC2-Map-Segmentation/lists"}