Map Format

Everything about mods can be found here.

Moderator: Morax

Map Format

Postby nine2 » 04 Mar 2014, 13:02

Hi,

I was wondering if anyone understands the contents of *.scmap files.

I know HazardX had some source code and I have that working.

I was wondering if anyone knows the differences between map versions 53, 54, 56 and 60.

90% of the maps I see are 53 or 56. The only time I have seen 54 and 60 are the ones that come with FA.

v53 - contour map works
v56 - no contour map working - but you get extra texture levels

Hazards code only works up until v56 ... does anyone have any idea how to unravel all the binary of v60 to work out what it means? Thats a bit too much for me.

Or does anyone if there is lua somewhere that reads the map files? I could reverse engineer that.

Thanks,
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Map Format

Postby Duck_42 » 05 Mar 2014, 05:02

v56 - no contour map working - but you get extra texture levels

When you say extra texture levels, what do you mean?

Or does anyone if there is lua somewhere that reads the map files? I could reverse engineer that.

There isn't. The LUA code reads the other map files (scenario, script, save), but the code that loads the scmap format is internal to FA.

does anyone have any idea how to unravel all the binary of v60

Many hours of tedious analysis? :-(


I would definitely be interested in seeing some sort of documentation of the scmap format. It might be worth asking HazardX how he came up with what he did. Maybe he got some additional information from someone at GPG way back when...Although, it is also possible though that he simply spent many tedious hours analyzing the file format.
User avatar
Duck_42
Avatar-of-War
 
Posts: 237
Joined: 29 May 2012, 03:16
Has liked: 5 times
Been liked: 18 times
FAF User Name: Duck_42

Re: Map Format

Postby nine2 » 05 Mar 2014, 11:00

Firstly, thanks for your answers.
Secondly, I don't really know what I'm talking about ... this is just what I think from hours of tedious analysis, but here goes:

When you say extra texture levels, what do you mean?


In v56 you get 10 stratum layers but pre-v53 you get 8

See Map.vb:282 from HazardX's code.

Don't know if you know, but textureMapData is an image ... you divide each pixel into its ARGB channels ...
the A channel is used to represent how much (0 = 0%, 255=100%) alpha the texture from stratum1 should be drawn on that coordinate.
the R channel = how much alpha from stratum2
the G channel = stratum3
the B channel = stratum4

Then, there is a whole new image - TextureMapData2 ... which is also divided into ARGB channels where ARGB map to stratums 5-8

In pre-v56, the second image (TextureMapData2) isn't loaded at all.

You can also see on map:224 where additional layers are loaded from v56 maps - which are the stratum themselves.

In v56, It seems as though to me that there are 10 stratums but only 8 have texture maps. I understand this for Lower stratum, because its the bottom layer its always at 100%. But whats going on with 'Upper' stratum? Haven't looked into this.

Anyway it would be interesting to know how many of our maps actually use new features from v56 ... because if they don't we could just downgrade them all to v53 to get contour maps back. I've downgraded a few maps already (you just have to change the minorVersion) and they work fine but perhaps there is some subtle difference that I am missing.

The LUA code reads the other map files (scenario, script, save), but the code that loads the scmap format is internal to FA.


Thanks for this. Is there somewhere in LUA where it gets an object reference to the map? If so just looking at that class definition would surely help...
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Map Format

Postby Dragonfire » 05 Mar 2014, 11:45

My native language is not english, please correct me, because I want to improve my skills # Resource Overview
User avatar
Dragonfire
Evaluator
 
Posts: 559
Joined: 19 Dec 2013, 10:18
Has liked: 39 times
Been liked: 61 times
FAF User Name: Dragonfire

Re: Map Format

Postby Duck_42 » 08 Mar 2014, 08:50

n v56 you get 10 stratum layers but pre-v53 you get 8

See Map.vb:282 from HazardX's code.

Don't know if you know, but textureMapData is an image ... you divide each pixel into its ARGB channels ...
the A channel is used to represent how much (0 = 0%, 255=100%) alpha the texture from stratum1 should be drawn on that coordinate.
the R channel = how much alpha from stratum2
the G channel = stratum3
the B channel = stratum4


All the data is there, yes. The main reason I asked is because I've never seen a map that actually uses the upper four stratum. If you try to paint on them in the official map editor it doesn't do anything. I've tried loading data into the 2nd texture map (bypassing the map editor completely), and that also doesn't do anything. I would be very interested in being able to use those additional stratum if anyone knows how to do it. :)

whats going on with 'Upper' stratum?

It's a macro texture that functions in a similar fashion to the normal maps. The easiest way to see what I mean is to open a map in the map editor, zoom out, and then move the albedo slider on the upper stratum.
User avatar
Duck_42
Avatar-of-War
 
Posts: 237
Joined: 29 May 2012, 03:16
Has liked: 5 times
Been liked: 18 times
FAF User Name: Duck_42

Re: Map Format

Postby Krapougnak » 08 Mar 2014, 10:39

I'm not sure if understood correctly all that was going on in this thread but I'll give you this little piece of information from old GPGNet forum, to enable all 9 strata different terrain shaders have to be used. Go into "Lighting" layer => Open "Lighting properties" and in "Terrain shader" select TTerrainXP instead of TTerrain. But beware this changes the way the map looks ... or i should probably say it may change the way it looks ... all depends on the other lighting settings you have there. TTerrain is overal more "glossy", experiment with it a bit ...

I don't know if this was useful, if you already knew it or if even it was what you were asking anyway I hope this bit of information is useful to someone ;)
User avatar
Krapougnak
Contributor
 
Posts: 340
Joined: 12 Jul 2012, 11:03
Has liked: 193 times
Been liked: 24 times
FAF User Name: Krapougnak

Re: Map Format

Postby Lionhardt » 08 Mar 2014, 17:44

!! :shock: :idea: :lol: Awesome! Did not know that! Thanks man! Finally all the strata!
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns

YouTube Channel
User avatar
Lionhardt
Contributor
 
Posts: 1070
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt

Re: Map Format

Postby Krapougnak » 09 Mar 2014, 09:54

Cool, it finally pays to be an old timer and hoarder of SCFA stuff since 2008 ! :P

Please keep us posted on the drawbacks, if any, of this solution.

I promise to pass the information to someone else in 10 years time. ;)
User avatar
Krapougnak
Contributor
 
Posts: 340
Joined: 12 Jul 2012, 11:03
Has liked: 193 times
Been liked: 24 times
FAF User Name: Krapougnak

Re: Map Format

Postby nine2 » 09 Mar 2014, 10:47

What else do you know about maps?
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Map Format

Postby Lionhardt » 09 Mar 2014, 12:53

Do you know by any chance what the terrain type layer is good for? The map editor wiki does not explain this.
Help me make better maps for all of us, visit my Mapping Thread.

Maps needing gameplay feedback:
Spoiler: show
[list updated last: 31.1.2018]

(maps available in the vault)

- Hexagonian Drylands
- Fervent Soil and Torrid Suns

YouTube Channel
User avatar
Lionhardt
Contributor
 
Posts: 1070
Joined: 29 Jan 2013, 23:44
Has liked: 188 times
Been liked: 144 times
FAF User Name: Lionhardt

Next

Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest