How do I combine Lyra & The Matrix City Sample?

Hi All,
I recently setup the lyra starter game and the matrix city sample projects individually, but I would like to be able to combine the 2 somehow so that I can use the matrix city map with lyra. I know it’s doable because someone has already made a video of doing it (the result not the process) Unreal Engine 5 Matrix City Lyra bots Multiplayer test with Day/Night Cycle - YouTube but the method for actually setting this up is not immediately obvious to me and I can’t quite seem to work it out. I did try copying the files from the city sample to the lyra project content folder as one of the YouTube comments suggested, but that did not work as I couldn’t load any of the city maps properly. I tried the migration option as well but no dice. What is the actual official process for us to merge 2 projects together? A step by step tutorial for this would be awesome. Also wondering why asset packs only have the option to either create a project off it or add to an existing one? Why don’t all assets have both, why can’t I add ‘create new project’ assets to an existing project and why cant I create a project containing only a ‘add to project’ asset (in the one step)? That being said I am mainly interested in the former in my case. Thanks :slight_smile:

4 Likes

I don’t have an answer here but I’m curious about this too. I might give it a stab soon and will report back if I figure it out. BTW the YouTube video you linked doesn’t work, but I found another: 99 Bots in LYRA Matrix Hybrid UE5 Demo - YouTube

1 Like

I too am looking for it desparately! Please share any video tutorial if you people come across it

1 Like

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

@Leroyyyy231 Thank you for Steps and Project File. I desire to retain Mass Crowd & Traffic so Ill post an amendment when I get them to work.

The goal is to randomly possess any Pedestrian, transforming them into a Lyra Bot Combatant when the player is near, similar to how the Agents possessed Citizens in the Matrix Resurrections. The Player will have Super Hero Powers like Neo in a n-vs-1 combat mode for my super hero demo, DEITY.

2 Likes

After a couple of weeks of struggle, i failed to get LYRA and MATRIX City to play nice together :frowning: However, with Leroyyyy231’s Tutorial above, I was able to load up Big_City Level using LYRA Experience, but no Crowd or Vehicles. So I’m refactoring the Super Hero Demo to omit LYRA Framework and move forward.

3 Likes

Hi there, good luck in your project.

1 Like

If anyone is still interested in whether it is possible? Yes, it can be done. I am currently working on a framework based on the best practices from LyraStarterGame, CitySample and Valley of The Ancient.

3 Likes

i was using City and Lyra but decided to move to ue5main and keep updating Lyra from githuib too with latest fixes. Managed to get cars working but not crowd so not that much bothered be honest

good luck with your project

1 Like

Looking really Awesome G-TOX. But its difficulty to integrate together has suppressed my interest. I use UE intensively and many different assets from various developers. I found the Lyra & City Sample the most difficult to integrate together. I’m not sure why this is so as merging the two awesome projects together would be an obvious consideration.

2 Likes

I combined Lyra with City Sample for 5.3 also CitySample modules converted to plugins. You can now package game just fine. Instructions in Readme

for UE 5.3

Any questions, just ask

7 Likes

Combined Lyra and City Sample for UE 5.4. Just follow instructions in readme file

for UE5.4

4 Likes

Nanite test enabled on vehicles and Crowd in 5.5 (ue5main branch) combined City and Lyra

1 Like

Hi there,
How did you fix the HLOD issue in the packaged build?
Thank you for sharing this project.

If i remember i think i changed it in WorldSettings, let me check and confirm

Thank you for taking the time, I deleted and rebuilt HLOD but it didn’t work. I recall someone mentioned in this forum, but I can’t find the thread.

1 Like

Ok try this, check which HLOD you have in worldsettings

Then open that file and disable Is Spatially Loaded and test

Much appreciated. I’ll give a try later tonight and let you know if that works.

2 Likes

something is still missing in the HLOD settings. Any advice?

This is how i have it. WorldSettings set HLOD to CitySample_HLOD0

CitySample_HLOD0 compared with orig CitySample

Project settings HLOD settings compared with orig CitySample

Im sure we will sort this out, could you please check these and test?

1 Like