• 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.

Inferis

TBL File Hacker
21 Badges
Jul 2, 2001
1.574
0
www.inferis.org
  • Stellaris
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Prison Architect
  • Cities: Skylines Industries
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Stellaris: Apocalypse
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Mass Transit
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II
  • Cities: Skylines - Snowfall
  • Cities: Skylines - After Dark
  • Europa Universalis III: Collection
  • Cities: Skylines
  • 500k Club
  • Victoria 2
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis III
Okay, small update. I have managed to find some time to continue work on this. Basically, I'm building a library modify the EU2 files. At the moment, all it does it read stuff, but there are "provisions" to add writing too. This includes the text files (eg provinces.csv).

Regarding editing the map: I've said before it is really hard. I've been fighting with figuring out an algorithm to compress an image to the TBL format, but again: fucking hard. :)
 

Hive

Lex Superior
19 Badges
Oct 16, 2002
12.250
15
  • Heir to the Throne
  • Europa Universalis IV: Pre-order
  • 500k Club
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Europa Universalis IV: Res Publica
  • Europa Universalis III Complete
  • March of the Eagles
  • Europa Universalis III Complete
  • Hearts of Iron Anthology
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III
  • Crusader Kings II
Inferis said:
Okay, small update. I have managed to find some time to continue work on this. Basically, I'm building a library modify the EU2 files. At the moment, all it does it read stuff, but there are "provisions" to add writing too. This includes the text files (eg provinces.csv).

Regarding editing the map: I've said before it is really hard. I've been fighting with figuring out an algorithm to compress an image to the TBL format, but again: fucking hard. :)

In Inferis we trust.
 

unmerged(5110)

Field Marshal
Jul 29, 2001
4.432
0
tse.dyndns.org
Inferis said:
Okay, small update. I have managed to find some time to continue work on this. Basically, I'm building a library modify the EU2 files. At the moment, all it does it read stuff, but there are "provisions" to add writing too. This includes the text files (eg provinces.csv).

Regarding editing the map: I've said before it is really hard. I've been fighting with figuring out an algorithm to compress an image to the TBL format, but again: fucking hard. :)
You know, the more information you can give us on that website of yours, perhaps the more somebody will go on the forum, read this thread, read your website and might have a good idea or two... hmmmm???? ;)
 

Elmokki

Colonel
109 Badges
Jun 22, 2003
849
96
Visit site
  • Crusader Kings II: Holy Knight (pre-order)
  • Semper Fi
  • Sword of the Stars
  • Teleglitch: Die More Edition
  • The Showdown Effect
  • Victoria 2
  • Victoria 2: A House Divided
  • Victoria 2: Heart of Darkness
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Warlock 2: The Exiled
  • 500k Club
  • Cities: Skylines
  • Rome Gold
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Pre-order
  • Magicka: Wizard Wars Founder Wizard
  • Mount & Blade: Warband
  • Crusader Kings II: Way of Life
  • Pillars of Eternity
  • Magicka 2
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Cities: Skylines - After Dark
  • Europa Universalis IV: Cossacks
  • Hearts of Iron IV: No Step Back
  • Europa Universalis IV: Art of War
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Divine Wind
  • Europa Universalis IV
  • Crusader Kings II
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • For the Motherland
  • Gettysburg
  • Hearts of Iron III
  • Hearts of Iron III: Their Finest Hour
  • Heir to the Throne
  • Knights of Pen and Paper +1 Edition
  • The Kings Crusade
  • Magicka
Could it be so, that the images on .tbl files are with a standard compression?

Too bad that there are many image file standards.
 

Inferis

TBL File Hacker
21 Badges
Jul 2, 2001
1.574
0
www.inferis.org
  • Stellaris
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Prison Architect
  • Cities: Skylines Industries
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Stellaris: Apocalypse
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Mass Transit
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II
  • Cities: Skylines - Snowfall
  • Cities: Skylines - After Dark
  • Europa Universalis III: Collection
  • Cities: Skylines
  • 500k Club
  • Victoria 2
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis III
Okay folks, time for a question. How would you take a go at editing the map? What set of tools would you develop (supposing you have the ability) to do it?

