Skip to content

b2ag/scmap_mirror_tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scmap_mirror_tool

Overview

mirror_map.py does following with a Supreme Commander map file and it's corresponding _save.lua

  • Mirrors every embedded image (e.g. preview, height map, stratas, normal maps, ...)
  • Mirrors decals including albedo and normal files
  • Mirrors props and rotate them to look somewhat more "mirrored"
  • Mirrors markers and units

Mirror refers to mirror from center along x axis or y axis or mirror along one of both diagonals. The script uses lupa to open _save.lua.

Shouts out to HazardX for initial reverse engineering of the scmap format, but not to forget svenni_badbwoi and tokyto for maps which needed to be mirrored and kicking off this whole thing.

Limitations

  • Option "keep side" doesn't remove units/props/decals on mirror side prior to mirroring
    • This is intentional at least for decals as they can have origin on mirrored side and still span more of the original side
    • For units and props it's just not implemented
  • Mirrored preview image doesn't have correct lighting on mirrored side
    • Workaround: Save mirrored version with SC map editor to get preview re-rendered
  • Unit meshes are not getting mirrored
    • Yeah, what can I do about this?
  • Connections between nodes are not taken into account
    • You need to fix air and land pass nodes in SC map editor after mirroring

Using a Command Line Orientated Script with Windows

I didn't use Windows while implementing this script. I did only use Windows running in a VM to make some of theses screenshots below. Thing is, Windows is bad at the command line. That's why you Windows users need a mirror_batch_example_theta.bat file. You will have to fill in all your Python/ImageMagick/Maps pathes there, because you wouldn't want to do that in a Windows terminal. Some advice would be to create a copy of that file for every map you want to mirror. You will change this file more than once and you need to understand most of it. The file contains a usage/help text from the mirror script as reference to the mirror script command line.

Installation (Windows)

Download and install Python 3.5 (32 Bit)

Python website menu Python website download page with marking for version 3.5

Find and remember Python 3.5 path

Python 3.5 directory in Explorer window

Find and remember SC gamedata path

Supreme Commander gamedata in Explorer window

Copy and update mirror Batch script

Mirror Batch script contents Put in all the pathes you remebered and maybe change --mirror-axis and/or add a --keep-side=2 parameter.

Running first time

Lupa and docopt been installed by Python Pip

Mirror script doing it's thing

About

A program to mirror a map for Supreme Commander

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published