MapConv(NG) for Windows crash on big map sizes

MapConv(NG) for Windows crash on big map sizes

Discuss maps & map creation - from concept to execution to the ever elusive release.

Moderator: Moderators

Post Reply
User avatar
PepeAmpere
Posts: 577
Joined: 03 Jun 2010, 01:28

MapConv(NG) for Windows crash on big map sizes

Post by PepeAmpere » 15 Jun 2018, 00:38

Sadly I'm not able to process my map source data in MapConv if the map size gets over some size. I was historically able to produce 24x24 maps, currently even texture of 22x22 map is problem and I receive

Code: Select all

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
I guess there is hidden problem with memory allocation but not sure where the memory is missing - for sure it is not drive where temp files are created - have 25 GB of free space for 18x18-32x32 map with texture of size between 200-800 MB. Do I need bigger ram? Space on C drive? Memory for GPU? some graphic settings?

I'm not sure if it helps but one of by batch files i run launching mapconv (this one is referencing one of the older versions of MapConv, but I tried the latest versions as well and results are same from perspective of this issue) with all params looks like this

Code: Select all

n:\nota_dev_pack\tools\mapconv\MapConv.exe -i -l -c 0^
 -x 471^
 -n -40^
 -o "n:\nota_dev_pack\000\SpringData\maps\mffarena002.sdd\maps\mffarena002v1.smf"^
 -t "n:\nota_dev_pack\000\courses\mffmap002\texture4.bmp"^
 -a "n:\nota_dev_pack\000\courses\mffmap002\height8bit.bmp"^
 -m "metal.bmp"^
 -z "n:\nota_dev_pack\tools\mapconv\nvdxt.exe -dxt1a -nmips 4 -Sinc -quality_highest -file"
pause
For maps up to 16x16 I observe no problems.
0 x

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

Re: MapConv(NG) for Windows crash on big map sizes

Post by Silentwings » 15 Jun 2018, 00:57

32 bit mem allocation limit.

Use pymapconv, https://github.com/Beherith/springrts_smf_compiler
0 x

User avatar
PepeAmpere
Posts: 577
Joined: 03 Jun 2010, 01:28

Re: MapConv(NG) for Windows crash on big map sizes

Post by PepeAmpere » 15 Jun 2018, 22:01

I'm not able to build it because http://effbot.org/downloads/PIL-1.1.7.win32-py2.7.exe install crash on my PC.

Do you have windows build of pymapconv, please?
0 x

User avatar
PepeAmpere
Posts: 577
Joined: 03 Jun 2010, 01:28

Re: MapConv(NG) for Windows crash on big map sizes

Post by PepeAmpere » 15 Jun 2018, 22:08

PepeAmpere wrote:I'm not able to build it because http://effbot.org/downloads/PIL-1.1.7.win32-py2.7.exe install crash on my PC.

Do you have windows build of pymapconv, please?
Ok nvm, it was stupid Program Files (x86) install folder...

but I have another issue:

Code: Select all

n:\nota_dev_pack\tools\springrts_smf_compiler-master>python setup.py build
Traceback (most recent call last):
  File "setup.py", line 2, in <module>
    from cx_Freeze import setup, Executable
ImportError: No module named cx_Freeze
so I manually added https://pypi.org/project/cx_Freeze/#files but now I get

Code: Select all

n:\nota_dev_pack\tools\springrts_smf_compiler-master>python setup.py build
Traceback (most recent call last):
  File "setup.py", line 29, in <module>
    shortcutDir="DesktopFolder",
TypeError: __init__() got an unexpected keyword argument 'appendScriptToLibrary'
0 x

User avatar
PepeAmpere
Posts: 577
Joined: 03 Jun 2010, 01:28

Re: MapConv(NG) for Windows crash on big map sizes

Post by PepeAmpere » 15 Jun 2018, 22:24

if i call mapconv.py directly from batch file, processing works up to

Code: Select all

Compiling SMF with the following options: Namespace(decompile=None, featurelist=None, featuremap=None, featureplacement=None, geoventfile='geovent.bmp', grassmap=None, heightmap='n:\\nota_dev_pack\\000\\courses\\dotamap\\height.bmp', intex='n:\\nota_dev_pack\\000\\courses\\dotamap\\texture.bmp', linux=False, maxheight=200.0, metalmap='metal.bmp', minheight=-55.0, minimap=None, nvdxt_options='-Sinc -quality_highest', outfile='n:\\nota_dev_pack\\000\\SpringData\\maps\\dotamap30.sdd\\maps\\dotamap30.smf', quick=False, typemap=None)
Texture image n:\nota_dev_pack\000\courses\dotamap\texture.bmp seems to have the correct dimensions (15360x15360) for a spring map size of (30x30)
Texture image n:\nota_dev_pack\000\courses\dotamap\texture.bmp is RGB, just making sure you dont have alpha in it...
Warning: you are using an 8-bit heightmap. This will most likely result in terracing effects, so consider switching to 16-bit depth .png!
Traceback (most recent call last):
  File "N:\nota_dev_pack\tools\springrts_smf_compiler-master\pymapconv.py", line 919, in <module>
    okbuttonhandler(parser)
  File "N:\nota_dev_pack\tools\springrts_smf_compiler-master\pymapconv.py", line 916, in okbuttonhandler
    compileSMF(parsed_args)
  File "N:\nota_dev_pack\tools\springrts_smf_compiler-master\pymapconv.py", line 282, in compileSMF
    heights.append(sum(otherheight_pixels[col, row]) * 256 / 3)