Keep in mind that:
  • The total mapsize is 18944x7296. This results in an image that 395,4 MB big. An editor should be usable also for folks who cannot afford gigabytes of memory (which isn't much of a problem for Paradox, I guess).
  • Several files define how stuff works: the lightmap files contain the image, but there's also the id grid, the TI, the province list, boundboxes, ... All these have to be updated a the same time
 

Hive

Lex Superior
19 Badges
Oct 16, 2002
12.250
15
  • Heir to the Throne
  • Europa Universalis IV: Pre-order
  • 500k Club
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Europa Universalis IV: Res Publica
  • Europa Universalis III Complete
  • March of the Eagles
  • Europa Universalis III Complete
  • Hearts of Iron Anthology
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III
  • Crusader Kings II
Can you perhaps make an editor load only 1 part of the map - say 1 continent - at a time? Otherwise, it's a damn big map to load every time you want to do some minor tweak...
 

Nikolai II

A bunny with a hat
130 Badges
Nov 18, 2001
9.389
415
www.giantitp.com
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: By Blood Alone
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Age of Wonders II
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron II: Beta
  • 200k Club
  • 500k Club
  • Europa Universalis IV: Call to arms event
  • BATTLETECH - Backer
  • War of the Roses
  • Lead and Gold
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Magicka
  • Heir to the Throne
  • Europa Universalis 4: Emperor
  • Crusader Kings II: Holy Fury
  • Rome: Vae Victis
  • Divine Wind
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Crusader Kings II: Horse Lords
Hive said:
Can you perhaps make an editor load only 1 part of the map - say 1 continent - at a time? Otherwise, it's a damn big map to load every time you want to do some minor tweak...

Was my first thought as well, but I guess it has to be saved every time? And if full file is close to 400Mb dividing by 5 will still be 80 Mb?

Maybe divide ot into 10-20 (assuming all other files needing modification are small?) and then make some sort of 'compiler' for the map?
 

Hive

Lex Superior
19 Badges
Oct 16, 2002
12.250
15
  • Heir to the Throne
  • Europa Universalis IV: Pre-order
  • 500k Club
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Europa Universalis IV: Res Publica
  • Europa Universalis III Complete
  • March of the Eagles
  • Europa Universalis III Complete
  • Hearts of Iron Anthology
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III
  • Crusader Kings II
Nikolai II said:
Was my first thought as well, but I guess it has to be saved every time? And if full file is close to 400Mb dividing by 5 will still be 80 Mb?

Maybe divide ot into 10-20 (assuming all other files needing modification are small?) and then make some sort of 'compiler' for the map?

Good idea... extract the main map into 10-20 small chumps, which can be edited alone.... and then, when you want to use the map - you compile them together.
 

eon 2

Nonconformist
2 Badges
Jun 3, 2003
189
0
  • Europa Universalis III
  • 500k Club
Inferis said:
Keep in mind that:
  • The total mapsize is 18944x7296. This results in an image that 395,4 MB big. An editor should be usable also for folks who cannot afford gigabytes of memory (which isn't much of a problem for Paradox, I guess).

If the technical solution to that problem is working with only a smaller a part of the map at a time, I would recommend dividing the map in several overlapping parts (overlapping so You could choose a conveniant view to work form according to Your needs). E g part1 :North America, part2: souther part of NA and northern part of South America and part 3: SA. Etc.


Inferis said:
  • Several files define how stuff works: the lightmap files contain the image, but there's also the id grid, the TI, the province list, boundboxes, ... All these have to be updated a the same time

Ideally You should (?) have a choice to either work with the map whithout considering the provinces (province borders) or in a "province mode" where the current "province data" is always present (editable, maybe in a floating box) when You are editing the map.


BTW, have You rellay deduct the format of the TBL files ? Fantastic !!

:) :eek: :) :eek: :) :eek: :)
 

Nikolai II

A bunny with a hat
130 Badges
Nov 18, 2001
9.389
415
www.giantitp.com
  • Hearts of Iron IV: No Step Back
  • Hearts of Iron IV: By Blood Alone
  • Stellaris: Nemesis
  • Stellaris: Necroids
  • Age of Wonders II
  • Stellaris: Galaxy Edition
  • Stellaris: Galaxy Edition
  • Hearts of Iron II: Beta
  • 200k Club
  • 500k Club
  • Europa Universalis IV: Call to arms event
  • BATTLETECH - Backer
  • War of the Roses
  • Lead and Gold
  • Victoria: Revolutions
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Magicka
  • Heir to the Throne
  • Europa Universalis 4: Emperor
  • Crusader Kings II: Holy Fury
  • Rome: Vae Victis
  • Divine Wind
  • Europa Universalis III
  • Europa Universalis III: Chronicles
  • Crusader Kings II: Horse Lords
eon said:
If the technical solution to that problem is working with only a smaller a part of the map at a time, I would recommend dividing the map in several overlapping parts (overlapping so You could choose a conveniant view to work form according to Your needs). E g part1 :North America, part2: souther part of NA and northern part of South America and part 3: SA. Etc.

Or if a 'compiler' is possible, then maybe also a 'cutter' to take the map to pieces, allowing for at least two different modes of cutting (that places borders differently?)

Or cut up into 20-30-40 pieces and allow 'editor' to be able to load two adjacent pieces at once if needed?
 

Inferis

