Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4]

Author Topic: Mod Tool Merger  (Read 7690 times)

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: Mod Tool Merger
« Reply #45 on: August 15, 2014, 08:13:28 pm »

It seems that there is a lot of interest in a DF-centric diff format lately...

Not from me!  I'm determined to take ordinary raws and combine them with nothing fancier than a standard diff.  My goal is more about ease of use than advanced merging, on both the user and content creator end. 
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Mod Tool Merger
« Reply #46 on: August 15, 2014, 10:15:18 pm »

I could play around with tag-wise diffs some when I get home, maybe I can come up with a nice algorithm and plain text representation :)

Maybe I can come up with something that gives you some nice ideas, I guess we'll see.

It seems that there is a lot of interest in a DF-centric diff format lately...

that is my goal as it was the biggest issue I had with deriving manual merges and is why I started this thread.  However, it is my own little brain excercise.  I think a token based patch file would help merge mods better than standard diffs due to conflicts in lines.

PeridexisErrant

  • Bay Watcher
  • Dai stihó, Hrasht.
    • View Profile
Re: Mod Tool Merger
« Reply #47 on: August 15, 2014, 10:30:53 pm »

If it's conflicts within lines, one idea that came up in another thread was to call a flatten function to put each tag or token on it's own line, then run a standard diff.  Basically just replace '][' with ']\n['.  How much would that help?
Logged
I maintain the DF Starter Pack - over a million downloads and still counting!
 Donations here.

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Mod Tool Merger
« Reply #48 on: August 15, 2014, 10:47:09 pm »

that's a pretty great idea.

Broken token's wouldn't be too obvious though.

I would think a newline should be around every [ and ].

That way broken tokens would stand out?  Probably not worried about broken tokens?  Well idk if it would have an affect.

I say broken because I've seen mods that comment out a bracket of a token to null it out from being loaded.

Unless you autoprune all broken tokens/comments beforehand...

Update:

That is a great idea.  However, that's not the route I'm taking atm.  I was honestly thinking of a way to do what you just described using a batch file however.  I'm wondering if a batch file can use a regular expression to perform such a feat.
« Last Edit: August 15, 2014, 10:51:55 pm by thistleknot »
Logged

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Mod Tool Merger
« Reply #49 on: August 16, 2014, 03:32:03 pm »

Flattening the file (with or without indents for readability) only really helps collisions if you are going to position diffs based on tags (literal, parameterized, regular expression, etc.) rather than lines.  The reason is that mod A might add or delete lines, which would make mod B place its changes in the wrong place.

The specific use-case I keep coming back to is two different mods that create custom workshops and reactions... both need to insert stuff into entity_default.txt.  A more complicated case is ensuring that a tag lands inside the correct caste after someone has inserted half a dozen PREFSTRINGs, and that is also handled by using tags as location hints.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Mod Tool Merger
« Reply #50 on: August 16, 2014, 04:24:42 pm »

Flattening the file (with or without indents for readability) only really helps collisions if you are going to position diffs based on tags (literal, parameterized, regular expression, etc.) rather than lines.  The reason is that mod A might add or delete lines, which would make mod B place its changes in the wrong place.

The specific use-case I keep coming back to is two different mods that create custom workshops and reactions... both need to insert stuff into entity_default.txt.  A more complicated case is ensuring that a tag lands inside the correct caste after someone has inserted half a dozen PREFSTRINGs, and that is also handled by using tags as location hints.

I'll answer this one first:

Quote
A more complicated case is ensuring that a tag lands inside the correct caste after someone has inserted half a dozen PREFSTRINGs, and that is also handled by using tags as location hints.

I think a back-updated object verification [based on reading a patch file] could resolve this.  Read, the file tag.  Identify the object...  Then... idk.  Try to keep track of old data object and new data object being edited.

second issue

Quote
is two different mods that create custom workshops and reactions... both need to insert stuff into entity_default.txt

I think that can be resolved by back measuring differences inbetween objects.  Take before and after state, and compare the object based on the files being edited.

Is it new?  If so, create a new object.
« Last Edit: August 16, 2014, 04:32:32 pm by thistleknot »
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Mod Tool Merger
« Reply #51 on: August 22, 2014, 01:06:31 pm »

I got so busy with Prison Architect and the Rubble encoder that I didn't get anything done with tag-wise diffs, but that's next on my todo list :)

For now a few thoughts:
Any such system need to keep objects in mind, this should be easy once a list of all object types is compiled (I know I have one somewhere...)
Line numbers are of no consequence, tag order matters much more.
Modders should spend much less time tacking new stuff to existing files and just add a new file :p

Maybe it would be better to make a programmable raw parser with an easy to use command system that allows you to add tags to an object with one line, oh wait:{SHARED_OBJECT_ADD;TEMPLATE_WOOD;[REACTION_CLASS:WOOD_MAT]}.
Too bad that Rubble template requires a special set of raws to work, maybe with a good parser/diff system I can relax that requirement :)

The more I think about it the less useful a traditional diff system looks, there is just too many problems associated with merging many mods without requiring user interaction, traditional diffs are just to fragile. Maybe I can come up with something useful and generic, I guess there is no way to know without trying :)
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Mod Tool Merger
« Reply #52 on: August 22, 2014, 01:28:58 pm »

Modders should spend much less time tacking new stuff to existing files and just add a new file :p
I agree, but the whole point of some mods is to change the vanilla stuff in some way (hard farming, etc.) and all reactions/buildings need to get mentioned in entity_default.  So, no amount of etiquette will completely remove the need to merge stuff.
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Mod Tool Merger
« Reply #53 on: August 27, 2014, 02:47:49 pm »

OK, I give up, no matter what I come up with it fails in one edge case or another. Diffs are simply too fragile to work without needing user intervention. I guess I will stick with custom scripts, they always work, even if they can't be created automatically (and I already have a small library of programmable scripts for common tasks).

I did end up deciding that a tag level diff is much less useful than it sounds, what worked best was an object level diff that used a standard text diff for the object body and a custom system for selecting the object and modifying whole objects (removing, adding, ect), but even that had problems...
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

thistleknot

  • Bay Watcher
  • Escaped Normalized Spreadsheet Berserker
    • View Profile
Re: Mod Tool Merger
« Reply #54 on: August 27, 2014, 05:57:17 pm »

I'm slowly but surely making progress but its really a hobby.

I figured I would have issues w diff in general and may not even go w a diff approach in the end due to similar tokens but not quite the same that work as replacements, such as when a helm is changed from rare to common.  I need to identify using the subtokens? Idk what to call them. But make no mistake. I'm a newb. This is really just a tutorial for me to relearn parsing and hopefully be able to build something that can compare objects.

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Mod Tool Merger
« Reply #55 on: August 27, 2014, 06:03:30 pm »

Well, good luck :) Any workable solution (that handles all the edge cases) will be a tremendous amount of work.

A tool that is designed for modders to use when merging would be much easier, but anything meant for use by the average idiot will be far too hard due to not being able to count on the user to make intelligent decisions when merging conflicts and the like.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS
Pages: 1 2 3 [4]