Skip to main content

A library for reading and writing .map files from SAGE engine games.

Project description

sagemap

A python library for reading BFME .map files. Can potentially work with the map files of other SAGE games but might need to be adjusted. This implementation is not complete.

All the credit for the parsing logic goes to: https://github.com/OpenSAGE/OpenSAGE. I simply "translated" it to Python and simplified it.

Installing

The package is available on pip

python -m pip install sagemap

Example

from sagemap import parse_map_from_path

# Load a BFME .map file
map = parse_map_from_path('path/to/your/file.map')

# Access map properties
print(map.world_info)
print(map.height_map_data)
print(map.objects_list)

Map Linter

sagemap includes a command-line linter for validating BFME map files. The linter checks for common issues such as terrain flatness, object counts, resource placement, and camera settings.

Usage

Run the linter from the command line:

python -m sagemap.linter <path-to-map-folder>

You can list all available error codes or exclude specific checks using command-line options. For more details, run:

python -m sagemap.linter --help

Using the Linter Programmatically

You can also use the linter in your own Python scripts:

from sagemap.linter import lint_map
from sagemap import parse_map_from_path

map = parse_map_from_path('path/to/your/file.map')
errors = lint_map(map)

for error in errors:
	print(f"{error.code}: {error.message}")

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

sagemap-0.5.1.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

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

sagemap-0.5.1-py3-none-any.whl (51.0 kB view details)

Uploaded Python 3

File details

Details for the file sagemap-0.5.1.tar.gz.

File metadata

  • Download URL: sagemap-0.5.1.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for sagemap-0.5.1.tar.gz
Algorithm Hash digest
SHA256 cdd8778801300703db506cb59105ac246fa86c9b26673f9455f943c50b91b135
MD5 9ce1c7ab8f8cea7fbe2dfb9a01120dbf
BLAKE2b-256 1b27983840cf57711a94142267c8cc2974c77531fb155aa364335fea3f12d491

See more details on using hashes here.

File details

Details for the file sagemap-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: sagemap-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 51.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for sagemap-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 33338478052315b04ba566d8a6e3215f312ec72e5dd05376164b7f8ea1a01e6a
MD5 101bddb63e568027edc836a28a556a71
BLAKE2b-256 d524e36a74a0788099fac871c34d2fff854ff6088395c2ed2874f95204548efc

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