Page 1 of 2

PyMapConv

Posted: 03 Feb 2016, 11:27
by Beherith
A full python implementation of mapconv. With GUI. Also supports full decompilation and recompilation.
Does everything, no practical size limits, tested with up to 96x96 maps.
Very verbose error checking.

Spaghetti and meatballs code.

Also supports 16bit png heightmaps.

https://github.com/Beherith/springrts_smf_compiler

Download whole zip of the above repo, and launch pymapconv.exe

UI:
Image

Re: PyMapConv

Posted: 03 Feb 2016, 18:55
by Jools
Very cool thing. Thanks!

Re: PyMapConv

Posted: 03 Feb 2016, 19:18
by gajop
Interesting. Didn't try in detail but on Linux I needed to change one of the imports to:

Code: Select all

from PIL import Image

Re: PyMapConv

Posted: 03 Feb 2016, 19:41
by FLOZi
Beherith only does awesome

Re: PyMapConv

Posted: 03 Feb 2016, 20:17
by Kloot
How many mapconvs does this make now?

Re: PyMapConv

Posted: 03 Feb 2016, 20:25
by Beherith
It started off as a decompiler, but I figured its not much extra to do the compilation once the framework is in place. I think this is number 5 in the list btw ;D

Re: PyMapConv

Posted: 04 Feb 2016, 07:03
by Forboding Angel
This pretty much blows all other mapconvs into instant obsolescence. Thanks Behe, this is really cool.

Re: PyMapConv

Posted: 04 Feb 2016, 19:40
by PicassoCT
ImportError: No module named Image

Windows..old python install..cryptic error msg be cryptic.. open file, be warned - spaghettis..

Re: PyMapConv

Posted: 04 Feb 2016, 20:01
by Beherith
Picasso, it needs PIL installed, and python 2.7+ preferably. And pasghetti.

Re: PyMapConv

Posted: 05 Feb 2016, 17:17
by code_man
Nice one, if it is as straightforward to install and use as it seems then this will be interesting.

I wonder how well it performs compared to SME, gajop mentioned something about optimizations, i have no idea what he means tough.

Re: PyMapConv

Posted: 06 Feb 2016, 01:16
by Beherith
WRT optimization: this compiler only does lossless tiling compression, and does not do lossy tiling compression. This can result in larger map files. Otherwise performance to SME is identical.

Re: PyMapConv

Posted: 06 Feb 2016, 01:29
by gajop
code_man wrote:...SME, gajop mentioned something about optimizations...
I was talking about lossy optimization.
We were discussing whether or not an official compiler distributed with spring (and maybe even in-engine) should exist. One of the things I said was that if implementing optimization is non-trivial, and could be done in many ways, leaving room for unofficial implementations would be preferred.
Some people mentioned that we had too many existing compilers, most being unreliable.
This was before behe released this, incrementing the $map_compiler_count.

Re: PyMapConv

Posted: 07 Feb 2016, 12:43
by enetheru
whats your performance like?
For instance this 10kx10k photo of burning man
https://farm7.staticflickr.com/6042/627 ... b6_o_d.jpg

my 4th gen Corei7 processes this file into an smt in 40 seconds and uses under a gig of ram.. how does that compare to pymapconv?

Re: PyMapConv

Posted: 07 Feb 2016, 15:52
by Beherith
Its pretty fast, but the bulk of the load is compressing the texture to dds with nvdxt. With the highest quality settings that are enabled by default, it can take a minute or two. In quick mode its under a minute.

Re: PyMapConv

Posted: 07 Mar 2016, 08:28
by Forboding Angel
After some very annoying figuring out wtf... I found out the following.

Requires python 2.7 - (no surprise there) 32bit (color me surprised) https://www.python.org/downloads/
Requires PIL - (Python Image Library) (Why isn't this mentioned in the op?) http://www.pythonware.com/products/pil/
Requires PyQt4 - https://riverbankcomputing.com/software/pyqt/download

Using on windows when you don't have python already installed can be kind of annoying, but it's not too bad.

I found it interesting that it uses TIFF as an intermediary. This is good and should yield higher quality results.

Craps itself (not really, it just won't go any further) if you feed it an rgba heightmap (with only greyscale in it).

I found this more than a little annoying:
Image

Re: PyMapConv

Posted: 07 Mar 2016, 15:13
by Beherith
Fixed, thx

Re: PyMapConv

Posted: 28 Oct 2016, 13:16
by Beherith
Added file open dialog buttons so you can quickly select your files for compilation without having to type them in. Also fixed compilation under linux, and headless compilation works as well if you specify command line arguments.

Re: PyMapConv

Posted: 28 Oct 2016, 14:24
by TurBoss
thank you

Re: PyMapConv

Posted: 07 Jan 2017, 17:56
by TurBoss
I have compiled pyMapConv to exe for windows users

portable and setup versions can be found here:


https://mega.nz/#F!cEZQyKwC!Hx-DLcfv5Ax6sbyYg0gS_w

Re: PyMapConv

Posted: 07 Jan 2017, 20:44
by Silentwings
Could you post it onto SpringFiles instead? Or attach to your post as a file.