Trouble running Code-Only sample

Heyo!

I’ve been trying to get the code only sample from here compiling and running while on Linux. I finally managed to, however it crashes on startup complaining that it can’t find data/db/index. From what I little I could find I gather this file should reference the assets needed in the project? How should I generate this without the game studio, or better yet avoid needing it entirely? Not sure what information might be useful so please ask if you need anything.

Thanks so much if you can help!

Exact runtime error

Unhandled Exception: System.IO.FileNotFoundException: Could not find file ‘PATH/Xenko.CodeOnlySample-master/Bin/Linux/Release/linux-x64/data/db/index’.
at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter)
at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode)
at System.IO.FileStream…ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at Xenko.Core.IO.FileSystemProvider.OpenStream(String url, VirtualFileMode mode, VirtualFileAccess access, VirtualFileShare share, StreamFlags streamFlags)
at Xenko.Core.Serialization.Contents.ContentIndexMap.Load(String indexFile, Boolean isReadOnly) in D:\BuildAgent\work\8cafb933a54b01d0\sources\core\Xenko.Core.Serialization\Serialization\Contents\ContentIndexMap.cs:line 76
at Xenko.Core.Storage.FileOdbBackend…ctor(String vfsRootUrl, String indexName, Boolean isReadOnly) in D:\BuildAgent\work\8cafb933a54b01d0\sources\core\Xenko.Core.Serialization\Storage\FileOdbBackend.cs:line 26
at Xenko.Core.Storage.ObjectDatabase…ctor(String vfsMainUrl, String indexName, String vfsAdditionalUrl, Boolean loadDefaultBundle) in D:\BuildAgent\work\8cafb933a54b01d0\sources\core\Xenko.Core.Serialization\Storage\ObjectDatabase.cs:line 41
at Xenko.Core.Storage.ObjectDatabase.CreateDefaultDatabase() in D:\BuildAgent\work\8cafb933a54b01d0\sources\core\Xenko.Core.Serialization\Storage\ObjectDatabase.cs:line 85
at Xenko.Engine.Game.InitializeAssetDatabase()
at Xenko.Engine.Game.PrepareContext()
at Xenko.Games.GameBase.Run(GameContext gameContext)
at Xenko.CodeOnlySample.Linux.Xenko_CodeOnlySampleApp.Main(String[] args) in PATH/Xenko.CodeOnlySample-master/Xenko.CodeOnlySample.Linux/Xenko.CodeOnlySample.cs:line 11
Aborted (core dumped)

Alright sorry I should have tried this beforehand, turns out just adding an empty file called index quells it. That said now I get a “Unhandled Exception: OpenTK.Graphics.GraphicsContextException: Could not make GL context current: GLXBadContextTag”. OpenGL definitely works on here, so not sure what could be wrong.

Alright building for Vulkan works, so I guess solved. Odd that OpenGL just throws an error though.

That said, I’m now wondering how to generate the data/db/index file. It’d be nice to try building some actual projects but obviously making that file empty just loads a black screen. Anyone know how or where I can find more info on it?

I’m sorry to be a bother, but please does anyone know what I’m missing? I’m almost certain something is suppose to happen when I build the projects that isn’t happening, like the assets should be compiled and references stored in a database of some kind, but I just don’t know where to start and working at it from the outside like this is impossible (I can’t even find any built projects to check against!). I’d really appreciate some help :slight_smile:

For reference, the way I’m compiling is just:
Navigate to the project folder
msbuild /p:Configuration=Release /t:restore
msbuild /p:Configuration=Release /t:build
with msbuild being the Mono version. I can’t compile it with dotnet core, I get a “Failed to run assembly processor with parameters” error:

Full Error

