I’ve been working on a modular event system for our photography game for the last few weeks. The whole thing is broken into a few components:
Event:
The event as a whole. Has references to the trigger, actions, and conditions, as well as some parameters to modify how the event plays out.
ie: reversable, simultaneous, loopable
Triggers:
A physical node in the scene that fires a signal for the event.
ie: an area, a timer, an interactable
Actions:
One or more resources that execute sequentially or simultaneously once the trigger fires.
ie: move a target, play an animation, change camera
Conditions:
One or more resources that must be true for the actions to execute.
ie: player state, time of day, has key
All the components are put together in the…
I’ve been working on a modular event system for our photography game for the last few weeks. The whole thing is broken into a few components:
Event:
The event as a whole. Has references to the trigger, actions, and conditions, as well as some parameters to modify how the event plays out.
ie: reversable, simultaneous, loopable
Triggers:
A physical node in the scene that fires a signal for the event.
ie: an area, a timer, an interactable
Actions:
One or more resources that execute sequentially or simultaneously once the trigger fires.
ie: move a target, play an animation, change camera
Conditions:
One or more resources that must be true for the actions to execute.
ie: player state, time of day, has key
All the components are put together in the editor, so once you have the components programmed out it’s a breeze to set up new events. Because of the simplicity of the system, making new components is very as well, with each one being just a few lines of code. I don’t think performance would be much of an issue, but I also made the conscious decision to make actions and conditions resources so that the scene doesn’t get bogged down with too many nodes.
There isn’t going to be a ton more interactions for our game so what I’ve got here works great. I’ve also played around with using it for our wild animals AI, replicating a sort of behavior tree pattern.
Anyways, I’ve thrown together a quick demo video! Please let me know what you think, and feel free to ask questions if you want to know more.