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

DSYoungEsq

King of Trying Out Stuff
55 Badges
Jul 2, 2004
3.963
56
  • Stellaris: Apocalypse
  • Stellaris: Galaxy Edition
  • Hearts of Iron IV: Cadet
  • Europa Universalis IV: Rights of Man
  • Stellaris: Digital Anniversary Edition
  • Stellaris: Leviathans Story Pack
  • Stellaris - Path to Destruction bundle
  • Europa Universalis IV: Mandate of Heaven
  • Europa Universalis IV: Third Rome
  • Surviving Mars
  • Stellaris: Synthetic Dawn
  • Europa Universalis IV: Cradle of Civilization
  • Stellaris: Humanoids Species Pack
  • Stellaris: Galaxy Edition
  • PDXCON 2018 "The Emperor"
  • Europa Universalis IV: Rule Britannia
  • Surviving Mars: Digital Deluxe Edition
  • Cities: Skylines - Parklife
  • Stellaris: Distant Stars
  • Europa Universalis IV: Dharma
  • Surviving Mars: First Colony Edition
  • Stellaris: Megacorp
  • Europa Universalis IV: Golden Century
  • Surviving Mars: First Colony Edition
  • Stellaris: Ancient Relics
  • Stellaris: Nemesis
  • Victoria: Revolutions
  • Europa Universalis III
  • Europa Universalis III Complete
  • Europa Universalis IV
  • Europa Universalis IV: Art of War
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Call to arms event
  • For The Glory
  • Hearts of Iron III
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Europa Universalis IV: Res Publica
  • Crusader Kings II
  • Europa Universalis: Rome
  • Rome Gold
  • Victoria 2
  • Rome: Vae Victis
  • 500k Club
  • Cities: Skylines
  • Europa Universalis IV: El Dorado
  • Europa Universalis IV: Common Sense
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Mare Nostrum

WiSK

Major
11 Badges
Apr 30, 2002
603
1
  • Cities in Motion
  • Europa Universalis III: Chronicles
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
IncGrid.tbl has an extra line of data. What's that about?

Another kind of smoothing trick? :confused:
 

WiSK

Major
11 Badges
Apr 30, 2002
603
1
  • Cities in Motion
  • Europa Universalis III: Chronicles
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
WiSK said:
IncGrid.tbl has an extra line of data. What's that about?

Another kind of smoothing trick? :confused:
Okay, my guess is that the extra line of data indeed indicates a mechanism to facilitate (P)TI smoothing. My guess is that each row/line of blocks in incgrid.tbl affects the lightmap blocks both above and below it. If this is true, then it is also likely that incgrid blocks affect both left and right lightmap blocks.

So a rough guess at the algorithm. In any given lightmap block, we make a mask for each province. We check the four neighbouring incgrid blocks { (x, y), (x, y+1), (x+1, y), (x+1, y+1) } for a reference to that province, then we can determine the level of 'PTI fog' from four directions (Inferis calls this the 'anti-alias' value). Then we draw a smoothing block in a similar way to the lightmap smoothing using the four fog values, then we use the mask to cut this to the shape of the province within the lightmap block.

Am I on the right track? It's probably more complicated that this, looking at the screen in EU2...
 

WiSK

Major
11 Badges
Apr 30, 2002
603
1
  • Cities in Motion
  • Europa Universalis III: Chronicles
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
tombom said:
Didn't Inferis say IncGrid contained EU1 information?
No, that's incognita.tbl.

I have just tried my algorithm and it gives a reasonable result when overlayed on the id.tbl map. I'll post a screenie later.

EDIT: On second thoughts, it's not such a great result. I'm starting to doubt that I'm going about this the right way.
 
Last edited:

WiSK

Major
11 Badges
Apr 30, 2002
603
1
  • Cities in Motion
  • Europa Universalis III: Chronicles
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
Inferis said:
I'd just like to say: what would one do without a code profiler? :D
Count the clock cycles yourself? :p

EDIT: any comment about my incgrid musings...?
 
Last edited:

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
WiSK said:
any comment about my incgrid musings...?
Not really. I'm not sure about this format myself. I know that the 4 lower values are ids (as specified in on my TBL pages), and the 4 other are weights. They define how foggy that part has to be drawn. I'm still looking at how the actual drawing is done...
 

WiSK

Major
11 Badges
Apr 30, 2002
603
1
  • Cities in Motion
  • Europa Universalis III: Chronicles
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
Inferis said:
They define how foggy that part has to be drawn.
Well, per block there are a few cases to consider:
A) nation knows all the provinces -> no fog
B) nation doesn't know any of the provinces -> maximum fog (?)
C) nation knows some provinces -> gradated fog, depending on neighbouring blocks.

Case C is the interesting one of course. Does the engine look at the same pattern of blocks as with the lightmaps (to the right, below and below-right)? Or does it look in all eight directions? From looking at the data, I would guess the former, but looking at the map, I hesitate.

Something that made me discard my first theory (seven posts earlier) is that the fog overlaps province boundaries.
 

WiSK

