Skip to main content

Rustmaps Generator: A library and CLI tool for generating maps.

Reason this release was yanked:

test

Project description

RustMaps Generator (Unofficial)

Mainloot Logo

CI Status

Overview

This generator takes a CSV file (columns: seed, size, saved_config) and generates the corresponding map on rustmaps.com. It adheres to concurrent and monthly limits in addition to a 60 req/min rate limiter it enforces itself. When generation is triggered, it maintains a sv.csv file which keeps state in the event of a crash, unexpected reboot, etc.

We use this to generate our 52 custom procedural maps. Play them on mainloot

Feature Supported Notes
Profile Not yet supported, planned for future updates.
Billing Not yet supported, planned for future updates.
Custom Prefabs Not yet supported, planned for future updates.
Servers Pages Not yet supported, planned for future updates.
Custom Map Upload Not yet supported, planned for future updates.
Map Generator Not yet supported, planned for future updates.
Custom Map Generator Fully supported with current tool capabilities.

Install from source

 git clone https://github.com/maintc/rustmaps-generator.git
❯ cd rustmaps-generator
❯ pip install .
# optional: if you're using pyenv pyenv rehash

Command Line Usage

set your api key, find yours at https://rustmaps.com/dashboard

rustmaps login --api-key "<your-api-key>"

list imported map files (CSVs)

rustmaps list

create an empty csv

echo "seed,size,saved_config" > test.csv

importing maps with csv file

rustmaps import --maps-path ./test.csv
2025-01-15 15:31:19 - Imported map from /Users/user/Development/rustmaps-generator/test.csv to /Users/user/Library/Application Support/rustmaps-generator/maps/test.sv.csv

see it in our list

❯ rustmaps list Imported maps: (1)

  • test

and try to generate maps from it

❯ rustmaps generate --maps-name test 2025-01-15 15:31:52 - Empty map file. Nothing to generate.

this one's empty, let's destroy it

❯ rustmaps destroy --maps-name test 2025-01-15 15:42:20 - Map test removed.

