How do I combine Lyra & The Matrix City Sample?

It’s not a video, but here are the steps I took to get Lyra + City Sample working. I’m not sure if all of these steps are actually required.

  • Assume you have projects called CitySample and LyraStarterGame created
  • Copy CitySample\Content to LyraStarterGame\Content, skipping duplicates
    • I made note of the duplicates and copied them to LyraStarterGame\Content\CitySampleContent
  • Copy CitySample\Source to LyraStarterGame\Source
  • Copy CitySample\Plugins to LyraStarterGame\Plugins
  • Move “InputCore” from PrivateDependencyModuleNames to PublicDependencyModuleNames in LyraStarterGame\Source\LyraGame\LyraGame.Build.cs
  • Update LyraStarterGame.uproject to merge Plugins and Modules from CitySample.uproject
    • If you don’t want to do this yourself, replace LyraStarteGame.uproject with this file:
      LyraStarterGame.uproject (7.6 KB)
  • In File Explorer, right click LyraStarterGame.uproject > Generate Visual Studio project files
  • Open and build the generated Visual Studio solution
  • Open the Lyra project in UE5
  • Open Big_City_LVL.umap or Small_City_LVL.umap under Map folder
  • In Content/Vehicle/Blueprint/BP_VehicleBase_Drivable.uasset I had some compilation errors. To fix, I clicked on link to node in the error message and right clicked the node > Refresh Nodes, then compile and save
  • There will be a lot of warnings like the following which I just ignored for now:
    • LogGameplayTags: Warning: [AssetLog] D:\UE5\LyraStarterGame\Content\UI\Blueprints\OptionsMenu\BP_CitySampleOptions_World.uasset: Invalid GameplayTag Soundscape.Mass.Crowds found in object K2Node_CallFunction_18.
  • At this point if you try to play in editor, it will crash with the error below. The back trace includes UnrealEditor_MassEntity so that gave me the idea to just delete all items related to the MassEntity framework from the map. I list them below.
    • Assertion failed: PerInstanceSMCustomData.Num() == (NumCustomDataFloats * PerInstanceSMData.Num()) [File:D:\build++UE5\Sync\Engine\Source\Runtime\Engine\Private\InstancedStaticMesh.cpp] [Line: 3652]
    • Items to delete:
      • BP_MassCrowdSpawner
      • BP_MassTrafficIntersectionSpawner
      • BP_MassTrafficParkedVehicleSpawner
      • BP_MassTrafficTrailerSpawner
      • BP_MassTrafficVehicleSpawner
      • MassDebugVisualizer
      • MassVisualizer
      • MassVisualizer1
  • In World Settings
    • Change Default Gameplay Experience to B_ShooterGame_Elimination
    • Change GameMode Override to None
  • The remaining steps are outlined in this video from Epic on how to create a new map for Lyra, but the summary is:
    • Add LyraPlayerStart items to the map
    • If you want Bots:
      • Add a NavMeshBoundsVolume (for AI to move around the level)
      • In Editor Preferences > Lyra Developer Settings, make sure Override Num Player Bots to Spawn is either not checked or greater than 0

Note there’s a bunch of other warnings and validation failures you’ll get during development and play which don’t seem to break the game. If I have time I’ll try to fix those and report back.

11 Likes