Implement quest data object

Hello,

i’m just get my first experience with game developing and have a problem to implement quests.

I have a AI Object and want to give him a “quest” object. This Object should be only a data object, where i can store the quest text, some additional information and an array with “Target Options” ( Go there, kill kind of this or what else ).

But i have no idea how to create this data object. Should i use a blueprint for this?

A blueprint yes

Youll mostly likely want a struct aka a structure. A struct is like a box for varaibles that can hold any amount of any kind of variables (aka any kind of data)

But. Your talking about AI and that makes things much, much more complicated.

Have you watched all the mega-popular AI tutorials by peterLNewton and TeslaDev first? That will be a pre-requsite 10000000%

This is not an easy ahem quest, to set out on but definitly do-able.

Hope this helps

Don’t forget to accept an answer that best clears your question up or answers it so when the community finds your question in the future via search/google they know exactly what you did to fix it/get it going.

What I’d do im a little fuzzy on your experiance level…

Create a blueprint of class actor
Create a struct with variables like this

  • String “questName”
  • int “levelRequired”
  • texture2d “questImage”
  • string “questDiscription”

Then add that struct as a public variable onto the BP_questBase or whatever you named it.

Then I might add a collission box to the BP_questBase and onBeginOverlap(Box) → Create Widget(some widget that will get the proper quest and display its discription, picture, and name on it) → add questName to an array of strings in your player controller using a getPlayerContrller(yourPlayerController) cast.

Now you can right click on BP_questBase and create children classes that inherit from it that can all have the struct filled out and have their own details such as “branch(coinsPickedUp = 5) → set boolean(IsQuestComplete) = true”

To have AI complete quests… I could spend days going into ways to do it but states and changing their states depending on quest data will be the key. and it. wont. be. easy. at. all.

Thanks for your answer.

Firs thanks for the lot of infos about AI, there are a lot of interesing informations. A little bit experience with AI have too. Yesterday a write my first Patrol-AI with PlayerChasing. With a Behavior Tree it’s very easy i think :slight_smile:

A Struct it’s almost thats what i’m searching for. I can add all my data, an select this structure in my AI as variable. But one thing i’m missing: I can’t create a template for structs. I can’t extend the Basic Struct and build the unique “quest” structs!

In my mind a want to do the fallowing:

I’ve created a Basic AI with the basic logic for all my AI’s, Patrol-System, Player Chasing etc. All Funcions with an option in Details, so can i edit every unique AI. The next i want to do ist, create an Object for quests. So i think i create my basic template struct and select all my needed variables. This Template i name BasicQuestStruct. So now i create my first quest. I give it an number and fill the variables, i’ve definied in my template. Know i select my unique AI and add in my Array for BasicQuestStructs’s my Q1.

Do i think in the wrong direction?