Location of external data files.
romatthe opened this issue · 4 comments
Hey there, thanks for this awesome project.
I feel a little silly for asking this, as I've used this engine before in the past, but right now I'm a little confused as to how the external data is supposed to be found.
I'm on Linux, and I've built the game from source. As soon as I launch it, I get the (pretty understandable) exception:
Unable to find file '2Wall3D.amb'.
at Ambermoon.Data.Legacy.GameData.<>c__DisplayClass107_0.<Load>g__HandleFileNotFound|1(String file, Char disk) in /build/source/Ambermoon.Data.Legacy/GameData.cs:line 574
at Ambermoon.Data.Legacy.GameData.Load(Func`2 fileLoader, Func`2 diskLoader, Func`2 fileExistChecker, Boolean savesOnly, Dictionary`2 optionalAdditionalFiles) in /build/source/Ambermoon.Data.Legacy/GameData.cs:line 683
at Ambermoon.Data.Legacy.GameData.Load(String folderPath, Boolean savesOnly) in /build/source/Ambermoon.Data.Legacy/GameData.cs:line 496
at Ambermoon.GameWindow.ShowVersionSelector(BinaryReader builtinVersionReader, Action`4 selectHandler, TextureAtlasManager& createdTextureAtlasManager) in /build/source/Ambermoon.net/GameWindow.cs:line 1032
at Ambermoon.GameWindow.Window_Load() in /build/source/Ambermoon.net/GameWindow.cs:line 1409
at Silk.NET.Windowing.Internals.ViewImplementationBase.Initialize()
at Silk.NET.Windowing.WindowExtensions.Run(IView view)
at Ambermoon.GameWindow.Run(Configuration configuration) in /build/source/Ambermoon.net/GameWindow.cs:line 1761
at Ambermoon.Program.Main() in /build/source/Ambermoon.net/Program.cs:line 69
Obviously, I still need to provide the original Ambermoon data files. The problem is that I can't seem to find any documentation as to where I'm supposed to put these. I've scoured the entire repository for documentation, but I simply can't find any references to it. I couldn't find anything on your website either. I've even taken to browsing the source code, but it's still not any clearer. In desperation, I've even tried to place the files in ~/.config/Ambermoon.net and ~/.local/share/Ambermoon.net, with no luck. And Ambermoon.net --help unfortunately doesn't do anything.
I'm probably missing something really obvious here, but is there a piece of documentation here that tells me which folders the game checks for the data files?
Thanks!
Hi there. You can specify the data path inside the config file "ambermoon.cfg". You also have to activate the external path there.
It is documented here: https://github.com/Pyrdacor/Ambermoon.net/blob/master/Configuration.md
See External Data.
Basically you set a boolean to true and specify a path to the "Amberfiles" folder. For example "my/path/Amberfiles".
Hope this works as expected. Let me know if you have further questions or problems. ;)
Sorry about that, I feel a little silly for missing that!
However, I'm still a tiny bit confused. Whenever I build Ambermoon.net myself from source, I get the exception shown above, which I thought was normal because I hadn't provided the original Ambermoon files yet. However, it seems that the prebuilt binaries you're shipping per release already run just fine without me providing the original files. Yet I can't those releases don't come with any external data files.
Are the assets in the release build packed straight into the .NET assembly? And if so, how would I achieve the same thing when building the application from source myself?
Again, sorry if I'm confusing you with my rambling, I'm just very confused myself right now :)
There are built-in versions which are packed into the main .NET assembly through another tool. This file is called versions.dat and it basically contains all the game versions you see in the version selector.
It is enough to put the file versions.dat next to the executable (or in the Debug/Release folder maybe if you build locally).
The file is part of the repository and it is located inside the project directory. Normally this works when building on Windows.
But if you build on other operating systems, try to copy the file to the directory where the executable is created. Like the "bin" or "dist" folder.
Perfect, that's the info I needed. Thanks!