Emerald World #2


Thanks to the quick and useful responses on the Celestal Heavens forum, I could extract the height map of the Emerald Island to recreate it in Godot.

In order to do it:

  1. I installed Might and Magic 7 vanilla and then the GrayFace’s patch.
  2. Afterwards, I downloaded the MM7Extension and pasted it into the game installation directory.
  3. Start a new game, Ctrl+F1 to bring up the debug menu. The debug menu accepts Lua scripts. The following suffices to dump the height map data to a CSV format:
map_file = io.open("emerald_height_map.txt", "w")
for k in Map.HeightMap do
  for j in Map.HeightMap[k] do
    map_file:write(Map.HeightMap[k][j], ",")
  end
  map_file:write("\n")
end
map_file.close()

The height map, when copied into LibreCalc with value based colors gave the following, ok-ish looking result:

  1. I could then use Python to convert the CSV file to an image:
from PIL import Image
import numpy
my_data = numpy.genfromtxt("emerald_height_map.txt", delimiter=',')
im = Image.fromarray(my_data)
im2 = im.convert("L")
im2.save("emerald.png")
  1. Since Godot height maps’ seem to prefer OpenEXR format, I used Gimp to open the PNG file, and simply export as EXR.
  2. I then followed a concise tutorial, starting from the half, to get a collision map, and a mesh for the island.

The final result, imperfect but showing the map loaded into Godot, looks like this:

    Brief overlook from the starting location, as in the original.

    Compared to the following original, you can recognize the major features of the island, although its height is not ideal, textures are wrong and it’s more “spiky”.

    , ,

    Leave a Reply

    Your email address will not be published. Required fields are marked *