Say you’re making a game that is basically a series of random events.
Example Event 1:
Show prompt with two options.
Take player response from one of two buttons.
Based on the response the player is given some supplies.
Event ends.
Example Event 2:
Random party member is damaged.
Message tells player about the damage.
Player is given a choice to wait for party member to heal or continue on.
Player chooses to wait.
Resources removed from inventory.
Example Event 3:
Player is told that one party member has learned a new skill.
Player is given the choice to encourage or discourage the skill.
Player chooses to encourage.
Event goes into remission for x turns.
Event comes up again after x turns.
The skill has come in handy in some way and the party is happier for it.
Party stats up.
All very different events, but how to script an event system that can handle so many different variable types and outcomes.
The first method I’ve tried and have taken pretty far is to create a base event class and just make child classes off of that. Each one does different things and allows for great customization. The problem I’m running into with this method, though, is that while I can try to keep things broadly the same as much as possible so my class count doesn’t blow up, I find that any time I want to make a little tweak I run the risk of either changing how a bunch of existing events work or just needing a new class, adding to the already growing pile.
The second method I’ve looked into but have not taken nearly as far is to create a node - based system. Each node would store some info and possibly a function to perform much like Kismet in Unreal.
Each solution has pros and cons. I lean towards the first only because it does allow me to have a lot more control, but the downfall is that it also limits the other developers because every time they need a tweak to how the event works they either need to come to me or limit how they want to make their event play out.
So what are your thoughts? Which would you prefer creating if you were in my shoes or which would you prefer to use if you were in the content creator’s shoes? Can you think of another option that trumps these two entirely?