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.