Puzzle or Adventure condition monitoring / handling?

Need info for something like either an Adventure or Puzzle game where there are certain conditions to be met in order to trigger something. Specifically, handling the monitoring of changes / steps?

What I’m thinking about is …
For example, if I were to create a class that contains the rule and then any coupled objects have a link to communicate to that rule when needed.

Also, a class for each rule put into any level, so I don’t have one huge class.

Just want to know any general practice for this topic.

The way I’m currently planning my puzzles is having variables stored in GameInstance and each actor of a puzzle update / check with getters and setters the current status of the puzzle.

So for example if a player has to kill X amount or trigger X number of actors to open a locked door: each trigger or killed actor informs GameInstance and updates a variable. When the player goes to the locked door to interact, the locked door checks that variable in GameInstance and does X depending if conditions have been met.

This allows me to:

  • Have more than one actor check conditions: So lets say I want a locked door to open and / or a story event to trigger, neither are related and both are on separate levels, they both can check same place and update.
  • Actors of same puzzle do not have to be on same level or even communiate between them.
  • Easier to work with when saving / loading. This implies that actors that need to update states on load have to check GameInstance and update accordingly; these actors do that on BeginPlay for load logic on every spawn (be it new game or level change).
  • Save myself the trouble of having to keep track of a class for every puzzle.
  • Easy to modify and iterate.
  • Most if not all communications is between individual actors and GameInstance, reducing number of casts, additional includes or even numerous interfaces.

Would be awesome to read feedback of others.

1 Like

Doesn’t look like anyone is going to. :frowning:

Feel free to post an example of your current implementation.

Personally haven’t decided anything yet.