Major
11 Badges
Apr 30, 2002
603
1
  • Cities in Motion
  • Europa Universalis III: Chronicles
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
Inferis said:
Hint: adjacent.tbl
You sure? How does that help me exactly? Along the border blocks, incgrid contains references to the neighbouring provinces, so I already kinda know the adjacencies which are relevant to that block.

Something I noticed around the Bering Straits/Aleutian Sea is that even though incgrid has not-max-fog values throughout the province, the game still renders that area as max fog. This could be down to the colorscale used (ie any fog value lower than 10 is effectively max fog) or it could just be that I was correct about case B: if the player/nation knows none of the provinces, then max fog is applied.
 

doktarr

Wet Blanket
16 Badges
Aug 3, 2003
2.071
34
Visit site
  • 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
  • Crusader Kings II: Way of Life
  • Crusader Kings II: Horse Lords
  • Crusader Kings II: Conclave
  • Crusader Kings II: Reapers Due
  • Crusader Kings II: Monks and Mystics
  • Crusader Kings II: Jade Dragon
  • Crusader Kings II: Holy Fury
Hive said:
Nope, it doesn't work like a strait or anything. They can still move their troops around as usual.
Although, to be realistic, this would work like a backwards strait: that is, an army in Egypt or Sinai should be able to block naval passage. Not that there's any way to code that, unfortunately.

Note that this is not horrifically ahistorical during some time periods. There was a Suez canal in classical times, although it went from the red sea to the Nile Delta. It fell into disrepair and was unnavigable by the 700s.
 

TheLoneTaco

Soft Taco
29 Badges
Nov 7, 2002
1.717
2
Visit site
  • Rome Gold
  • Europa Universalis 4: Emperor
  • Europa Universalis IV: Golden Century
  • Europa Universalis IV: Dharma
  • Europa Universalis IV: Third Rome
  • Europa Universalis IV: Mare Nostrum
  • Europa Universalis IV: Cossacks
  • Europa Universalis IV: Common Sense
  • Mount & Blade: Warband
  • Europa Universalis IV: El Dorado
  • 500k Club
  • 200k Club
  • Victoria 2: Heart of Darkness
  • Victoria 2: A House Divided
  • Victoria 2
  • Crusader Kings II
  • Victoria: Revolutions
  • Europa Universalis IV: Res Publica
  • Europa Universalis III Complete
  • Europa Universalis III Complete
  • Heir to the Throne
  • Europa Universalis IV: Call to arms event
  • Europa Universalis IV: Wealth of Nations
  • Europa Universalis IV: Conquest of Paradise
  • Europa Universalis IV: Art of War
  • Europa Universalis IV
  • Divine Wind
  • Europa Universalis III Complete
  • Deus Vult
kinda off topic, but wouldn't that only have been able to service galleys? shallow galleys? nothing nearly so formidable as the ships of the mid to late eu2 time period, i'd imagine.

-Matt
 

Nikolai II

A bunny with a hat
130 Badges
Nov 18, 2001
9.389
411
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
TheLoneTaco said:
kinda off topic, but wouldn't that only have been able to service galleys? shallow galleys? nothing nearly so formidable as the ships of the mid to late eu2 time period, i'd imagine.

-Matt

It is actually uncertain if the canal was completed in 600 BC, but when Dareios reopened/completed it in 500 BC the canal was large enough to fit two large galleys side by side, galleys large enough to sail on to Persia..
 

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
Small update

Working on a tool to export province "images" to a png, which you can edit, and to import it back into the map.
I'm implementing the importing procedures, but it's a pain in the ass.

Main purpose: this will allow you hillbillies to edit the names on the provinces. Won't be possible to change province shapes.
 

WiSK

Major
11 Badges
Apr 30, 2002
603
1
  • Cities in Motion
  • Europa Universalis III: Chronicles
  • 500k Club
  • Cities: Skylines
  • Cities: Skylines - After Dark
  • Cities: Skylines - Snowfall
  • Cities: Skylines - Mass Transit
  • Cities: Skylines - Green Cities
  • Cities: Skylines - Parklife
  • Cities: Skylines Industries
  • Cities: Skylines - Campus
Inferis said:
Working on a tool to export province "images" to a png, which you can edit, and to import it back into the map.
I'm implementing the importing procedures, but it's a pain in the ass.

Main purpose: this will allow you hillbillies to edit the names on the provinces. Won't be possible to change province shapes.
Nice one. You are teh roxxorz :D

I am still a bit stumped on rendering incgrid. With the TI there is just the problem that the raw data alone seems inconsistent with what's shown on the screen. With the sea provinces and some PTI areas the fog seems to roll out over the province borders, while some smaller inland provinces are almost entirely visible under the fog. I am thinking that EU2 must use some other data (like terrain type for instance) to decide how strongly to fog a province. I just can't put my finger on it.

With the lightmap encoding I see an obvious solution for lossless compression, but it will be really slow. Like unbearably slow. I haven't tried to code it yet, but it's been floating around in my head (which has a built-in predictive profiler ;) ).