Star Wars: Battlefront II (2017)
0 of 0

File information

Last updated

Original upload

Created by

Mophead

Uploaded by

Mophead01

Virus scan

Safe to use

Tags for this mod

About this mod

Frosty Editor Plugin which automates the process of completing bundles, network registries and meshvariation databases. DESIGNED FOR MOD MAKERS ONLY

Permissions and credits
Donations
Introduction:
The bundle manager (BM) is a tool I made for the creation of Instant Action Tweaks, which aims to automatically complete all necessary edits to bundles, meshvariationdbs and network registries with just the click of one button. This is not a perfect tool so you must read and understand this description to understand the limitations so that you can best make use of this tool.

Installation:
The latest version of FMM is required. Download can be found in #Announcements of https://discord.gg/J42jMGX

You must unzip the download into the Frosty Editor/Plugins folder. The ZIP includes the BM dll as well as a cache file within a Cache folder. The cache is essential, you must keep it in that directory. However the bundle manager can generate one if you don't have it.


The bundles problem explained:
Before I explain how the BM works it is important to understand the problem I am trying to solve for those unfamiliar.
  • Bundles: Bundles are packages of assets which will be loaded into the game together when the bundle is accessed. When DICE export battlefront 2 these bundles will automatically be calculated based on what the game will need to be loaded at any given time. The goal of the developers creating bundles is to reduce what is loaded in the game to only what is needed for the sake of performance and optimisation. For example the bundles for Naboo will contain any of the classes or props that you see in a Naboo but won't include props from Hoth. The problem with this system for modders is that Frosty modding tools does not automatically work out what bundles everything should be when you make changes. So if you tried for example adding a Sith trooper to Geonosis and then played the game, either the game would crash or nothing would show up in the place of the sith trooper because his files are not loaded in. 
  • MeshVariationDataBases (MVDB): MVDB files are a type of file found in every single bundle which contains a mesh or variation asset, they define the allocation of textures and shaders to every mesh and variation within a bundle. The problem with this file is if any meshes or variations are added to any new bundles then the MeshVarariation data will need to be copied to the new bundle's MVDB.
  • NetworkRegistryAssets (NRA): Like MVDBs, NRA files are a type of file found in almost every bundle. NRAs are a list of references to gameplay related files. Every time a new gameplay related file is added to a bundle, they must be added to this long list of references





How The Bundle Manager Works:
The BM script will execute after pressing "Tools"> "Bundle Manager">"Complete Bundles". It will perform 4 steps to fill in bundles, MVDBs and NRAs. For simple edits like mesh swaps this should only take a few seconds while complex mods like Instant Action Tweaks take about a minute to complete (obviously depends on how good your hardware is though). 


Bundle Manager steps:

  • Logging modified data - The bundle manager will look at every base game parent file you have modified and check for newly added child references. It will then create a lists of the bundles which the parent files are in, so that it can check (and add if necessary) the child assets to the parent's bundles. It will also add to bundles in a very specific order so that assets don't potentially get loaded in twice.
  • Adding Assets to Bundles - The BM will next enumerate over every asset you’ve edited and check if every child reference that you have added is in the same bundles (or bundles loaded before that which the bundle inherits from) as the parent asset. If it is not then the bundle manager will add the asset to the required bundles and then enumerate over the references of the child asset to make sure that they are also loaded, if not then the process will repeat on them and their references and so on...  If the BM detects that an asset is already loaded then it won’t bother checking the references of that asset since they are guaranteed to already be loaded.
  • Updating MeshVariationDBs - If you have added any meshes or object variations to new bundles then the BM will copy over the MeshVariation data for that asset into the MVDB of the bundle.
  • Updating Network Registries - The BM will then enumerate over every bundle for which you have added assets to and add references, to their network registries, of the assets which contain types which could potentially need to be referenced by a net reg. It is currently unknown in the modding community what exactly makes something require a net reg reference, so the script may add unnecessary references. This can potentially cause problems in multiplayer matches as network registry modding should only be used in SP mods. You can disable adding to network registries in the Bundle Manager options to prevent this.