TypeError: 'int' object is not iterable
0 x

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

Re: MapConv(NG) for Windows crash on big map sizes

Post by Silentwings » 16 Jun 2018, 09:59

I think you've found a bug that's likely only triggered if you use a low res (8-bit) height map. Try using a proper res (16-bit) height map.

Alternatively, quickfix attempt without reading any code:

Code: Select all

heights.append([sum(otherheight_pixels[col, row]) * 256 / 3])
0 x

User avatar
PepeAmpere
Posts: 577
Joined: 03 Jun 2010, 01:28

Re: MapConv(NG) for Windows crash on big map sizes

Post by PepeAmpere » 16 Jun 2018, 13:44

Silentwings wrote:I think you've found a bug that's likely only triggered if you use a low res (8-bit) height map. Try using a proper res (16-bit) height map.

Alternatively, quickfix attempt without reading any code:

Code: Select all

heights.append([sum(otherheight_pixels[col, row]) * 256 / 3])
I was trying to debug it and it looks like all variables are valid. No idea why it fails in the cycle. I tried your fix, does not help, error is still the same.

If I use 16bit-grey heightmap, i get error ending with this

Code: Select all

Texture image n:\nota_dev_pack\000\courses\dotamap\texture.bmp is RGB, just making sure you dont have alpha in it...
You are using 65534 unique height levels in your heightmap.
Traceback (most recent call last):
  File "N:\nota_dev_pack\tools\springrts_smf_compiler-master\pymapconv.py", line 919, in <module>
    okbuttonhandler(parser)
  File "N:\nota_dev_pack\tools\springrts_smf_compiler-master\pymapconv.py", line 916, in okbuttonhandler
    compileSMF(parsed_args)
  File "N:\nota_dev_pack\tools\springrts_smf_compiler-master\pymapconv.py", line 296, in compileSMF
    metalmap.append(metalimage_pixels[col, row][0])
TypeError: 'int' object has no attribute '__getitem__'
FYI
  • I made sure metal map have proper size
  • I save the metal map as 8bit bmp
Last edited by PepeAmpere on 16 Jun 2018, 13:52, edited 1 time in total.
0 x

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

Re: MapConv(NG) for Windows crash on big map sizes

Post by Silentwings » 16 Jun 2018, 13:50

I don't think my suggested fix could have given the exact same error message.

All variables are defined, what's needed is effectively a type conversion, from int to a single element list.
0 x

User avatar
PepeAmpere
Posts: 577
Joined: 03 Jun 2010, 01:28

Re: MapConv(NG) for Windows crash on big map sizes

Post by PepeAmpere » 16 Jun 2018, 13:55

Silentwings wrote:I don't think my suggested fix could have given the exact same error message.

All variables are defined, what's needed is effectively a type conversion, from int to a single element list.
Based on https://www.tutorialspoint.com/python/list_append.htm there is no need for conversion of this kind (unless I look at docu of wrong python version), if its already int, isn't it? Btw the error have some problem with the iterator.
0 x

User avatar
PepeAmpere
Posts: 577
Joined: 03 Jun 2010, 01:28

Re: MapConv(NG) for Windows crash on big map sizes

Post by PepeAmpere » 16 Jun 2018, 14:03

Btw even for this MapConv version I still use 32bit python and 32bit extensions (I used the suggested setup from repo). If there was originally some limit regarding this, is it here as well?
0 x

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

Re: MapConv(NG) for Windows crash on big map sizes

Post by Silentwings » 17 Jun 2018, 08:08

Ok, I'll look at the error again when I'm home this week. If you could zip your heightmaps and upload them somewhere that would be handy.

32bit python ... some limit ... here as well?
Not here - pymapconv has a different architecture. I think the size of map it will compile is basically limitless; also it is much nicer to work with than old mapconv. This 28x28 map was one I compiled with it https://springfiles.com/spring/spring-maps/faya
0 x

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

Re: MapConv(NG) for Windows crash on big map sizes

Post by Beherith » 17 Jun 2018, 14:22

That metalmap error was throw because metalmap is traditionally the red channel of 8bit rgb bmp e.g metalmap[row,col][0]. Use 8bit rgb metal map instead of 8bit greyscale.
0 x

Post Reply

Return to “Map Creation”