Understanding merging

Post here if you want to help developing something for FAF.

Understanding merging

Postby burnstreet » 08 Feb 2014, 13:45

I am trying to understand exactly how merging behaves in FA

So far I my understanding is:

  • you need to set
    • Merge = true
    • BlueprintId="original unit"
  • only the specified values will be overridden
  • if you specify nil for simple data types or {} for complex ones, nothing will be overridden
  • it is impossible to delete properties, you can only override the values
  • in the easiest cast (just FA Forever + 1 mod) the mod bps will be merged against the bps in %ProgramData%\FAForever\faforever.nxt
  • Featured mods are independent, so e.g. BlackOps does not use FAF balance but standard balance for units not modified in the mod
  • BPs are read alphabetically breadth-first inside a mod / zip file, directories are sorted with files
  • it does not matter wether the bp is in /units/ or /hook/units or /merge for merging to work

Now, my questions:
  • is anything I wrote above incorrect or inprecise?
  • in which order are mods processed by the game
    • I have 4 mods: 1 Featured "F" (e.g. Diamond), 3 normal "A","B", "C" (e.g. Total Mayhem, ASF Balance, 4DC)
    • all 4 mods apply changes to 1 standard FA unit
    • mods A and C use merging for that unit
    • what would be the resulting unit? (like B + C?)
burnstreet
Crusader
 
Posts: 36
Joined: 23 Mar 2013, 00:36
Has liked: 2 times
Been liked: 3 times
FAF User Name: Burnstreet

Re: Understanding merging

Postby Domino » 08 Feb 2014, 17:35

the resulting bp would be original + A + C dependant on mod load order.

the way they are read is aplabeticly from disk folder wise BUT the mods are loaded via the uid in the mod_info file.

tables are merged, in that you can spec a nil value, you can spec any value and add values, obviously for tables inside tables,
you have to replicate exactly the structure of the table to the original to change/remove values.

remember if mod A changes a value in a bp but then mod C changes the value also and mod C is loaded after mod A then mod C value will be used else mod A's values will be used, because it loaded after C

its basicly load order + alphabeticly read from folder structured / file name.
you can look in blueprints.lua in the system folder to see the merge function.
Domino
Priest
 
Posts: 315
Joined: 14 Mar 2012, 21:07
Has liked: 3 times
Been liked: 75 times

Re: Understanding merging

Postby burnstreet » 11 Feb 2014, 17:28

Thank you.

I have already used that knowledge, partly at least:http://unitdb.burnstreet.bplaced.net/ (big page, ~12MB due to not having dynamic data loading yet) [edit]hoster killed my account :/[/edit]

I currently only merge against faf blueprints, but I plan to to it against whatever is selected as featured mod. I don't know if it makes sense to simulate merging with multiple mods activated. Of the 2k+ units currently in the DB, only ~10 have merge=true. May be that I am missing some, though.

Disclaimer: above page is in pre-alpha state. Don't believe any values you see there or complain if it fries you browser. :)
burnstreet
Crusader
 
Posts: 36
Joined: 23 Mar 2013, 00:36
Has liked: 2 times
Been liked: 3 times
FAF User Name: Burnstreet


Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest