• We have updated our Community Code of Conduct. Please read through the new rules for the forum that are an integral part of Paradox Interactive’s User Agreement.
Hello, I tried using MapUtility to make a few changes, then this happened:
Code:
Log of MapExtractor v1.0.5.0
Logging started at: 09-Jun-18 21:47:22 UTC

Successfully reached start.
Since there were no arguments, doing default extract
Extracting from command -extract
Did not need to create exported maps directory.
Successfully created default images.txt
Extracting images with following parameters: OffsetX=0 OffsetY=0 ImageSizeX=117 ImageSizeY=45 NumImagesX=8 NumImagesY=8
Loading lightmap at G:\Games\Darkest Hour\map
Doing the following image: Offset=(0,180), Size=(117,45)
Extracting grayscale of (0,180), Size=(117,45)


#################################
An exception has occurred.
#################################
Exception: System.ArgumentOutOfRangeException
    Derived from System.ArgumentException
    Derived from System.SystemException
    Derived from System.Exception
09-Jun-18 21:47:27
Message: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source: mscorlib

STACK TRACE
Void ThrowArgumentOutOfRangeException()
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at MapUtility.MapBlock.GetProvinceIdsNewWay(Int32& Offset)
   at MapUtility.MapBlock.EnsureDecompressed()
   at MapUtility.Lightmap.GetTrueColoredGrayscaleLayer(Int32 x, Int32 y, Int32 captureWidth, Int32 captureHeight)
   at MapUtility.Extraction.ExtractGrayscale(Lightmap map, Rectangle bounds)
   at MapUtility.Extraction.ExtractSection(Lightmap lm, Rectangle bounds)
   at MapUtility.Extraction.ExtractFileTask.TaskOverride()
   at CoreLib.Task.DoTask(Int32 index, TaskQueue tq)
   at CoreLib.TaskQueue.DoWork(Object value)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

Doing the following image: Offset=(0,0), Size=(117,45)
Extracting grayscale of (0,0), Size=(117,45)


#################################
An exception has occurred.
#################################
Exception: System.ArgumentOutOfRangeException
    Derived from System.ArgumentException
    Derived from System.SystemException
    Derived from System.Exception
09-Jun-18 21:47:27
Message: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source: mscorlib

STACK TRACE
Void ThrowArgumentOutOfRangeException()
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at MapUtility.MapBlock.GetProvinceIdsNewWay(Int32& Offset)
   at MapUtility.MapBlock.EnsureDecompressed()
   at MapUtility.Lightmap.GetTrueColoredGrayscaleLayer(Int32 x, Int32 y, Int32 captureWidth, Int32 captureHeight)
   at MapUtility.Extraction.ExtractGrayscale(Lightmap map, Rectangle bounds)
   at MapUtility.Extraction.ExtractSection(Lightmap lm, Rectangle bounds)
   at MapUtility.Extraction.ExtractFileTask.TaskOverride()
   at CoreLib.Task.DoTask(Int32 index, TaskQueue tq)
   at CoreLib.TaskQueue.DoWork(Object value)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

Doing the following image: Offset=(0,135), Size=(117,45)
Extracting grayscale of (0,135), Size=(117,45)


#################################
An exception has occurred.
#################################
Exception: System.ArgumentOutOfRangeException
    Derived from System.ArgumentException
    Derived from System.SystemException
    Derived from System.Exception
09-Jun-18 21:47:27
Message: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source: mscorlib

STACK TRACE
Void ThrowArgumentOutOfRangeException()
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at MapUtility.MapBlock.GetProvinceIdsNewWay(Int32& Offset)
   at MapUtility.MapBlock.EnsureDecompressed()
   at MapUtility.Lightmap.GetTrueColoredGrayscaleLayer(Int32 x, Int32 y, Int32 captureWidth, Int32 captureHeight)
   at MapUtility.Extraction.ExtractGrayscale(Lightmap map, Rectangle bounds)
   at MapUtility.Extraction.ExtractSection(Lightmap lm, Rectangle bounds)
   at MapUtility.Extraction.ExtractFileTask.TaskOverride()
   at CoreLib.Task.DoTask(Int32 index, TaskQueue tq)
   at CoreLib.TaskQueue.DoWork(Object value)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

Doing the following image: Offset=(0,270), Size=(117,45)
Extracting grayscale of (0,270), Size=(117,45)


