Simple Python script for creating Blitzkrieg2 binary map files (so far only square maps are supported).
This script allows to overcome Blitzkrieg 2 Editor limitations and create maps larger than 20x20, it should be noted maps larger than 22x22 may suffer from Blitzkrieg2 culling system and not display properly. This can be in part mitigated by changing camera limits, and zooming out more than usually allowed.
- Python3
Example installation with pipenv.
pip install virtualenv
pip install pipenv
python -m venv venv
python -m pipenv install opencv-python
python -m pipenv shell
python -m pipenv run main.pypipenv is not a requirement, PyCharm works out of the box as well.
python -m pipenv run main.pyMake sure that the input/map.b2m exists and is the only file in the input folder.
In main.py there's two changes that have to be done.
- Set the current map size by changing
14inMAP_FILE_N = 14on line 21 to the current map size. - Set the desired map size by changing
20inmap_creator.n = 20on line 542 to the desired map size.
Paste the heightmap into input/map.png. Paste the texturemap into input/map2.png.
In main.py there's two changes that have to be done.
- Set
b2minIMPORT_FROM_FILES = b2mon line 23 to 'png' - Set the desired map size by changing
20inmap_creator.n = 20on line 542 to the desired map size.
If you want to use only a heightmap or only a texture image keep only input/map.png or input/map2.png respectively.
Set the current map season and rgb values for textures starting on line 27.
Set MAX_HEIGHT on line 23 to determine the in game height for the highest point on the heightmap.