Once the Bundle Manager is completed it will export a csv log of all actions taken to your cache file directory under the file  Plugins\Caches\StarWarsBattlefrontII_BundleManager_IgnoreBundles.txt

You can use this to understand how the bundle manager works and potentially debug causes of bugs.
Clear Edits:
You can also clear all edits that the BM makes by pressing "Tools"> "Bundle Manager">"Clear Bundles". This will remove every bundle addition in the project file (including ones done manually without the use of the BM, so be careful), and will revert every MVDB and NRA edited. I would highly recommend you do this every time you save your project file as it will reduce the size of the project file and will save and open faster.




Unique Asset Type Bundle Edits:
Certain types of files require more advanced logic for the bundle manager to edit, usually because of associated chunks and res files. Here is a list of every file type which I have made unique code for
Chunk/Res:
  • AtlasTextureAsset
  • ClothAsset
  • ClothWrappingAsset
  • CompositeMeshAsset
  • EmitterGraph
  • EnlightenDataAsset
  • GradingLutAsset
  • HavokAsset
  • MeshEmitterAsset
  • MovieTexture2Asset
  • MovieTextureAsset
  • ObjectVariation
  • PathfindingBlobAsset
  • RigidMeshAsset
  • ShaderGraph
  • SkinnedMeshAsset
  • SkinnedProceduralAnimationExpressionGraph
  • SoundWaveAsset
  • StaticEnlightenData
  • SvgImage
  • TextureAsset
  • UITextureAsset
EBX Unique Logic:
  • VisualUnlockRootAsset: Ignores dependencies if the VUR has no VisualUnlockAssets since Meshes referenced by VisualUnlockPartAsset Instances are completely pointless and only serve to waste storage space.
  • SchematicsAsset: Applies bundle edits to the paired ClassInfoAsset (no direct reference otherwise)

Bundle Manager Options:
You can also customise how the BM script works so that it doesn't include certain steps or modify certain bundles


Bugs/Limitations: 
  • Frosty cannot properly save the FirstMip property of textures chunks so you must redo any bundle manager edits when reopening an old project file if your bundle manager has changed the bundles of any textures. If you do not do this then the in game shaders can break.
  • Frosty does not properly write FirstMips of certain Texture Chunks to cas files correctly. When this happens, the game will have an infinite loading screen, no matter which bundle you added the textures to. This can prevent the bundle managing of certain meshes such as Yavin Ceremony Han meshes since some of their textures are "borked" from Frosty's end. This is not something I can fix. You would have to ask the Frosty developers (nicely ofc) to look into why this happens. Example of a "borked" texture: Characters/Light/L_Specialist_Preq/L_Specialist_Preq_01/Texture/T_L_Specialist_Preq_01_W.
  • Shaders are currently an unknown format in the modding community so bringing meshes with unique shaders into levels that don’t have them can cause meshes to either be invisible or completely crash the game. The only way to allow for bundle management of meshes and shaders would be if someone were to understand and create code for dealing with this format.
  • Some ebx files depend on data found in giant level databases (such as shaders and animations) which as of yet cannot be edited to include new data that would need to be added to each level. This means some complex logic cannot be ported to new bundles without the manual editing of those databases, else the game will either glitch out or crash.
  • Meshes cannot be added to some blueprintbundles because they lack MVDBs, if you try to add them and then launch the game you will get an object reference error. I have programmed the BM to give a warning when adding to these bundles. You should try to add them to the parent bundle instead because they have a MVDB and the child bpb will inherit the meshes loaded through the parent.

  • Currently BF2 is the only supported BM game and I have only written a bundle inheritance list for the MP shared, sublevel and blueprint bundles. SP campaign modding is not supported but might work to an extent.