.asset_bg files and NEI append - Neerhom/COM3D2.ModLoader GitHub Wiki
ModLoader enables of loading .asset_bg files for use in Photo Mode as backgrounds and background objects. What is .asset_bg files? An .asset_bg files is simply an Unity Asset Bundle with different file extension. ModLoader loads ALL .asset_bg files from Mod folder, with disregard for folder structure. Do note, that COM3D2 runs on Unity version 5.6.4 which appears to not support Asset Bundles build for previous version of Unity i.e. you can't use the ones that are part of CM3D2 directly!! If you wish to use them, you'd have to extract their meshes and texture, and rebuild them in Unity Editor 5.6.4
How does one extract stuff from an Asset Bundle? Well, in this regard Unity is a bitch, as you're not meant to extract stuff from em. Luckily, you can use SB3UGS to edit .asset_bg files and .assets files (the stuff inside COM3D2x64_Data) and extract stuff like meshes and other stuff. Latest Experimental version is suggested.
ModLoader also enables one to append entries to game's nei file, by creating a .nei file with data you wish to append. The following table lists names of .nei files that ModLoader can append to, and requirements for your custom .nei file.
| Type | Photo BG | Photo BG Objects | Photo Motion | Desk Items | Desk Item Category |
|---|---|---|---|---|---|
| Target Filename | phot_bg_list.nei | phot_bg_object_list.nei | phot_motion_list.nei | desk_item_detail.nei | desk_item_category.nei |
| Folder | PhotoBG_NEI | PhotoBG_OBJ_NEI | PhotMot_NEI | DeskItem_NEI | DeskItem_NEI |
The Type refers to type of Data the Target .nei file adds. Target Filename refers to the file that base Game read corresponding data from. This is also the file that you can use as template to crate a valid .nei file. Folder is the folder in which ModLoader would search for your custom .nei file. The only important part is folder name. The filename of your custom NEI file doesn't matter, as as long it has the same internal structure as target file, otherwise in-game errors are possible. The location of Folder is also irrelevant, as long as it is inside Mod folder.
For instance if one want's to append data to phot_bg_list.nei, one can copy phot_bg_list.nei, rename it to something else like mynei.nei, edit so it only contains data that you want to appedn and place it inside PhotoBG_NEI, which is somewhere inside Mod folder i.e. Mod/PhotoBG_NEI and Mod/mymod/PhotoBG_NEI are both valid.
Don note, that in order for ModLoader to append data to supported .nei files, the name of file you append from must differ from the one inside game's archives. If filenames match, the file inside Mod folder will override the one from game's archive. Also, folder structure is only relevant for nei append feature (for performance reasons). ModLoader can override ANY nei file, and it does so with disregard for folder structure.
The corresponding list_enabled.nei files that KISS use are irrelevant here, and value inside ID cell can be either empty or any number.
For nei edit samples you can also refer to nei files in Mod/PhotoBG_OBJ_NEI which are shipped with ModLoader. For educational purposes folder Mod/PhotoBG_NEI contains a .csv file with a sample structure for appending data do phot_bg_list.nei. If you convert it to a .nei file a Sample entry will appear in BG selection window of Photomode, which doesn't do anything fancy. For Asset Bundle samples check the ones inside Mod/Mirror_props
Note because both category Desk Items and Desk Item Category share the same folder for efficiency reason, only nei files that contain category keyword in they name are assumed to be Category type. All other .nei files in that folder are assumed to be Desk Items.
Validity checking
Even though my initial intentions for this feature was for it to be use for adding mod backgrounds and background objects to Photomode, this also became a tool for adding stuff that KISS included into the game but decided not to add it to Photomode. As a result, when making append files for enabling items from CM3D2 and COM3D2 DLC's this lead to appearance of UI elements that did nothing, for those who don't have the DLC. The validity checks implemented in ModLoader 1.6.3 is aimed at solving that.
The validity checks only implemented for data appended to phot_bg_list.nei and phot_bg_object_list.nei. The motion lists is not included, because checks for those would be to complex which could impact performance.
So how does the validity check works? It's quite simple: both files has a dedicated column called 必要パック which by default contains name of the DLC (internally referred to as plugin) required for the rest of the row to show up. The ModLoader reads that column and if it contains ANY kind of text, it would check the list of available asset bundles (.asset_bg files) and if game has it, the ModLoader would enable it for Photomode. While the concept is simple, the examples are in order because of how the game is designed.
First, lest start with appending to phot_bg_list.nei.

1- is id. 2- Category name 3- Background name 4- Name of prefab or .asset_bg file (without extension) 5- plugin required
The first 3 columns should be pretty self-explanatory. The only thing to note that id is pretty much irrelevant, because ModLodaer doesn't care about itm so any number is fine. The purpose of 5 is described above and if it's empty, ModLoader will simply add the entry without any validity checks, but if it contains something (only presence of text is evaluated) the ModLoader will check the list of available .asse_bg files if it should the entry or not. A thing to consider here, is that column 4 can contain a name of either prefab or .asset_bg file (without extension).
So if 4 contains a name of .asset_bg file and column 5 has any text in it, the ModLoader will check the list of available .asset_bg files and if it's in the list, the entry will be added to PhotoMode. BUT if content of 4 refers to prefab which is stored in resources.assets and columnt 5 has any text the validity check will ALWAYS fail, because it's impossible to check resources.assets in any meaningful way. A thing to consider, is that contents of resources.assets are same for every game version, as this is the file that is only affect by game updates, so any validity check for prefab sohuldn't be necessary, which means if 4 is a name of prefab then 5 should be empty.
Onto phot_bg_object_list.nei

For photo BG object, this situation is simpler.
1 - id 2 - category name 3 - display name 4 - name of prefab 5 - name of .asset_bg file (without extension) 6 - plugin required
Because names of prefabs and .asset_bg files, are separated, only contents of 5 will be subjected to validity check if 6 contains ANY text. Which means, if 4 contains name of prefab, 6 should be empty.
With implementation of nei append for Desk Item data in v 1.6.6 (see table above), the For Desk Items, rows that refer to asset bundles are ALWAYS subjected to validity checks, because there isn't a dedicated column to get a condition from.