Patch for assembly [XenkoByteSized, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
at Mono.Collections.Generic.Collection`1.get_Item(Int32 index)
at Mono.Cecil.BaseAssemblyResolver.GetAssemblyInNetGac(AssemblyNameReference reference, ReaderParameters parameters)
at Mono.Cecil.BaseAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
at Xenko.Core.AssemblyProcessor.CustomAssemblyResolver.Resolve(AssemblyNameReference name, ReaderParameters parameters)
at Xenko.Core.AssemblyProcessor.CustomAssemblyResolver.Resolve(AssemblyNameReference name)
at Xenko.Core.AssemblyProcessor.Serializers.ReferencedAssemblySerializerProcessor.ProcessDataSerializerGlobalAttributes(CecilSerializerContext context, AssemblyDefinition assembly, Boolean local)
at Xenko.Core.AssemblyProcessor.Serializers.ReferencedAssemblySerializerProcessor.ProcessDataSerializerGlobalAttributes(CecilSerializerContext context, AssemblyDefinition assembly, Boolean local)
at Xenko.Core.AssemblyProcessor.Serializers.ReferencedAssemblySerializerProcessor.ProcessDataSerializerGlobalAttributes(CecilSerializerContext context, AssemblyDefinition assembly, Boolean local)
at Xenko.Core.AssemblyProcessor.Serializers.ReferencedAssemblySerializerProcessor.ProcessDataSerializerGlobalAttributes(CecilSerializerContext context, AssemblyDefinition assembly, Boolean local)
at Xenko.Core.AssemblyProcessor.ComplexSerializerRegistry…ctor(PlatformType platform, AssemblyDefinition assembly, TextWriter log)
at Xenko.Core.AssemblyProcessor.SerializationProcessor.Process(AssemblyProcessorContext context)
at Xenko.Core.AssemblyProcessor.AssemblyProcessorApp.Run(AssemblyDefinition& assemblyDefinition, Boolean& readWriteSymbols, Boolean& modified)
Unexpected error
/home/.nuget/packages/xenko.core/3.1.0.1-beta02-0550/build/Xenko.Core.targets(95,5): error : Failed to run assembly processor with parameters: --auto-notify-property --parameter-key --auto-module-initializer --serialization --add-reference="/home/.nuget/packages/system.memory/4.5.2/lib/netstandard2.0/System.Memory.dll" --add-reference="/home/.nuget/packages/xenko.engine/3.1.0.1-beta02-0550/ref/netstandard2.0/Xenko.Engine.dll" --add-reference="/home/.nuget/packages/xenko.video/3.1.0.1-beta02-0550/ref/netstandard2.0/Xenko.Video.dll" --add-reference="/home/.nuget/packages/xenko.physics/3.1.0.1-beta02-0550/ref/netstandard2.0/Xenko.Physics.dll" --add-reference="/home/.nuget/packages/xenko.navigation/3.1.0.1-beta02-0550/ref/netstandard2.0/Xenko.Navigation.dll" --add-reference="/home/.nuget/packages/xenko.particles/3.1.0.1-beta02-0550/lib/netstandard2.0/Xenko.Particles.dll" --add-reference="/home/.nuget/packages/xenko.ui/3.1.0.1-beta02-0550/ref/netstandard2.0/Xenko.UI.dll" --add-reference="/home/.nuget/packages/xenko.core/3.1.0.1-beta02-0550/ref/netstandard2.0/Xenko.Core.dll" --references-file=“obj/Debug/netstandard2.0/XenkoReferences.cache” --platform=Windows --targetFramework= “obj/Debug/netstandard2.0/XenkoByteSized.dll” [PATH/XenkoByteSized-master/XenkoByteSized/XenkoByteSized.csproj]
/home/.nuget/packages/xenko.core/3.1.0.1-beta02-0550/build/Xenko.Core.targets(95,5): error : Check the previous logs [PATH/XenkoByteSized-master/XenkoByteSized/XenkoByteSized.csproj]
/opt/dotnet/sdk/2.2.105/Microsoft.Common.CurrentVersion.targets(1179,5): error MSB3644: The reference assemblies for framework “.NETFramework,Version=v4.6.1” were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [PATH/XenkoByteSized-master/XenkoByteSized.Windows/XenkoByteSized.Windows.csproj]
TriggerScene/PlayerController.cs(155,13): warning CS0618: ‘CharacterComponent.Move(Vector3)’ is obsolete: ‘Please use SetVelocity instead. SetVelocity internally applies this.GetSimulation().FixedTimeStep’ [PATH/XenkoByteSized-master/XenkoByteSized/XenkoByteSized.csproj]
ProceduralMesh/SubdividedPlaneMesh.cs(202,39): warning CS0169: The field ‘SubdividedPlaneMesh.heightmap’ is never used [PATH/XenkoByteSized-master/XenkoByteSized/XenkoByteSized.csproj]

Is the assembly processor suppose to be building the assets? Sorry I know I have no idea what I’m talking about but I’m just at my wits end so yeah…please someone help :confused:

Hi Spike,

I think you’d be best off opening an issue at the github, because being a technica and code issue, the developers are more likely to see and respond to it there.

yy

As far as i know it’s actually not possible to build only on linux right now (you need a windows machine to build from, together with a linux one), Xenko has a few dependencies that are windows only as part of the build process (related to asset compilation afaik), you may want to drop into the discord and ask or search through the GitHub issues (as I’m certain this has come up at least once before).

That’s why he’s asking about a “code-only” sample, with no assets.

Thanks both of you :slight_smile: . Yeah it seems like the build pipeline is more complex than I thought. I managed to get the Assembly Processor working via Wine but the Asset Compiler App doesn’t seem to work right under Wine, dotnet core, nor Mono - at least not immediately. I might have a look at what it would take to work under Linux later on.

As an offshoot though, it would be interesting to see a code only demo that sets up various things normally done automatically through the assets. It’d be really helpful to see a proper scene with a few entities, a render pipeline and graphics compositor, etc, all set up with code; I imagine that is possible to build entirely on Linux and would be a good starting point for projects without using the asset system.

I don’t know anywhere near enough about Xenko yet to try putting something like that together, but yeah just tossing the idea out. I might bring it up on the Git Hub page too.

Great, and the discord discussions can be found here