#################################
An exception has occurred.
#################################
Exception: System.ArgumentOutOfRangeException
    Derived from System.ArgumentException
    Derived from System.SystemException
    Derived from System.Exception
09-Jun-18 21:47:27
Message: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source: mscorlib

STACK TRACE
Void ThrowArgumentOutOfRangeException()
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at MapUtility.MapBlock.GetProvinceIdsNewWay(Int32& Offset)
   at MapUtility.MapBlock.EnsureDecompressed()
   at MapUtility.Lightmap.GetTrueColoredGrayscaleLayer(Int32 x, Int32 y, Int32 captureWidth, Int32 captureHeight)
   at MapUtility.Extraction.ExtractGrayscale(Lightmap map, Rectangle bounds)
   at MapUtility.Extraction.ExtractSection(Lightmap lm, Rectangle bounds)
   at MapUtility.Extraction.ExtractFileTask.TaskOverride()
   at CoreLib.Task.DoTask(Int32 index, TaskQueue tq)
   at CoreLib.TaskQueue.DoWork(Object value)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

Doing the following image: Offset=(0,90), Size=(117,45)
Extracting grayscale of (0,90), Size=(117,45)


#################################
An exception has occurred.
#################################
Exception: System.ArgumentOutOfRangeException
    Derived from System.ArgumentException
    Derived from System.SystemException
    Derived from System.Exception
09-Jun-18 21:47:27
Message: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source: mscorlib

STACK TRACE
Void ThrowArgumentOutOfRangeException()
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at MapUtility.MapBlock.GetProvinceIdsNewWay(Int32& Offset)
   at MapUtility.MapBlock.EnsureDecompressed()
   at MapUtility.Lightmap.GetTrueColoredGrayscaleLayer(Int32 x, Int32 y, Int32 captureWidth, Int32 captureHeight)
   at MapUtility.Extraction.ExtractGrayscale(Lightmap map, Rectangle bounds)
   at MapUtility.Extraction.ExtractSection(Lightmap lm, Rectangle bounds)
   at MapUtility.Extraction.ExtractFileTask.TaskOverride()
   at CoreLib.Task.DoTask(Int32 index, TaskQueue tq)
   at CoreLib.TaskQueue.DoWork(Object value)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

Doing the following image: Offset=(0,45), Size=(117,45)
Extracting grayscale of (0,45), Size=(117,45)


#################################
An exception has occurred.
#################################
Exception: System.ArgumentOutOfRangeException
    Derived from System.ArgumentException
    Derived from System.SystemException
    Derived from System.Exception
09-Jun-18 21:47:27
Message: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source: mscorlib

STACK TRACE
Void ThrowArgumentOutOfRangeException()
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at MapUtility.MapBlock.GetProvinceIdsNewWay(Int32& Offset)
   at MapUtility.MapBlock.EnsureDecompressed()
   at MapUtility.Lightmap.GetTrueColoredGrayscaleLayer(Int32 x, Int32 y, Int32 captureWidth, Int32 captureHeight)
   at MapUtility.Extraction.ExtractGrayscale(Lightmap map, Rectangle bounds)
   at MapUtility.Extraction.ExtractSection(Lightmap lm, Rectangle bounds)
   at MapUtility.Extraction.ExtractFileTask.TaskOverride()
   at CoreLib.Task.DoTask(Int32 index, TaskQueue tq)
   at CoreLib.TaskQueue.DoWork(Object value)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

Doing the following image: Offset=(0,315), Size=(117,45)
Extracting grayscale of (0,315), Size=(117,45)


#################################
An exception has occurred.
#################################
Exception: System.ArgumentOutOfRangeException
    Derived from System.ArgumentException
    Derived from System.SystemException
    Derived from System.Exception
09-Jun-18 21:47:27
Message: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source: mscorlib

STACK TRACE
Void ThrowArgumentOutOfRangeException()
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at MapUtility.MapBlock.GetProvinceIdsNewWay(Int32& Offset)
   at MapUtility.MapBlock.EnsureDecompressed()
   at MapUtility.Lightmap.GetTrueColoredGrayscaleLayer(Int32 x, Int32 y, Int32 captureWidth, Int32 captureHeight)
   at MapUtility.Extraction.ExtractGrayscale(Lightmap map, Rectangle bounds)
   at MapUtility.Extraction.ExtractSection(Lightmap lm, Rectangle bounds)
   at MapUtility.Extraction.ExtractFileTask.TaskOverride()
   at CoreLib.Task.DoTask(Int32 index, TaskQueue tq)
   at CoreLib.TaskQueue.DoWork(Object value)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

