Difference between revisions of "Version control"

6,346 bytes added ,  13:15, 21 April 2021
imported>Thingy Person
imported>Thingy Person
 
(22 intermediate revisions by the same user not shown)
Line 69: Line 69:


====Masters====
====Masters====
When using Version Control, you can only have a maximum of 3 .esm files at once. During development, Bethesda's 3 .esm files were Skyrim.esm, Update.esm, and either Dragonborn.esm or Dawnguard.esm. This is likely a measure to promote stability as when the Creation Kit runs out of usable memory, it will crash. There are workarounds to this, but they aren't recommended.
When using Version Control, you can only have a maximum of 3 .esm files at once. During development, Bethesda's 3 .esm files were Skyrim.esm, Update.esm, and either Dragonborn.esm or Dawnguard.esm. This is likely a measure to prevent one DLC being added as a dependency of another. There are workarounds to this, but they aren't recommended.


====Check Out/In====
====Check Out/In====
Line 96: Line 96:


Save the change and load Skyrim.esm in the CK. You'll get a good number of errors about strings and such, ignore them and press Yes to All. Now it's possible to Check Out forms that belong to Skyrim.esm. Merge any changed Skyrim.esm forms from your ESP into your own ESM, then exit the Creation Kit and revert the flag change.
Save the change and load Skyrim.esm in the CK. You'll get a good number of errors about strings and such, ignore them and press Yes to All. Now it's possible to Check Out forms that belong to Skyrim.esm. Merge any changed Skyrim.esm forms from your ESP into your own ESM, then exit the Creation Kit and revert the flag change.
If your master depends on Update.esm, then you may have to apply the hex edit there too.
====Merging navmeshes====
In order to merge Navmesh forms (NAVM), the NavMeshInfoMap (NAVI) in Skyrim.esm must be checked out. Checking it out is an arduous process, but it generally only has to be done once on your setup and then it will remain checked out, even across merges, sessions and bit array regenerations.
* Apply the aforementioned hex edit to Skyrim.esm.
* Once in the version control dialog, click "All" and wait several minutes while a list of every loaded form is generated.
* Sort by "Type", then find the NAVI form manually in the list.
* Select it and check out. Then wait several more minutes while the list refreshes.
* Go back to viewing Altered, then check out/check in all forms as usual.
After you have done this, you don't have to use the hex edited Skyrim.esm anymore. Just as well, because loading it in-game causes a crash.
====Merging plugins which use the NullTextureSet====
The NullTextureSet is a Texture Set stored in the executable rather than Skyrim.esm. It can be used to make parts of a model invisible. But if a plugin adds objects that apply the NullTextureSet, then it too must be checked out for those objects to be merged. You can do this in the same way as checking out the NAVI as described above. It is easiest to find it when the version control window is sorted by Form ID (which it already should be by default). It will be listed as Form ID 00000028 from file "None" (since it doesn't come from Skyrim.esm). Check out this form and then you should be able to merge new objects that use it. As with the NAVI, you only have to do this once. It is currently unknown whether a hex edited Skyrim.esm is required or not.


==Perforce Integration==
==Perforce Integration==
Perforce is a 3rd Party Version Management software suite, available for free to small groups. When set up with the settings documented here, Perforce works hand-in-hand with the Version Control system to keep backups of previous iterations of scripts, and allow for each individual working on a project to pull the latest versions of all project scripts from the Perforce server. Perforce also manages DialogueView files, if present. In addition to storing versioned copies, the Creation Kit will update formids on all stored scripts and dialogue views that would otherwise change upon merge to an .esm.
Perforce is a 3rd Party Version Management software suite, available for free to small groups. When set up with the settings documented here, Perforce works hand-in-hand with the Version Control system to keep backups of previous iterations of scripts, and allow for each individual working on a project to pull the latest versions of all project scripts from the Perforce server. Perforce also manages DialogueView files, if present. In addition to storing versioned copies, the Creation Kit will update formids on all stored scripts and dialogue views that would otherwise change upon merge to an .esm. With Perforce integration unlocked, it is possible for networked teams working off of a master server using just the Creation Kit and Perforce from a common server for version control.


With Perforce integration unlocked, it is possible for networked teams working off of a master server using just the Creation Kit and Perforce from a common server for version control.  
Skyrim mod projects, however, will almost certainly never use Perforce in this way, and will just use general project management to avoid conflicts and xEdit to resolve conflicts in plugins before merge where possible. That said, the person doing the merges will still benefit from installing and setting up Perforce: automatic renaming and recompiling of Papyrus fragment scripts, and renaming of DialogueViews. Without Perforce, these external files are not touched at all, but the merged forms will still refer to renamed script names as a result of Version Control; unless renamed and recompiled manually, or automatically with Perforce, they will then not work in-game. DialogueViews are determined by FormID so will not be recognized by the CK either after merge, unless renamed manually, or automatically using Perforce. Setting up Perforce is therefore necessary to avoid having to manually edit each of these files after a merge.


===Setup===
===Setup===
Line 130: Line 144:
sDLCPrefix=DLC (The prefix you wish to have added to any script fragments processed)
sDLCPrefix=DLC (The prefix you wish to have added to any script fragments processed)
</source>
</source>
www.gameindustry.about.com/b/2012/07/29/version-control-management-and-games.htm
I will outline the steps roughly for now, but for step by step instructions please refer to that tutorial.


From http://www.perforce.com/downloads
From http://www.perforce.com/downloads


Install Perforce Server using the suggested default settings including - and this is important - the default path. Make your username the same as your Windows username. You must have administrator permissions.
Install Helix Core (formerly Perforce Server) using the suggested default settings including - and this is important - the default path, except for Server, which should be localhost:1666. Make your username the same as your Windows username. You must have administrator permissions. [https://www.perforce.com/video-tutorials/vcs/how-install-your-helix-core-server-client-windows-10 This video tutorial may help for this and the steps below.]


Set up your Perforce Depot to have the name TESVData and check that it is a stream depot rather than the default local depot type.  
Set up your Perforce Depot to have the name TESVData and check that it is a local depot rather than a stream depot as in the video. If you misname the depot, you may still use the administration tool to change it.


Next, install the Perforce Visual Client, also using default settings.  
Next, install the Helix Visual Client (formerly Perforce Visual Client), also using default settings, except localhost:1666 for Server.  


Open up your Perforce Server, ensure it is set up per the tutorial, then open P4V (the visual client). You will need to create a new workspace named Papyrus (not sure if this is hardcoded but it seems like it may be. Feel free to test other workspace names).
Open up your Perforce Server, ensure it is set up per the tutorial, then open P4V (the visual client). You will need to create a new workspace named Papyrus (not sure if this is hardcoded but it seems like it may be. Feel free to test other workspace names).
Line 149: Line 159:
In Windows Explorer, open up the new directory you created and add the following folders:
In Windows Explorer, open up the new directory you created and add the following folders:


\current\Source\scripts
\current\Source\scripts<br>
\current\Source\DialogueViews
\current\Source\DialogueViews<br>
\scripts
\scripts


Line 157: Line 167:
Refresh your Perforce Client and you should see the new subfolders and files. Right click on the scripts folder and click add. It should put your files into a changelist. Then, right click again and click submit to commit those changes to the depot. You will need to add a comment, it can be anything.
Refresh your Perforce Client and you should see the new subfolders and files. Right click on the scripts folder and click add. It should put your files into a changelist. Then, right click again and click submit to commit those changes to the depot. You will need to add a comment, it can be anything.


Next, install the Microsoft Office plugin for Perforce. This package contains P4COM.dll, a necessary file for the Creation Kit to "talk" to Perforce as well as several other libraries/dlls. If you have a copy of P4Com.dll or P4com64.dll in your Skyrim directory already, you will need to manually register it with Windows.
Next, install the [https://swarm.workshop.perforce.com/projects/perforce-software-p4office/ Microsoft Office plugin for Perforce]. This package contains P4COM.dll, a necessary file for the Creation Kit to "talk" to Perforce as well as several other libraries/dlls. If you have a copy of P4Com.dll or P4com64.dll in your Skyrim directory already, you will need to manually register it with Windows.


Then restart your computer.
Then restart your computer.
Line 166: Line 176:


However, the above isn't quite enough to confirm a correct install. As long as Perforce is present and P4COM.dll is registered the above will look right. To verify that the Creation Kit is able to read your TESVData depot, navigate to the Gameplay > Papyrus Script Manager option on the Creation Kit toolbar and click open. It should take a few seconds to load up. For most scripts in the manager, it should say "Yes" in both the "Compiled" and "Has Source" columns. The manager looks like that all the time (if you've properly extracted scripts.rar to the right folder) but if P4COM.dll isn't registered or something else has gone wrong, the Creation Kit won't be able to find the source scripts.
However, the above isn't quite enough to confirm a correct install. As long as Perforce is present and P4COM.dll is registered the above will look right. To verify that the Creation Kit is able to read your TESVData depot, navigate to the Gameplay > Papyrus Script Manager option on the Creation Kit toolbar and click open. It should take a few seconds to load up. For most scripts in the manager, it should say "Yes" in both the "Compiled" and "Has Source" columns. The manager looks like that all the time (if you've properly extracted scripts.rar to the right folder) but if P4COM.dll isn't registered or something else has gone wrong, the Creation Kit won't be able to find the source scripts.
===Usage===
When you want a merge a plugin that introduces new fragment scripts or dialogueviews, add the new sources to the Perforce depot in \current\Source\scripts and the dialogueviews in \current\Source\DialogueViews. Use Version Control for the merge as normal; do not be alarmed if you see nothing in the Papyrus section of the Version Control window, as that is normal. The start of the merge will now take longer as the scripts are renamed and recompiled. The script sources will appear in the depot under \current\Source\scripts, replacing the old files. However, the compiled scripts will appear in your Data\Scripts folder, and the renamed dialogueviews in Data\DialogueViews.


==Troubleshooting==
==Troubleshooting==
====Errors====
====Errors====
<source lang="html4strict">
Failed: Check in canceled. Failed to access check in lock file.</source>
Your shared network folders may have read permission, but not write permission.
<source lang="html4strict">
Old editor warning: Your 'CreationKit.exe' is old and you must update from the network before check in is allowed.</source>
You may have the wrong username set in SkyrimEditorPrefs.ini under [WhoCanMerge]. Double check whether it is the name which appears in the generated ConstructionSetNetwork.ini.
<source lang="html4strict">
<source lang="html4strict">
MASTERFILE: File index # is invalid. Clamping to ##. Does a master file depend on more than one master?</source>
MASTERFILE: File index # is invalid. Clamping to ##. Does a master file depend on more than one master?</source>
The above is a serious error resulting from having an active .esp with more than three master .esm files (including Skyrim.esm). It will corrupt both the .esm file you are merging into as well as the .esp file you are trying to merge if ignored. It is possible to bypass this error, allowing for one or more additional master files as long as all master files from position 02 or lower have no overlapping forms. The best way to do this is to manually renumber the forms in your fourth master file to a higher formid range, such as XX600000+ or XX7000000+ in TES5Edit prior to development.
The above is a serious error resulting from having an active .esp with more than three master .esm files (including Skyrim.esm). It will corrupt both the .esm file you are merging into as well as the .esp file you are trying to merge if ignored. It is possible to bypass this error, allowing for one or more additional master files as long as all master files from position 02 or lower have no overlapping forms. The best way to do this is to manually renumber the forms in your fourth master file to a higher formid range, such as XX600000+ or XX7000000+ in xEdit prior to development.


The following error advises that Perforce integration is not set up. It indicates that the Creation Kit will fall back on default code to assign new formids to script fragments, deleting the original versions without creating backups. It can be safely ignored, but be sure to keep manual back-ups.:
If you want to merge a plugin which, by accident, is dependent on more masters (typically DLC), you can remove those dependencies with the "Clean masters" functionality in xEdit if forms from them are not used in the plugin. If they ''are'' used, then first apply the "Report masters" script to check which forms and where, and remove those uses before cleaning masters.
<source lang="html4strict">
<source lang="html4strict">
Unable to initialize PerForce, check your logs for more information.</source>
Unable to initialize PerForce, check your logs for more information.</source>
 
Perforce integration is not set up. It indicates that the Creation Kit will fall back on default code to assign new formids to script fragments, deleting the original versions without creating backups. It can be safely ignored, but be sure to keep manual back-ups.
The below error indicates that you do not have a scripts folder in the root of your workspace. This is not the same folder as the source scripts - its purpose isn't clear but it may be a staging ground for formid updates.
<source lang="html4strict">Perforce workspace does not contain a script folder, Papyrus scripts will not be checked in or out.</source>
<source lang="html4strict">Perforce workspace does not contain a script folder, Papyrus scripts will not be checked in or out.</source>
 
You do not have a scripts folder in the root of your workspace. This is not the same folder as the source scripts - its purpose isn't clear but it may be a staging ground for formid updates.
==Notes==
<source lang="html4strict">Out of date target file: Only up to date master files can be checked in to. File '<x>.esm' has been checked into since it was loaded. Exit and update then try again.</source>
* In order to merge Navmesh forms (NAVM), the NavMeshInfoMap (NAVI) in Skyrim.esm must also be merged.
Occurs when trying to check in if the esm changed between loading it, and the check in attempt. Can have several causes:
 
* You made an edit in the CK.
* You already did a merge in the same session.
* The CK automatically fixed an issue in your esm on load. One such issue is null records, which it will remove. If this happens, load the CK with just your master file, close it, and copy the changed esm from your Merging to your local data folder. Then load it anew. A telltale sign that this is happening is if you get a warning indicating that your master file differs in the local and network folders.
<source lang="html4strict">Checkout Warning: <Form> is a different version than it was when it was loaded. Check out prevented.</source>
You need to regenerate the bit array (see above). You may have done a merge earlier and haven't regenerated the bit array since.
<source lang="html4strict">NavMesh Checkin: All altered navmeshes must checked in together. Would you like to remove all navmeshes from the current check in list and proceed? (YES)? Or cancel check in? (NO)</source>
If you checked out all altered navmeshes as well as the NAVI as described above and still get this error, your master's NAVI might be nonstandard. NAVI forms should always be overrides of the NAVI in Skyrim.esm at [00012FB4]; the game will merge all these overrides at runtime, as an exception to the usual "rule of one". If you have been using unofficial tools, then there is a possibility that your esm's NAVI is a new record rather than an override (formid beginning in 01 or higher). If this is the case, delete this NAVI (such as by using xEdit); the next time you merge a plugin with navmesh, a standard NAVI will be added to your esm. Make sure these plugins do not themselves contain overrides to the old nonstandard NAVI.


==See Also==
==See Also==