TBL File Hacker
21 Badges
Jul 2, 2001
1.574
0
www.inferis.org
  • Stellaris
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Prison Architect
  • Cities: Skylines Industries
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Stellaris: Apocalypse
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Mass Transit
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II
  • Cities: Skylines - Snowfall
  • Cities: Skylines - After Dark
  • Europa Universalis III: Collection
  • Cities: Skylines
  • 500k Club
  • Victoria 2
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis III
A compiler would most probably be the way to go. I've been thinking about that for a while now.

Basically, the system I have in mind contains:
* a decompiler, to transform the current EU2 files into a format of our own we can use to edit (maybe just one (very) large file, but easier to maintain).
* an editor to edit the map
* a compiler to transform our own format into EU2 readable files.

This would allow you to have multiple working copies of a map (given enough diskspace, but that's not so much of an issue as memory is), compiling them as needed so they can be used to play.

The editor would be used to edit stuff like sprite placement, actual pixel ownership (the stuff stored in id.tbl), province names, ... The image (or part of it) would be exported to a TIFF or so, which can be edited in a graphical editor (eg photoshop). No need in duplicating functionality. ;)

Any thoughts?
 

ForzaA

Thalassic QA
Paradox Staff
QA
69 Badges
Apr 1, 2001
10.288
1.546
  • Rome Gold
  • Knights of Pen and Paper +1 Edition
  • Leviathan: Warships
  • The Kings Crusade
  • Lost Empire - Immortals
  • Magicka
  • Majesty 2
  • Majesty 2 Collection
  • March of the Eagles
  • Europa Universalis III Complete
  • Naval War: Arctic Circle
  • Victoria: Revolutions
  • Europa Universalis: Rome
  • King Arthur II
  • Semper Fi
  • Ship Simulator Extremes
  • Sword of the Stars
  • Sword of the Stars II
  • Supreme Ruler 2020
  • Starvoid
  • Teleglitch: Die More Edition
  • The Showdown Effect
  • Victoria 2
  • Rome: Vae Victis
  • Warlock: Master of the Arcane
  • Imperator: Rome Sign Up
  • Dungeonland
  • Arsenal of Democracy
  • Hearts of Iron II: Armageddon
  • Cities in Motion
  • Cities in Motion 2
  • Crusader Kings II
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Darkest Hour
  • Deus Vult
  • Diplomacy
  • A Game of Dwarves
  • East India Company Collection
  • Europa Universalis III
  • Divine Wind
  • Europa Universalis IV
  • Europa Universalis IV: Conquest of Paradise
  • For The Glory
  • For the Motherland
  • Hearts of Iron III
  • Heir to the Throne
  • Impire
probably a very stupid and impossible suggestion :)

There are a few "ID maps" floating around the forums, I don't think these, even when fitted together (I have separates for all continents) would put too much strain on any PC. now, if it was possible to select, in such a map, a certain region (by "cutting" ) that you want to edit, this region is then taken into the compiler/editor/... , the rest keeps unchanged.

that way, everyone could pick a size fitting to their current needs, and to hardware available.
 

Hive

Lex Superior
19 Badges
Oct 16, 2002
12.250
15
  • Heir to the Throne
  • Europa Universalis IV: Pre-order
  • 500k Club
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Europa Universalis IV: Res Publica
  • Europa Universalis III Complete
  • March of the Eagles
  • Europa Universalis III Complete
  • Hearts of Iron Anthology
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV
  • Divine Wind
  • Europa Universalis III Complete
  • Europa Universalis III
  • Crusader Kings II
ForzaA said:
probably a very stupid and impossible suggestion :)

There are a few "ID maps" floating around the forums, I don't think these, even when fitted together (I have separates for all continents) would put too much strain on any PC. now, if it was possible to select, in such a map, a certain region (by "cutting" ) that you want to edit, this region is then taken into the compiler/editor/... , the rest keeps unchanged.

that way, everyone could pick a size fitting to their current needs, and to hardware available.

This sounds awfully complicated though, imo...

Btw, Inferis - will you also included in your editor the possibility to determine where habour icons, capital icons, manufactory icons etc are placed in a province? Would be heaps helpful...

Of course, that would require you to also use province.csv - but that's an easy excel file anyway, would that be a problem?
 

Inferis

TBL File Hacker
21 Badges
Jul 2, 2001
1.574
0
www.inferis.org
  • Stellaris
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Prison Architect
  • Cities: Skylines Industries
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Stellaris: Apocalypse
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Mass Transit
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II
  • Cities: Skylines - Snowfall
  • Cities: Skylines - After Dark
  • Europa Universalis III: Collection
  • Cities: Skylines
  • 500k Club
  • Victoria 2
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis III
Hive said:
Btw, Inferis - will you also included in your editor the possibility to determine where habour icons, capital icons, manufactory icons etc are placed in a province? Would be heaps helpful...

