Hi there,
All those options you have listed are viable, but depending on how your team wants or needs to work, what needs to be shared, and what version control system you are using, may move you in a different direction.
Each has its benefits and drawbacks. I’ll list each option out with the pros and the cons
If I can summarise your concerns, you have multiple projects that share some amount of code and content, and we want to make it clean and easy to work on a single project or just work on the shared data.
Here is how I would structure a project like this, utilising Perforce (git submodules would also work), which is most similar to your option 2.
I would have 1 .uproject per game or app, in its own streaming depot/repository.
The shared data would be submoduled into the project’s plugin directory from its own streaming depot/repo; you may have 1 repo per shared module or a single depot with many shared modules. In perforce, I would bring it in with import+, which imports it into the client’s view with the ability to edit and submit back to the owning repo on commit. This is mostly transparent for the developers.
Having the shared data in its own depot/repo allows you to branch the data per game or release if required.
For the Unreal Engine, there are 2 ways you could share this code between projects, (assuming you are using a source build of Unreal)
* If your engine changes very infrequently, you could create an installed build of the engine and distribute that to your teams, making it similar to a build distributed from the Epic game launcher. The benefit here is that it makes your projects much smaller to sync, and uses less drive space, but it is harder to maintain an updated version, or modify if needed.
* If the engine may change more frequently, and in general, my preferred method is to have the engine in its own repo/depot, and also to submodule it into the project. This makes it easy to get the correct version of the engine for each project.
I’d pair this with UGS (Unreal Game sync), which allows you to move projects, streams, and sync a precompiled version of the editor for each project for artists or devs who don’t need to modify C++
Some more information is here: https://dev.epicgames.com/documentation/en-us/unreal-engine/unreal-game-sync-ugs-for-unreal-engine
Option 1:
This might work well if your developers need to work across multiple projects more than once per day. But it can lead to assets being referenced outside of their intended project, as all content would show up in the content browser and asset selection windows, which may lead to bugs.
Option 2:
Without knowing more about the types of projects, these would be my recommendations.
Each project is contained within its own space, project settings from one don’t affect the others, etc.
Shared data and engines can be versioned easily with their own branches maintained in their own repos.
Will have a larger setup time to get all the infrastructure and repo setup in place, however, once it’s set up and the team is onboarded to this way of working, there would be minimal work to maintain it, and provides only what the developers need to work on that project. Any work on the shared data could be done on any project and committed back to the shared repo for any other project or team to use.
Option 3:
Very similar, as I understand, to 2 but with a dummy uproject for the team working on the shared data. This would be useful only if there is a dedicated team solely working on the shared data. But this could be structured just like another project, with automation and testing code in the uproject with the shared data in the plugin.
How can we ensure none of the Project2 data with leak inside Project1 and vice-versa?
Hard to do with Option 1, but with Option ⅔, this should be preventable.
How can we streamline the process for developers to clearly know on which project they are working on and simplify moving between them?
With Option 2 coupled with UGS, they would simply work within the UGS project tab for syncing, launching the editor or Visual Studio from there. Makes it easy to separate which stream or branch you are in. With UGS, you can also supply a custom icon, message of the day, and color to differentiate streams further.
Is it possible to have the plugin with its source and assets outside of any uproject and still use them from inside the project?
Yes, if I understand what you are looking for correctly, you can have a plugin reside in another repo/depot and use it in other projects. However, they must have the same engine version. If you have multiple engine versions you need to support, you can create branches within the shared data repo for versions of the content or even version releases of the content.
Does this information help answer your questions?
If you need further help structuring this within Perforce, let me know.
Kind Regards
Keegan GIbson