Map Mirrorer

Discussion and development of scenarios and campaigns for the game.

Moderators: Forum Moderators, Developers

Post Reply
Morath
Posts: 22
Joined: August 24th, 2009, 12:38 am

Map Mirrorer

Post by Morath » June 1st, 2010, 2:59 am

I wrote a [acronym=PHP: Hypertext Preprocessor]PHP[/acronym] script for mirroring wesnoth maps. This could be useful if you are concerned with the balance of a map or to save time in making a map: just make half, then mirror it!

It mirrors maps in a few slightly different ways:
  • Parallel over the even horizontal tiles excluding the last row
  • Parallel over the odd horizontal tiles excluding the last row
  • Anti-parallel over the horizontal tiles including the last row
  • Anti-parallel over the even horizontal tiles excluding the last row
  • Anti-parallel over the odd horizontal tiles excluding the last row
  • Parallel over the vertical tiles excluding the last column
  • Anti-parallel over the odd vertical tiles excluding the last column
  • Anti-parallel over the even vertical tiles excluding the last column
To use a certain type of mirroring, uncomment it from the top of the file and type in the input and output filenames. Examples of maps that use given types of mirroring are pre-filled-in to give you an idea of which one you might want to use; at worst, just try different ones until you get a result you like.

It does not mirror maps with 120 degree radial symmetry like Merkwuerdigliebe.

After using this tool, you will most likely want to touch up the map since many of the mirroring types lose half a tile-length in the dimension the map is growing in and starting positions will have to be updated.
Attachments
mirror_map.zip
(1.47 KiB) Downloaded 109 times

User avatar
norbert
Posts: 368
Joined: June 14th, 2009, 6:57 pm
Location: The Netherlands

Re: Map Mirrorer

Post by norbert » June 1st, 2010, 4:20 am

Morath wrote:mirroring wesnoth maps
Reminds me of "revmaph and revmapv", "rotate", and "Wesnoth Map Symmetrizer" that are linked from the ExternalUtilities Wiki page...
I'll check out your PHP script to see what exactly it's doing. :wink:

ilor
Inactive Developer
Posts: 129
Joined: March 24th, 2008, 9:05 pm

Re: Map Mirrorer

Post by ilor » June 1st, 2010, 3:57 pm

sheesh, I really need to get down to writing that guide on how to do this in the new editor using clever copy and paste...

Morath
Posts: 22
Joined: August 24th, 2009, 12:38 am

Re: Map Mirrorer

Post by Morath » June 2nd, 2010, 5:05 pm

Thanks for showing me to the external utilities page norbert. I did do some looking around for tools similar to the one I made but did not find that page. I tried "Wesnoth Map Symmetrizer" - after figuring out that it required wesnoth to be installed in my program files folder - and it seems to do things similar to what this script does although, as far as I can tell, it only does only anti-parallel mirrorings on full maps (instead of half maps) and of the 4 maps I tried it on, none of them came out quite right. I would guess that it lacks what this script accomplishes with the $flipper variable. Anyways, this script is just another option for people who want to mirror a map.

Post Reply