Of course, that would require you to also use province.csv - but that's an easy excel file anyway, would that be a problem?
No, that's the plan. That info is by far the easiest to modify.
 

Coder

First Lieutenant
53 Badges
Oct 5, 2002
232
5
Visit site
  • Victoria 3 Sign Up
  • Europa Universalis 4: Emperor
  • Crusader Kings III
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV
  • 500k Club
  • Europa Universalis IV: Pre-order
  • Hearts of Iron II: Beta
  • Crusader Kings II: Way of Life
  • Europa Universalis IV: Common Sense
  • Crusader Kings II: Horse Lords
  • Europa Universalis IV: Cossacks
  • Crusader Kings II: Conclave
  • Europa Universalis IV: Mare Nostrum
  • Hearts of Iron IV: Cadet
  • Crusader Kings II: Reapers Due
  • Europa Universalis IV: Rights of Man
  • Hearts of Iron IV: Together for Victory
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
  • Hearts of Iron IV: Death or Dishonor
  • Europa Universalis IV: Cradle of Civilization
  • Crusader Kings II: Jade Dragon
  • Hearts of Iron IV: Expansion Pass
  • Europa Universalis IV: Rule Britannia
  • Europa Universalis IV: Dharma
  • Crusader Kings II: Holy Fury
  • Europa Universalis IV: Golden Century
  • Imperator: Rome
  • Europa Universalis III Complete
  • Crusader Kings II
  • Crusader Kings II: Charlemagne
  • Crusader Kings II: Legacy of Rome
  • Crusader Kings II: The Old Gods
  • Crusader Kings II: Rajas of India
  • Crusader Kings II: The Republic
  • Crusader Kings II: Sons of Abraham
  • Crusader Kings II: Sunset Invasion
  • Crusader Kings II: Sword of Islam
  • Europa Universalis III
  • Divine Wind
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • For The Glory
  • Hearts of Iron III
  • Heir to the Throne
  • Europa Universalis IV: Res Publica
if we can decompile/convert a region of a tbl file into a large lightmap picture (a simple grayscale bitmap) and another "bitmap" with a province id for each pixel (and propably something for that TI boundaries file)then that grayscale bitmap is editable in any raster image editing progam
then we need to program a province ownership (and TI boundaries) editor which should be quite straightforward hopefully
before compilation we use colorscales.csv to pack that grayscale image back to 6bit "colors" and the compression should be quite straightforward (that is, if i haven't missed something important :D)
for each block we construct the province id list first and check if all pixels have the same color and same owner(province) in that block to build that quadtree

in short this is the same thing you already posted (with a few additions maybe)
the main problems from my point of view:
  • can we modify only part of the map at a time? (i studied your documentation a few months ago but i don't remember the format of all other files and the format of incgrid.tbl is still somewhat unclear?)
    maybe it would be possible to decompile and edit a part of the map and when compiling it we alter some indexes only in other parts
  • i didn't quite understand those river id quirks in lightmap.tbl
  • everything has to be done using raster graphics
  • i missed something crucially important :D
 

Inferis

TBL File Hacker
21 Badges
Jul 2, 2001
1.574
0
www.inferis.org
  • Stellaris
  • Crusader Kings III: Royal Edition
  • Crusader Kings III
  • Prison Architect
  • Cities: Skylines Industries
  • Cities: Skylines - Parklife
  • Cities: Skylines - Parklife Pre-Order
  • Stellaris: Apocalypse
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Mass Transit
  • Stellaris - Path to Destruction bundle
  • Crusader Kings II
  • Cities: Skylines - Snowfall
  • Cities: Skylines - After Dark
  • Europa Universalis III: Collection
  • Cities: Skylines
  • 500k Club
  • Victoria 2
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis III
Ah, somebody how knows what I'm dealing with. :)

Editing parts of the map should be feasible, but compiling should always happen for the whole map. There's too many files to modify, and it's going to be easier to do the full map at a time.

Editing the image should be done with an image editing program, indeed. We'll just have an import and export function to the EU2 map format.

Province ownership is not important in the image data when using our own temporary format. We do need to create it when compiling the EU2 map data, fcourse.

Basically, my plan is to create an editor that uses it's own file format that encapsulates all map data into one (big) file. You'd be able to import the current map from EU2 based files, and export it back to those file. But I'll be focusing on creating new maps first.

The big problem is that a lot of this stuff is interconnected, and that makes it hard to create a good object model.

And about the river id things: I don't quite get it myself. I know how it works because of the code Johan provided me, but I don't see the direct use in it, to be fair. Maybe Johan can enlighten us. ;) I guess it has primarily something to do with border drawing.