View Full Version : Any chance to parse in the map ???
alexrain
03-15-2006, 15:49
Hi guys,
first, I would like to thank everyone for this beatiful mod !
Its really astonishing what you have done already....
At the moment I am currently trying to develop an internet based strategic game like www.ferion.com with a real map using the roman empire setting.
I would like to use the map from EB. Is it possible to extract some kind of flat file (no picture !!!) with something like the tile information for each coordinate ?
Does anyone knows a way to do that?
I am planning to read it into an OracleXE DB using SVG for displaying a map....
Also a way to extract the province, resource etc. would be helpful.
At the moment I am using the map from gladius et pilum -> www.quirxel.de (in german) but that map is not realistic...
any feedback or suggestion is welcome! Any format like csv/txt or and database format,even a sql dump would be helpfull...
LorDBulA
03-15-2006, 17:33
Informations about map are stored in multiple TGA files.
So its just a question of converting this data to format you need.
Sorry but i dont know anything about OracleXE DB and SVG so i dont know what data it needs (and what you plan to use in your map).
alexrain
03-15-2006, 22:08
Thanks for the information but I cant parse data out of an image file....
at least I cant see a way to do that....
What I just need is just a format to insert the information for tile xx:yy into a database. May I ask how you create your map? Do you use something like Coreldraw?
What I am planning to do is to create some kind of EB online ... (ok, real time battles cant be done ;) but most of the rest ....
LorDBulA
03-16-2006, 07:16
Well basically you would have to write program that would extract this data for you. I dont think you can find ready program that can do it for you (its very unusual task).
How complicated you want to make your map?
What data you need?
City , Port positions, province positions (quite obvious), rivers, river crossings, ground height , climate, ground type, cliffs positions, volcanos etc...
alexrain
03-16-2006, 14:52
I takle everything what I can get....
But just the outlay with the basic terrain would be ok.
To create a map on my own would take months.
Who created the map in the EB team ?
LorDBulA
03-16-2006, 15:55
When i joined EB eadings was working on map. But i dont know if he is the original creator of this map.
Malrubius
03-16-2006, 17:17
I believe Dead Moroz was the original mapper, then eadingas and now Meneldil.
alexrain
03-16-2006, 19:52
ok, I think I found a way to parse in the data....
1. Get CorelDraw and load the Map file.
2. save the map file as *.xwd (windows dump file format)
3. open the file with something like ultraedit or so in HEX-Format
4. in the first 10-20 blocks you will find the meta information (size in pixel etc)
5. after that you get each pixel using RGB and the color strength...
voila:
now you can use something like C# or Java and read out the content ;)
The result can be inserted into the database and then you can use it for some kind of online game....
the only thing I need is now something like a description for the regions vegetation etc in the TGA pictures (map_regions.tga, map_climates.tga etc...)
Do you have any information about this ????
BTW: If anyone is a specialist in OracleXE 10g and /or .NET C# freak...
i could need any help I can get...
;)
LorDBulA
03-16-2006, 20:22
I dont get it why do you load it with CorelDraw?
This is format of TGA file ( i looked it up some time ago when i needed to load RTW TGA province map so i can find positions of all cities)
TGA File Format
A .tga file is commonly used graphic file format that is easy to read and write.
Format Notes
* TGA files support 8,15,16,24,32 bit depths.
* 8 bit can be grey scale
* Runlength compression
* Additional Footer information optional x/y origin relative to lower left with origin in lower left
* descriptor: 00vhaaaa
o h horizontal flip
o v vertical flip
o a alpha bits
File Header (18 bytes)
typedef struct
{
byte identsize; // size of ID field that follows 18 byte header (0 usually)
byte colourmaptype; // type of colour map 0=none, 1=has palette
byte imagetype; // type of image 0=none,1=indexed,2=rgb,3=grey,+8=rle packed
short colourmapstart; // first colour map entry in palette
short colourmaplength; // number of colours in palette
byte colourmapbits; // number of bits per palette entry 15,16,24,32
short xstart; // image x origin
short ystart; // image y origin
short width; // image width in pixels
short height; // image height in pixels
byte bits; // image bits per pixel 8,16,24,32
byte descriptor; // image descriptor bits (vh flip bits)
// pixel data follows header
} TGA_HEADER
Example File Header
Here is the header of a 32 bit image with dimensions 1920x1080. Note that these hex rows are 18 bytes so the entire TGA header is on the top row. Also notice that even though the columapbits is set to 32 the bits is set to 24, thus the pixel data is actually 24 bpp.
00000000 00 00 02 00 00 00 00 20 00 00 00 00 80 07 38 04 18 00 ....... ......8...
00000018 31 52 41 18 52 10 10 6A 18 31 6A 5A 39 73 5A 41 73 6A 1RA.R..j.1jZ9sZAsj
00000036 52 73 7B 52 73 9C 39 5A 7B 31 4A 6A 31 4A 73 41 6A 94 Rs{Rs.9Z{1Jj1JsAj.
00000054 52 73 A4 29 20 18 20 18 10 10 10 10 18 18 18 29 29 29 Rs.) . ........)))
00000072 20 29 29 29 31 31 29 31 31 29 39 39 39 39 39 31 31 39 )))11)11)99999119
00000090 20 31 31 39 39 39 31 41 41 31 39 41 31 39 39 31 39 39 119991AA19A199199
descr_regions.txt file in \Data\world\maps\campaign\imperial_campaign directory contains info about provinces internal names(rgb colour) and city internal names. Real visible names are stored inside Data\text\imperial_campaign_regions_and_settlement_names.txt.
The rest i dont know.
Maybe i could help you with c++ but not with c#.
alexrain
03-17-2006, 09:19
hmm I dont think that I can use TGA because not every pixel is described...
There is a map editor available where each region/vegetation/climate color code is described.
Thanks for your help!!!
vBulletin® v3.7.1, Copyright ©2000-2025, Jelsoft Enterprises Ltd.