PyMapConv

PyMapConv

Tutorials & Resources For Mappers

Moderator: Moderators

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

PyMapConv

Post by Beherith » 03 Feb 2016, 11:27

A full python implementation of mapconv. With GUI. Also supports full decompilation and recompilation.
The only thing it doesnt do is lossy tiling smt compression, it does do lossless though.
On 32bit machines it compiles 32x32 maps easily.
Very verbose error checking.

Spaghetti and meatballs code.

Also supports 16bit png heightmaps.

https://github.com/Beherith/springrts_smf_compiler

UI:
Image

EDIT: Now includes a windows binary so that python is no longer needed (prebuilt pymapconv.exe, make sure to keep all the other files next to it though!)
1 x

User avatar
Jools
XTA Developer
Posts: 2802
Joined: 23 Feb 2009, 16:29

Re: PyMapConv

Post by Jools » 03 Feb 2016, 18:55

Very cool thing. Thanks!
0 x

gajop
Moderator
Posts: 3020
Joined: 05 Aug 2009, 20:42

Re: PyMapConv

Post by gajop » 03 Feb 2016, 19:18

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
0 x

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6088
Joined: 29 Apr 2005, 01:14

Re: PyMapConv

Post by FLOZi » 03 Feb 2016, 19:41

Beherith only does awesome
0 x

Kloot
Spring Developer
Posts: 1863
Joined: 08 Oct 2006, 16:58

Re: PyMapConv

Post by Kloot » 03 Feb 2016, 20:17

How many mapconvs does this make now?
0 x

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

Re: PyMapConv

Post by Beherith » 03 Feb 2016, 20:25

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
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14564
Joined: 17 Nov 2005, 02:43

Re: PyMapConv

Post by Forboding Angel » 04 Feb 2016, 07:03

This pretty much blows all other mapconvs into instant obsolescence. Thanks Behe, this is really cool.
0 x

User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10184
Joined: 24 Jan 2006, 21:12

Re: PyMapConv

Post by PicassoCT » 04 Feb 2016, 19:40

ImportError: No module named Image

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

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

Re: PyMapConv

Post by Beherith » 04 Feb 2016, 20:01

Picasso, it needs PIL installed, and python 2.7+ preferably. And pasghetti.
0 x

User avatar
code_man
Posts: 260
Joined: 19 Jan 2014, 13:10

Re: PyMapConv

Post by code_man » 05 Feb 2016, 17:17

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.
0 x

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

Re: PyMapConv

Post by Beherith » 06 Feb 2016, 01:16

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.
0 x

gajop
Moderator
Posts: 3020
Joined: 05 Aug 2009, 20:42

Re: PyMapConv

Post by gajop » 06 Feb 2016, 01:29

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.
0 x

User avatar
enetheru
Posts: 627
Joined: 11 Jun 2010, 07:32

Re: PyMapConv

Post by enetheru » 07 Feb 2016, 12:43

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?
0 x

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

Re: PyMapConv

Post by Beherith » 07 Feb 2016, 15:52

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.
0 x

User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14564
Joined: 17 Nov 2005, 02:43

Re: PyMapConv

Post by Forboding Angel » 07 Mar 2016, 08:28

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
0 x

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

Re: PyMapConv

Post by Beherith » 07 Mar 2016, 15:13

Fixed, thx
0 x

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

Re: PyMapConv

Post by Beherith » 28 Oct 2016, 13:16

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.
1 x

User avatar
TurBoss
Jauria RTS Developer
Posts: 88
Joined: 27 Jan 2014, 01:04

Re: PyMapConv

Post by TurBoss » 28 Oct 2016, 14:24

thank you
0 x

User avatar
TurBoss
Jauria RTS Developer
Posts: 88
Joined: 27 Jan 2014, 01:04

Re: PyMapConv

Post by TurBoss » 07 Jan 2017, 17:56

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
0 x

User avatar
Silentwings
Moderator
Posts: 3570
Joined: 25 Oct 2008, 00:23

Re: PyMapConv

Post by Silentwings » 07 Jan 2017, 20:44

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

Post Reply

Return to “Map Tutorials & Resources”

cron