• Empire Earth
  • Miscellaneous

Elevation Files?

For discussion about scenarios! Post your scenarios, comment on others' scenarios, discuss triggers, and so on.

Elevation Files?

Postby bradleybrand » Thu Apr 20, 2017 9:53 am

Does anyone have any Elevation Files available or could make some for us to share among the community? My ideas include World (if any site allows to create), Korean Peninsula, Americas, UK, some of Europe, etc.
B Brand.
bradleybrand
Basic Member
 
Posts: 35
Joined: Sat Nov 16, 2013 9:53 am
Location: England

Re: Elevation Files?

Postby bradleybrand » Tue Feb 26, 2019 3:56 pm

Nobody know ? ?
B Brand.
bradleybrand
Basic Member
 
Posts: 35
Joined: Sat Nov 16, 2013 9:53 am
Location: England

Re: Elevation Files?

Postby Neotje » Fri Mar 01, 2019 2:20 pm

I remember there used to be a website where you could download this. But I do not remember where... As this was 10 years ago, I also for sure don't have these files anymore.

I would look on heavengames if I were you, for example here is one for Europe:
http://ee.heavengames.com/downloads/sho ... ileid=3168

If this one works you should be able to find out how the data works and make one yourself from 'some' datasource.

[Edit]
They also got some information on how the datafiles work:
http://ee.heavengames.com/new/eeh/mapde ... tion.shtml
Neotje
Intermediate Member
 
Posts: 68
Joined: Sun Mar 29, 2009 10:02 am

Re: Elevation Files?

Postby bradleybrand » Thu Mar 14, 2019 9:40 am

The Links on Heaven Games have long expired. I have them two Elevation Files and they are very Good. :)

I was wondering about how to make some new specific locations. Like say Israel region and Neighbours. Or I once heard someone imported Elevation using a Image file too, which sounds cool. So draw a Image with Microsoft Paint and Import it into Game.
B Brand.
bradleybrand
Basic Member
 
Posts: 35
Joined: Sat Nov 16, 2013 9:53 am
Location: England

Re: Elevation Files?

Postby Neotje » Sat Mar 23, 2019 5:39 pm

Yes, that should be possible. I have not looked into it very deeply, but the dataformat seems somewhat simple, you just need a way to save it as such.

According to the heavengames link I gave above the data is stored as binary, combined with the mapsize (e.g. 1400x700, or 2500x1600 or w/e). I checked in one of the files I could download there, and it seems there are 2 bytes per position. So it is probably int16 or uint16 data.

What you need is a program that can read in a binary blob, interpret every 2 bytes as a single int16 or uint16, and then see if what you get makes sense.

If this works, you can create a map yourself and save it as such. I might have a look how to do this with python, but I never played with storing raw binary files, so I'm not promising anything as of yet.
Neotje
Intermediate Member
 
Posts: 68
Joined: Sun Mar 29, 2009 10:02 am

Re: Elevation Files?

Postby Neotje » Sun Mar 24, 2019 12:59 pm

Alright, so I have been looking into it for you a littlebit. Data is stored as int16 (so integers with 16 bits per position). A negative value denotes water, positive values give land.

You can quite easily read in the files with python, the following code for example reads in the datafile from the first link I provided, and plots it. Note that it is quite hard to discern where the water starts because the European coastline is quite shallow compared to the height of the Alps...

Code: Select all
fileName = "<path to>\Map of Europe.dat"

with open(fileName, mode='rb') as file: # b is important -> binary
    fileContent = file.read()
   
import matplotlib.pyplot as plt
import numpy as np
f = open(fileName)

#%%
data=np.fromfile(fileName,'i2')
data_array=np.reshape(data,(1201,1801))
plt.figure()
plt.imshow(data_array)


Writing these binary files also seems quite straightforward, the following code will write the data in 'data' to a correct binary file:
Code: Select all
np.ndarray.tofile(data,'filename_of_the_output.bin')

Just make sure that data contains your heightdata, in int16 format and you should be good to go.

Pyton in general is pretty nice on importing data in different formats, so you just need some datasource, import the data in python, then you can modify it (for example, you can make mountains flatter, water less deep, smoothen out the surface etc) and after modification you can save again, export to this binary format.
Importing images in python is also very possible.

In case you have never used python, I use the Anaconda distribution https://www.anaconda.com/distribution/#download-section, after installation run spyder and you get a nice graphical user interface where you can run the code I put up above. If you have some more questions please ask.
Neotje
Intermediate Member
 
Posts: 68
Joined: Sun Mar 29, 2009 10:02 am


Return to Scenario Discussion

Who is online

Users browsing this forum: No registered users and 1 guest


cron