Hello everybody!
I’m trying to design DLC system for my game project. Seems like “Build DLC” checkbox at Project Launcher window has a strange behavior.
I followed Tom Loomans tutorial and it works. But:
- For this DLC system to work DLC content plugin has to be enabled at project build time. I.e. game knows that there is /DLC root path (for example), and loads contents from /DLC when corresponding pak-file is present. I need to ship DLC paks after release, so this method is not suitable;
- When I build DLC, then disable plugin and build main project, game doesn’t knows about /DLC root path and can’t find any assets even if DLC pak-file is present at Content/Paks directory.
After reading this question, this thread and many other more or less useful articles I decided to create DLC pak-files manually. So I created paklist.txt:
"C:\svn\ue4_interactive_wall_bp\trunk\Plugins\DLC\Saved\Cooked\WindowsNoEditor\interactive_wall\Plugins\DLC\Content\mymap.umap" "../../../interactive_wall/Content/DLC/MyDlc/mymap.umap" -compress
"C:\svn\ue4_interactive_wall_bp\trunk\Plugins\DLC\Saved\Cooked\WindowsNoEditor\interactive_wall\Plugins\DLC\Content\asdf.uasset" "../../../interactive_wall/Content/DLC/MyDlc/asdf.uasset" -compress
makemod.bat:
@echo off
unrealpak c:\svn\ue4_interactive_wall_bp\trunk\Plugins\DLC\mod.pak -create=c:\svn\ue4_interactive_wall_bp\trunk\Plugins\DLC\paklist.txt
pause
Batch file makemod.bat makes pak-file mod.pak, which I place at Content/Paks directory of built game.
My DLC contains simple map - mymap.umap, and simple blueprint actor - asdf.uasset, which I place on map.
Engine loads additional pak-files on start, and my configuration is Development, so I can just load map from console:
>open mymap
Map loads, but my custom blueprint actor doesn’t. Corresponding log messages are:
[2016.06.06-07.40.30:824][ 0]LogWorld: Bringing World /Game/Levels/Default.Default up for play (max tick rate 0) at 2016.06.06-14.40.30
[2016.06.06-07.40.30:824][ 0]LogWorld: Bringing up level for play took: 0.002053
[2016.06.06-07.40.30:825][ 0]LogSpawn:Warning: SpawnActor failed because no class was specified
[2016.06.06-07.40.30:827][ 0]LogPackageName:Error: DoesPackageExist: DoesPackageExist FAILED: '/DLC/asdf' is not a standard unreal filename or a long path name. Reason: Path does not start with a valid root. Path must begin with: '/Engine/', '/Game/', '/Config/', '/Script/', or '/Temp/'
[2016.06.06-07.40.30:827][ 0]LogLinker:Warning: Can't find file '/DLC/asdf'
[2016.06.06-07.40.30:827][ 0]LogUObjectGlobals:Warning: Failed to load '/DLC/asdf': Can't find file '/DLC/asdf'
[2016.06.06-07.40.30:827][ 0]LogPackageName:Error: DoesPackageExist: DoesPackageExist FAILED: '/DLC/asdf' is not a standard unreal filename or a long path name. Reason: Path does not start with a valid root. Path must begin with: '/Engine/', '/Game/', '/Config/', '/Script/', or '/Temp/'
[2016.06.06-07.40.30:827][ 0]LogLinker:Warning: Can't find file for asset '/DLC/asdf' while loading NULL.
[2016.06.06-07.40.30:827][ 0]LogUObjectGlobals:Warning: Failed to load '/DLC/asdf': Can't find file for asset '/DLC/asdf' while loading NULL.
[2016.06.06-07.40.30:827][ 0]LogPackageName:Error: DoesPackageExist: DoesPackageExist FAILED: '/DLC/asdf' is not a standard unreal filename or a long path name. Reason: Path does not start with a valid root. Path must begin with: '/Engine/', '/Game/', '/Config/', '/Script/', or '/Temp/'
[2016.06.06-07.40.30:845][ 0]LogLoad: Took 1.872960 seconds to LoadMap(/Game/Levels/Default)
[2016.06.06-07.40.30:845][ 0]LogInit:Display: Game Engine Initialized.
[2016.06.06-07.40.31:459][ 0]LogLoad: Full Startup: 5.36 seconds (BP compile: 0.00 seconds)
[2016.06.06-07.40.31:459][ 0]LogExternalProfiler: Found external profiler: VSPerf
[2016.06.06-07.40.31:459][ 0]LogExternalProfiler: Using external profiler: VSPerf
[2016.06.06-07.40.31:477][ 0]LoadErrors:Warning: Warning CreateExport: Failed to load Outer for resource 'DefaultSceneRoot': asdf_C /Game/DLC/MyDlc/mymap.mymap:PersistentLevel.asdf_368
[2016.06.06-07.40.31:478][ 0]LoadErrors:Warning: Warning CreateExport: Failed to load Outer for resource 'Cube': asdf_C /Game/DLC/MyDlc/mymap.mymap:PersistentLevel.asdf_368
,
[2016.06.06-07.40.35:919][229]LogNet: Browse: /Game/DLC/MyDlc/mymap
[2016.06.06-07.40.35:920][229]LogLoad: LoadMap: /Game/DLC/MyDlc/mymap
and
[2016.06.06-07.40.35:959][229]LogPackageName:Error: DoesPackageExist: DoesPackageExist FAILED: '/DLC/asdf' is not a standard unreal filename or a long path name. Reason: Path does not start with a valid root. Path must begin with: '/Engine/', '/Game/', '/Config/', '/Script/', or '/Temp/'
[2016.06.06-07.40.35:959][229]LogLinker:Warning: Can't find file '/DLC/asdf'
[2016.06.06-07.40.35:959][229]LogUObjectGlobals:Warning: Failed to load '/DLC/asdf': Can't find file '/DLC/asdf'
[2016.06.06-07.40.35:959][229]LogPackageName:Error: DoesPackageExist: DoesPackageExist FAILED: '/DLC/asdf' is not a standard unreal filename or a long path name. Reason: Path does not start with a valid root. Path must begin with: '/Engine/', '/Game/', '/Config/', '/Script/', or '/Temp/'
[2016.06.06-07.40.35:959][229]LogLinker:Warning: Can't find file for asset '/DLC/asdf' while loading NULL.
[2016.06.06-07.40.35:959][229]LogUObjectGlobals:Warning: Failed to load '/DLC/asdf': Can't find file for asset '/DLC/asdf' while loading NULL.
[2016.06.06-07.40.35:959][229]LogPackageName:Error: DoesPackageExist: DoesPackageExist FAILED: '/DLC/asdf' is not a standard unreal filename or a long path name. Reason: Path does not start with a valid root. Path must begin with: '/Engine/', '/Game/', '/Config/', '/Script/', or '/Temp/'
[2016.06.06-07.40.35:993][229]LogAIModule: Creating AISystem for world mymap
[2016.06.06-07.40.37:766][229]LogWorld: Game class is 'BP_GameMode_C'
[2016.06.06-07.40.37:768][229]LogWorld: Bringing World /Game/DLC/MyDlc/mymap.mymap up for play (max tick rate 0) at 2016.06.06-14.40.37
[2016.06.06-07.40.37:768][229]LogWorld: Bringing up level for play took: 0.000585
[2016.06.06-07.40.37:769][229]LogSpawn:Warning: SpawnActor failed because no class was specified
[2016.06.06-07.40.37:778][229]LogLoad: Took 1.858383 seconds to LoadMap(/Game/DLC/MyDlc/mymap)
[2016.06.06-07.40.37:781][230]LoadErrors:Warning: Warning CreateExport: Failed to load Outer for resource 'DefaultSceneRoot': asdf_C /Game/DLC/MyDlc/mymap.mymap:PersistentLevel.asdf_368
[2016.06.06-07.40.37:781][230]LoadErrors:Warning: Warning CreateExport: Failed to load Outer for resource 'Cube': asdf_C /Game/DLC/MyDlc/mymap.mymap:PersistentLevel.asdf_368
It looks like engine expects assets to exist at path /DLC and can’t load them because pak mounts at /Game/ root directory, so references are broken in this case.
I think i need to fix those references somehow, already had look at FArchiveReplaceObjectRef, but seems like nobody on earth knows right way to use it.
Another way would be mount pak-file to its native mount point, I tried FCoreDelegates::OnMountPak, FPakPlatformFile, etc with no success.
Can anybody help me or at least point in the right direction?
I’m sorry for my bad english, it isn’t my native language.