Random quest system

Hello everyone,

I am trying to figure out a way to create many events (100+) and to be able to randomly choose one for example every 10 seconds based on multiple criteria.

It would be nice with a solution to either have an array of functions or be able to do x function based on a value instead of creating a Switch on INT and create a list of 100’s of pins.

I am sure someone knows a smarter way to do it :smiley:

Random quest system

Are your quests functions / events? How would that work? Could you provide an example of what calling a quest function would trigger? Just trying to wrap my mind around it.

If I were to make a random quest system, I’d make quests Actor Components (with inheritance) and an Interface. Drop all into an array, and pick one at random. Use the Interface to talk to the quest.

Thanks alot, this approach should work for what I was thinking. Most likely easier to structure as well.

Planning to make it so each event/quest will be able to do unique things each. Event caller is just a script that checks if some values are compared correctly and executes a string, nothing advanced there yet.

A system like this would require the quest itself to run some logic, surely? So I’d start by encapsulating a quest in a standalone actor + inheritance (going to deviate from the above-mentioned actor components for now):


And then keep the lot in an array (of soft class references) and retrieve what’s needed. You could even use Child Actor Components to keep track of the active quests to keep things tidier (lets say the player can have 5 at a time max).

The player can talk to the quest (and back) through an interface.

Also, a Delay is something I’d avoid. A Timer counts the time and comes with a heap of additional features.

Definitely consider it then. Having a quest actor that has its own timer, timelines, component, widgets, variables will allow you to keep most of the logic in said actor rather than burden the player blueprint with the nuances it does not need to know.

This way you can also have the shared logic in the quest parent and unique logic in the children only.

Good luck!