Virtual depot and source control

Learn about the virtual depot and how to use different types of files.

What is the Virtual Depot made up of? How Source Control works in REDkit and what are the allowed operations on files? Find out below.


Virtual depot

1f89e8b8-e420-47cd-8c1a-ee87596ca029.jpg

The virtual depot is merged from three physical directories which you see in the Editor as one directory.

The three physical directories are:

  • Workspace - files modified/created by the user.

  • Uncooked data - files from the game (meshes, textures) which the user will need to uncook the user will need to uncook some data from the game itself.

  • r4data: - assets provided alongside REDkit.

The status of files changes based on the physical directories which contains them. More about that in the Source Control section.

Files can exist in multiple directories, but only one will be visible for you via the virtual depot:

  • workspace > uncook > r4data


Every directory in the Asset Browser is a virtual directory which has a corresponding physical directory (workspace, uncook, r4data).

An example of that would be:

  • r4data root: Z:\Main.Lava.Redkit\r4data

  • uncook root: Z:\uncookdata

  • workspace root: Z:\myModProject\workspace

So if the virtual directory in the Asset Browser is virtualdepot\gameplay\abilities\witch\, then the corresponding physical directories areL

  • r4data root: Z:\Main.Lava.Redkit\r4data\gameplay\abilities\witch\

  • uncook root: Z:\uncookdata\gameplay\abilities\witch\

  • workspace root: Z:\myModProject\workspace\gameplay\abilities\witch\

During first time setup, you need to set the uncooked and the workspace directories.

It’s not needed for the r4data is known, because it’s connected to the REDkit directory.


Source control

There are three defined states for files - depending on which physical directories contain them.

The status also defines what operations are allowed for that file.

  • locked (or checked-in)

    • file is located in the r4data and/or uncook data only.

    • allowed operations: check-out, copy, export. Locked files are read-only.

0db91a37-bff3-4321-93cf-61eea8fe5bc5.png

 

  • checked-out

    • the file is in the workspace directory and in r4data/uncook.

    • allowed operations: revert, copy, export, edit, save. These files can be edited by the user. When the files are saved, the workspace version will be updated, but not the one in r4data/uncook.

 

  • added

    • the file is in the the workspace directory only

    • allowed operations: revert (=delete), copy, export, rename, cut, edit, save. These files are created by the user, so they can do basically anything with them.

 


File operations

Below you can find a list of available file operations with explained limitations.

Check-out

Only locked files can be checked-out: the r4data/uncook version is copied into the workspace folder.

Then, the user can edit the workspace file and save it.

Example.
Check-out a locked file ‘characters\models\animals\bat\t_01__bat.w2ent’.
The file’s current physical location is in the r4data directory: <path_to_physical_r4data>\characters\models\animals\bat\t_01__bat.w2ent
During checkout the file will be copied to the workspace, and all corresponding physical directories are created (if not already existing).
File will be copied to: <path_to_physical_workspace>\characters\models\animals\bat\t_01__bat.w2ent.

Revert

The workspace version of the file is deleted. If the reverted file status was:

  • added: it is completely deleted

  • checked-out: after revert, the user will see the r4data/uncook file, which will be locked

Copy

Same as in Windows Explorer, any file can be copied (multiple at once also).

Paste

The pasted files status will be added, and will be created in the workspace physical directory.

The naming is similar as in Windows Explorer: if a file with the same name already exists in the virtual directory, the new file will be ‘<original_file_name>_copy’, then ‘<original_file_name>_copy_1’… etc.

If you copy a locked file, then paste it into the same directory in Asset Browser, the original file’s physical directory is r4data, and the pasted file’s physical directory is the workspace, right? Nonetheless, the new file will have “_copy” in it’s name (original_file_name_copy), since it would be a duplicate file in the virtual directory.

Rename

Only added files can be renamed. You cannot rename the existing depot files, since the risk of breaking some dependencies is too significant.

 

______________________________________
The Witcher 3: Wild Hunt Complete Edition © 2024 CD PROJEKT S.A. Published by CD PROJEKT S.A. Developed by CD PROJEKT RED. CD PROJEKT®, The Witcher®, REDengine® are registered trademarks of CD PROJEKT Capital Group. All rights reserved. The Witcher game is set in the universe created by Andrzej Sapkowski in his series of books. All rights reserved.