PyMapConv

PyMapConv

Tutorials & Resources For Mappers

Moderator: Moderators

User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

PyMapConv

Post 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
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: PyMapConv

Post by Jools »

Very cool thing. Thanks!
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: PyMapConv

Post 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
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: PyMapConv

Post by FLOZi »

Beherith only does awesome
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: PyMapConv

Post by Kloot »

How many mapconvs does this make now?
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: PyMapConv

Post 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
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: PyMapConv

Post by Forboding Angel »

This pretty much blows all other mapconvs into instant obsolescence. Thanks Behe, this is really cool.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: PyMapConv

Post by PicassoCT »

ImportError: No module named Image

Windows..old python install..cryptic error msg be cryptic.. open file, be warned - spaghettis..
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: PyMapConv

Post by Beherith »

Picasso, it needs PIL installed, and python 2.7+ preferably. And pasghetti.
User avatar
code_man
Posts: 260
Joined: 19 Jan 2014, 13:10

Re: PyMapConv

Post 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.
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: PyMapConv

Post 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.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: PyMapConv

Post 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.
User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: PyMapConv

Post 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?
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: PyMapConv

Post 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.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: PyMapConv

Post 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
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: PyMapConv

Post by Beherith »

Fixed, thx
User avatar
Beherith
Posts: 5145
Joined: 26 Oct 2007, 16:21

Re: PyMapConv

Post 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.
User avatar
TurBoss
Jauria RTS Developer
Posts: 89
Joined: 27 Jan 2014, 01:04

Re: PyMapConv

Post by TurBoss »

thank you
User avatar
TurBoss
Jauria RTS Developer
Posts: 89
Joined: 27 Jan 2014, 01:04

Re: PyMapConv

Post 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
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: PyMapConv

Post by Silentwings »

Could you post it onto SpringFiles instead? Or attach to your post as a file.
Post Reply

Return to “Map Tutorials & Resources”