add a record specifying seed, size, and config name (yours will differ, update it. it's probably "default")

❯ echo "1986142550,4250,CombinedOutpost" >> test.csv

import the map again

❯ rustmaps import --maps-path ./test.csv 2025-01-15 15:44:04 - Imported map from /Users/user/Development/rustmaps-generator/test.csv to /Users/user/Library/Application Support/rustmaps-generator/maps/test.sv.csv

generate the map. this will track the progress

❯ rustmaps generate --maps-name test 2025-01-15 15:52:24 - Map 1986142550 has begun generating 2025-01-15 15:52:26 - Map 1986142550 is still generating ...

you don't have to wait for generate to finish

you can ctrl-c at any time

or you can specify --once and come back to it

❯ rustmaps generate --maps-name test --once 2025-01-15 16:06:50 - Map 1986142550 is still generating

5 minutes later

❯ rustmaps generate --maps-name test --once 2025-01-15 16:11:50 - Map 1986142550 is still generating

or you can leave it hanging

❯ rustmaps generate --maps-name test 2025-01-15 16:12:28 - Map 1986142550 is still generating 2025-01-15 16:12:59 - Map 1986142550 is still generating 2025-01-15 16:13:29 - Map 1986142550 has completed generation

once complete, you can download them locally

❯ rustmaps download --maps-name test --version latest 2025-01-15 17:05:52 - Map 1986142550 has completed generation 2025-01-15 17:05:52 - Downloading map 1986142550 to /Users/user/Library/Caches/rustmaps-generator/test/latest/1986142550 2025-01-15 17:05:52 - Downloading map to /Users/user/Library/Caches/rustmaps-generator/test/latest/1986142550/1986142550_4250_CombinedOutpost_latest_map.map 2025-01-15 17:05:53 - Downloading image to /Users/user/Library/Caches/rustmaps-generator/test/latest/1986142550/1986142550_4250_CombinedOutpost_latest_image.png 2025-01-15 17:05:53 - Downloading image_with_icons to /Users/user/Library/Caches/rustmaps-generator/test/latest/1986142550/1986142550_4250_CombinedOutpost_latest_image_with_icons.png 2025-01-15 17:05:53 - Downloading thumbnail to /Users/user/Library/Caches/rustmaps-generator/test/latest/1986142550/1986142550_4250_CombinedOutpost_latest_thumbnail.png 2025-01-15 17:05:53 - Map 1986142550 downloaded successfully


## Where is stuff stored?

Windows:

Cache dir: C:\Users<username>\AppData\Local\mainloot\rustmaps-generator\Cache Config dir: C:\Users<username>\AppData\Local\mainloot\rustmaps-generator Data dir: C:\Users<username>\AppData\Local\mainloot\rustmaps-generator\Data Log dir: C:\Users<username>\AppData\Local\mainloot\rustmaps-generator\Logs


macOS:

Cache dir: ~/Library/Caches/rustmaps-generator Config dir: ~/Library/Application Support/rustmaps-generator Data dir: ~/Library/Application Support/rustmaps-generator Log dir: ~/Library/Logs/rustmaps-generator


Linux:

Cache dir: ~/.cache/rustmaps-generator Config dir: ~/.config/rustmaps-generator Data dir: ~/.local/share/rustmaps-generator Log dir: ~/.local/state/rustmaps-generator/log (or ~/.cache/rustmaps-generator/log on older systems)


## Contributing

### Running tests

```sh
make test

Al Gore

flowchart TD
    Start[Start] --> CheckConfig{API Key Set?}
    CheckConfig -- No --> Error[Error: Set API Key]
    CheckConfig -- Yes --> LoadMaps{Maps Loaded?}
    LoadMaps -- No --> SelectError[Error: Select Maps First]
    
    LoadMaps -- Yes --> CheckPending{Pending Maps?}
    CheckPending -- No --> CheckGenerating{Generating Maps?}
    CheckGenerating -- No --> Done[Done]
    
    CheckGenerating -- Yes --> SyncStatus[Sync Map Status]
    SyncStatus --> UpdateStatus[Update Map Status]
    UpdateStatus --> Sleep[Sleep 30s]
    Sleep --> CheckPending
    
    CheckPending -- Yes --> CheckLimits{Can Generate?}
    CheckLimits -- No --> Sleep
    
    CheckLimits -- Yes --> GenerateMap[Generate Map]
    GenerateMap --> |Response 200| Complete[Mark Complete]
    GenerateMap --> |Response 201| Generating[Mark Generating]
    GenerateMap --> |Response 401/403| AuthError[Mark Unauthorized/Forbidden]
    GenerateMap --> |Response 409| StillGenerating[Mark Still Generating]
    
    Complete --> SaveState[Save State]
    Generating --> SaveState
    AuthError --> SaveState
    StillGenerating --> SaveState
    
    SaveState --> Wait[Wait 2s]
    Wait --> CheckPending

TODO

  • Fail on duplicate entries fast
  • Be able to make changes to original csv, detect diffs

Project details


Download files

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

Source Distribution

rustmaps-0.1.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

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

rustmaps-0.1.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file rustmaps-0.1.0.tar.gz.

File metadata

  • Download URL: rustmaps-0.1.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for rustmaps-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e8aac14c242e21b3576269e80beb1c0ffdb5f33774cda230eb7e478cf133fca2
MD5 0be904d43e00b780f5b2b5a0820f1e1c
BLAKE2b-256 4b8710415539fde612d870309abd044e34aa0b6b9fc4ef5ff0c8ddb147b164fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustmaps-0.1.0.tar.gz:

Publisher: publish.yml on maintc/rustmaps-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rustmaps-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: rustmaps-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for rustmaps-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a7e5b58458c9acf04c5205a09bcc9ea8ec747805659f686f00b40f0a778dffc
MD5 3b62e184bc8838904bc060e7e3387d1f
BLAKE2b-256 e6d8d38742ac3bad9e4704dc35f25c736a6cc24cb31ee45ddd11994079aee808

See more details on using hashes here.

Provenance

The following attestation bundles were made for rustmaps-0.1.0-py3-none-any.whl:

Publisher: publish.yml on maintc/rustmaps-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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