Doing the following image: Offset=(0,225), Size=(117,45)
Extracting grayscale of (0,225), Size=(117,45)


#################################
An exception has occurred.
#################################
Exception: System.ArgumentOutOfRangeException
    Derived from System.ArgumentException
    Derived from System.SystemException
    Derived from System.Exception
09-Jun-18 21:47:27
Message: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
Source: mscorlib

STACK TRACE
Void ThrowArgumentOutOfRangeException()
   at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at MapUtility.MapBlock.GetProvinceIdsNewWay(Int32& Offset)
   at MapUtility.MapBlock.EnsureDecompressed()
   at MapUtility.Lightmap.GetTrueColoredGrayscaleLayer(Int32 x, Int32 y, Int32 captureWidth, Int32 captureHeight)
   at MapUtility.Extraction.ExtractGrayscale(Lightmap map, Rectangle bounds)
   at MapUtility.Extraction.ExtractSection(Lightmap lm, Rectangle bounds)
   at MapUtility.Extraction.ExtractFileTask.TaskOverride()
   at CoreLib.Task.DoTask(Int32 index, TaskQueue tq)
   at CoreLib.TaskQueue.DoWork(Object value)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart(Object obj)

Here's the settings:
Code:
#This contains settings for MapUtility, and can be shared among the programs

#The path to the game
#If the game exe is at C:\DD\HoI.exe, this would be GamePath=C:\DD
GamePath=G:\Games\Darkest Hour

#The max province number
MaxProvinceNumber=7000

#The width and height of lightmap1, the biggest one.
#The width and height are in blocks (each block is 32x32 pixels)
Lightmap1Width=936
Lightmap1Height=360

#The number of lightmaps
#Currently, only NumLightmaps=3 and NumLightmaps=4 are supported
NumLightmaps=4

#The width in bytes of each offset in the lightmap header
#Currently only 3 and 4 are supported
LightmapOffsetWidth=4

IdsAreNewWay=true

#The width of each value in index.tbl, in bytes
#Currently only 2 and 4 are supported
IndexTblValueWidth=4

#The number of entries that should be in the adjacent table
#This is strictly optional
#Usually used only with HoI
AdjacentTableEntryCount=14860
 
Hi guys,

