Lyra uses the same default pawn class to spawn bots and players. As an example I’m using the eliminaton mode and within the HeroData_ShooterGame I can change the pawn class from B_Hero_ShooterMannequin to any other class. Wich changes both player and bots. But what if I only wanted the bots to be a different pawn with different abilities, etc? I can’t wrap my head about it and I’ve been looking for days now. What if I wanted to have multiple bot “races” and spawn a different pawn and abilities based on what that race is? What would be the approach to do something like that following Lyra’s pattern?
This kind of modification takes a team to do, so it would be better to try something more specific. Like finding a ready-made project like the Advanced Vehicle System that was free from Epic, and asking them if they have any plans to implement the project in the Lyra project.
by “race” I meant like human race, elf race, etc. not like racing cars, sorry for the confusion
Next week I’ll do a tutorial on how to modify and place 2 types of AI with different weapons and different movement speeds. If it gets too big I’ll post it on github, because I don’t know how to make videos.
The Pawns are constructed using Pawn Data assets. Currently there is only 1 Pawn Data asset, but you can change that however you want.
Just search the C++ for places where it is used and see how it works. If you aren’t good with C++ then this is probably out of reach without building your own pawn spawn/init system.
Lyra 5.1 includes some changes to the pawn initialization system. See the Pawn Extension Component to see how it works. If you’re still working in Lyra 5.0, I recommend waiting to do this part of the project until after Lyra 5.1 releases, to save yourself some time.
Where do I find the Lyra version nummer ? asking for a friend.
If you’re installing Lyra from the Launcher, it’s Lyra 5.0.2. There is no way for you to know except to know that they haven’t updated Lyra since Engine 5.0.2.
Hopefully after 5.1 drops, you will see an update available for Lyra in the Launcher, and then that one will be version 5.1. Fingers crossed.
Knowing that there will be an update on Lyra, I’ll wait to see those changes.
However by using components and creating children from the AI files that already exist, I was able to create an AI that patrols a region, if an enemy enters it attacks. I changed max health, weapons, movement speed and various attributes without having to create a new CharacterComponent.
I think I should have a specific DataAsset to edit the AI’s, because the way I’m making the LyraExperienceDefinition file is getting too big and confusing to edit.
I only see the need to create new Pawns if it’s to add vehicles, static weapons like a miss launcher and things like that. It should have a specific DataAsset to manage a wide variety of equipment and vehicles, and remember to assign life to them, because cars destroy themselves like players
Lyra uses B_PickRandomCharacter (component) to pick randomly between Manny or Quinn. I have it set that everyone uses another model.
At the moment I’m looking for how to check if it’s a bot or a player. If it’s a bot use Manny or Quinn, if player use other model.
So depending how you want it to work, you could pick a random “race” here… depending on which one, you can give or clear abilities: Get Lyra Ability System Component > Give Ability. I’m assuming those nodes would be the nodes for that, and that they would work here or in your own pawn class.
Hi there,
Considering B_PickRandomCharacter is a controller component, add a node:
Get Owner > Cast to Lyra Player Controller If true is a player, else is a bot.
In case you are interested, there’s a very long thread covering this topic, including replication setup and giving abilities in run-time (Character Selection - Lyra Starter Game)
Hope that helps.
Ah I ended up doing almost the same thing
Get Owner, Get Class == Lyra Player Controller
I am interested. Thanks!
Hey I would Like to add to this Also as I just started trying to understand Lyra for my next project.
I want to find how the Bots are Identifying the player and the TargetEnemy that I found in there BT As I also want to add a custom Player character and make the bots react to it the same way as they are acting towards the default player pawn. so also very similar to wanting separate Bot and player characters.
Hi there,
I’m new in C++, so I don’t know if it is the correct way, but I could do it duplicating the pawnDataAsset, and on spawning checking if the pawn’s controller is LyraPlayerController or LyraPlayerBOTController.
in LyraExperienceDefinition.h
B_ShooterBotSpawner spawns a bot and GetPawnDataForController gets called several times in LyraGameMode.cpp.
It first gets a null controller and sets the default pawn.
Then it gets called again, and I cast the controller to PlayerBotController and assign the new pawn.
Hope it helps