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.8.1.tar.gz (39.1 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.8.1-py3-none-any.whl (51.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sagemap-0.8.1.tar.gz
Algorithm Hash digest
SHA256 ab244110c80b8ee98f4aef3bb674c7227c0191a1f1f88e9319ad49a0672b2747
MD5 714df74565fc90c2c09ec0f7be134633
BLAKE2b-256 0f7e9be89552257a34959e01904dfa52bf6abb211e60e48d053e92d791e6c9ad

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sagemap-0.8.1-py3-none-any.whl
  • Upload date:
  • Size: 51.3 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.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da122d899db4a8318e581ad6a6ef2c15912e0dcf9950d3cdc5d31f90eaabe086
MD5 e39312039212acd266fe380de4dd82c1
BLAKE2b-256 596fdd0a43e573e0f628b9dd132d76d0f4cd8aac3e416aa52b73f69de5588c04

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