I have a problem with the naval distances in my mod of HoI2 DD Armageddon. I edited the map with Jamie's MapUtility and followed all the steps accurately. After many tests, I’ve eventually managed to get the game work, even fixing the odd adj-mod/connections issue.
My first editing test consisted in separating the island of Zanzibar from the mainland province, so I’ve created a new province 2602 with the right colour IDs (no changes in the colorscales but just in the provID) and I’ve set all the facility coordinates, added a port seazone (I used Hofn) and added a connection to the sea (I’ve balanced this connection with removing a land connection in Europe (Triest-Ljubljana takes 13 days! Then no reason to go through it).

Now, I launched the game and it worked smoothly, I could see the new province but I couldn’t move my navy to the island as it is more than 10.000 miles away from the starting navalbase of my navy (I’ve assigned Zanzibar to the sultanate of Muscat in a XVIII century mod. Normally, Muscat is less than 3.000 miles far). If I add a port, I can rebase my ships to the island and the blue arrow is correct, but then I obviously cannot move any ships to the surrounding sea (Zanzibar Channel) as it is too far away.
To test this issue, I’ve added a sea connection from the mainland Zanzibar in Africa (1140) to the island (2602) through the Zanzibar Channel (2031) in the adj-defs.csv file in HoI2\map, but the directional blue arrow is heading to Paris! Or it ends somewhere close to Paris. I don’t know if the Paris province is really involved in this all, or if the arrow is heading to Hofn but couldn't get to there.

I’ve done a new test, modding a useless random province (I picked province 1616, Pulusuk in the Carolines) and setting new coordinates, so to incorporate the map’s Pulusuk islands of former ID 1616 into another cluster of islands nearby, and I’ve assigned ID 1616 to the newly independent island of Zanzibar.
Again I’ve played a bit with the connections, which now look this way:

(759;2573;Delete
2573;759;Delete)
1616;2249;Delete
2249;1616;Delete
1616;2031;Add
1616;2031;Add

The result is that I can launch the game, but now the Zanzibar 1616 province is again thousands of miles away from Muscat (the same navaldistance to get to the former 1616 in the Carolines). Although it is geographically located in the Zanzibar Channel, the new province 1616 is still considered as part of the Carolines archipelago. So the navy from the Arabian peninsula can’t get there.
If I build up a port, the ships can rebase there (with a correct trajectory of the blue arrow) but they cannot move anywhere else except for the seas of the Caroline islands (see the picture).

navy.png



With a sea connection from mainland Africa to the island of Zanzibar, the blue arrow now heads to the sea 2249 of the former ID 1616 in the Carolines (see the pictures).

troops.png


troops2.png



That’s weird. I’ve tried my tests but none worked out. I still don’t know how to figure this out. Is it a bug of the navaldistance calculations or because of any wrong X Y position (maybe the ObjectEditor) that I’ve missed?

Hope I’ve explained the issue clearly. If anyone has ever encountered this issue and/or knows how to deal with it, any tips would be extremely appreciated!
Thanks
 
Last edited:
Hi,
first of all, please open a new thread instead of posting in old threads, since those threads are only marginally related to your issue.

About your issue, please provide more details. Which files did you change? What are the new values in these files?
When you talk about coordinates without giving them, I fear that you're mixing the DHFull and the HOI2 system.
 
Thank you for your reply, AC. I posted my issue in the threads which contain comments on the modding tools that I use or on similar issues. However I don’t want to mess this thread up, so I’ll open a new thread if needed.

Basically, I use HOI2 patched 1.3, I’ve modded the scenario and personalised countries, territories etc, without altering the map. When I read of the Jamie’s MapUtility for Doomsday Armageddon to edit the map, I’ve downloaded Armageddon and modded the map with MapUtility, then I imported the new Armageddon map files into the HOI2 files. There were no issues of compatibility so far, as everything that worked out in Armageddon worked out in HOI2 alike, and what didn’t work in Armageddon didn’t work in HOI2 either.
However if it is a matter of compatibility between different HOI2 versions, I’ll accept my fate and go for the version that eventually works out.

As for your questions, after using MapMaker and pasting the new files (adjacent.tbl, 4 lightmaps, boundbox and index), I’ve run ObjectEditor and set the coordinates for port, airbases, capital and other facilities in province.csv. I suppose the new values in the row are correct. In the case of province 1616, I compared the new values with the old ones and they all differ from one another. So there should be no overlapping – I guess – of values from the previous 1616 row to the new 1616 row. As for the new province 2602, there were no previous values in this row, so I guess that the new values should not contain mistakes.
I also edited province_names.csv (just the name of the province I was working on), adj-defs.csv (to adapt it to the scenario, if needed) and the scenario .inc files (to assign 2602 to Muscat or replace 1616 from the previous owner to the new one).

At some point I thought the bug was due to the port seazone (was it a coincidence that I used Hofn’s seazone, and the naval distance and blue arrow were heading up north?) so I used the seazone 2031 (Zanzibar Channel – the correct one) in the province 2602 test and later in the province 1616 test (I didn’t simply change the province.csv, but I started over the modding process, creating new lightmaps and editing the vanilla excel file).

Still no improvement. Naval distance and the directional blue arrow still head to nowhere (up north towards Iceland for 2602 and eastwards in the Carolines for 1616).
If you want I can paste the values of the excel rows I modded. Don’t know what else to do.

However I hope I haven’t messed with the DHFull and HOI2 system as you fear, as this would mean that the modding is not feasible in certain HOI2 versions.. goddamn!
Thanks
 
Well, first of all I am afraid that while DH is built over HOI2, it developed significant differences over the years, so that could be a source of issues. For example, if I remember correctly, HOI2 used a pixel-based system to calculate distance, whereas DH uses a real-life coordinate system.

Moreover I am not particularly familiar with the map system of HOI2, so I am afraid I cannot give you any particular insight.

My best guess is that you didn't modify properly some values in province.csv, but it's just a guess, so I can only suggest to double-check all values, to see if they make sense (they are similar to a neighbouring province).

Good luck.