Log in

View Full Version : Utility Pixel Fixer 1.00 - add or remove provinces in map file


Ballbarian
February 9th, 2009, 01:06 AM
Adding or removing provinces from an existing map has proven to be a hassle and this problem seems to come up again and again in the forums. Pixel Fixer is a cross-platform, standalone executable that will adjust existing province numbers and output a new, fixed map file.

From the included "Help" text:

Dominions Pixel Fixer 1.00
**************************
Author: ballbarian AT gmail DOT com

So you want to remove (or add) a province to an existing
map, but this will completely screw up the province
numbering in the map file. This means neighbors will be
twisted into an unrecognizable maze of arrows and many
provinces will show the wrong terrains and names, etc.
Pixel Fixer will hopefully make adjusting your map less
painful.


1. Make sure that PixelFixer.exe and PixelFixer.cfg are in
the same directory as your ".map" file.

2. Open PixelFixer.cfg in the text editor of your choice.

3. Change the settings as needed. Leave the three comment
lines that begin with a dash "-". You want to edit the
last three lines only. The first is the name of your map
file, but leave of the ".map" extension. The second is
the province number, and the third is "add" or "remove".

4. Run PixelFixer.exe

5. Find "yourmapfilenameFIXED.map" in the same directory as
your original map file.

6. If you were removing a pixel then you are done. Easy!

7. If you were adding a pixel then you have a little more
work to do. Open the fixed map file and manually add any
terrain, neighbor, landname, start info for the new province
as necessary. Pixel Fixer has fixed the existing provinces,
but you will need to add the new info for the added province
yourself. :)



I built this quickly using existing, raw, bare bones code that I had used for fixing my own maps and made it configurable so that modifying the code would no longer be necessary. I have only done minimal testing with this new creature, so let me know if you have any problems.

Endoperez
February 9th, 2009, 05:08 AM
Wow! I almost feel like starting a map project to be able to test this. It sounds awesome!

Thilock_Dominus
February 9th, 2009, 05:55 AM
Where's the mac & linux version?

lch
February 9th, 2009, 06:53 AM
I haven't checked, but if Ballbarian writes that it's an exe but a "cross-platform, standalone executable", then it probably is some C# binary. Try the Mono Project on it.

P.S.: I think JK already had something intended like this in the ingame map editor, the "add province" / "remove province" function, but nobody ever figured out how to effectively use it so far.

Ballbarian
February 9th, 2009, 09:48 AM
It is a very simple program written in yabasic and bound to the yabasic executable. It should work fine on Windows & Linux. I have no idea whether or not it will work on the Mac.

Edit:
If you have any problems on Linux systems, let me know and I will see what I can do.

Thilock_Dominus
February 9th, 2009, 11:02 AM
Okay, thanks. I'll give it a try.

lch
February 9th, 2009, 11:08 AM
If it's written in something other than what the Mono Project supports (Microsoft's SharpDevelop) then you need to compile the programs under/for the target platforms. An EXE is Windows-specific and Windows-only. YaBasic is GPL software and there exist Linux versions of it, but you'll still need to compile the program into a Linux ELF file for Linux people to use. I haven't found any mention of a native Macintosh version of YaBasic, though, so you'll need to use something like DarwinPorts to install it. Or you could release the source code so that the users can take care of that themselves.

Gandalf Parker
February 9th, 2009, 01:21 PM
Thank you Ballbarian. Excellent work.

I just tested it in Debian Linux and it worked fine. In fact, I must admit that I was surprised since I figured that the first test was to at least try just invoking the exe. It figured out that it was on linux, invoked wine, and ran without me needing to tweak it. Excellent work for a windows program.

@lch: Its not gui. I think that makes the difference.

Now if I could get ParadoxHarbringer to get his mapgen to work under wine. :)

Ballbarian
February 9th, 2009, 02:50 PM
I will attach the source to this post (just in case).
Thanks for testing it for me GP. :)

PixelFixerSource.zip (http://forum.shrapnelgames.com/attachment.php?attachmentid=7748&stc=1&d=1234205344)

Edi
February 11th, 2009, 11:22 AM
Excellent tool, Ballbarian. Thank you. :)