My next big task in the Event Manager is to build support for multiple Event Types. This means that the way I measure win and lose conditions may be different.
I am trying to learn more and practice better programming principles. This project is pretty simple so even if I do things like the beginner I am, it still isn’t too much trouble to get things working. But I have began to see some problems that I think you might define as “tight coupling”, so I am reading about SOLID programming principles and trying to do a little better job about keeping my code such that if I need to change say, some widget or a control point actor, it should not break anything in my event manager or player character, as an example.
The Career mode will play out over five weeks in game. Each week there is a number of daily events you can choose to do. There is three types of Events: Score Attack, Follow Route, and Way Finder.
So, what needs to change based on the event type?
A couple bits of information we display to the player and also how the event is measured to be won or failed.
I’ll try to put the The Single Responsibility Principle (SOLID principles) to good use here and also try to ensure that I am not duplicating a lot of functionality since much of the way different events types work will be similar.
The basic idea I have in mind is that, when anything noteworthy happens, the involved actors simply shout out with an Event Dispatcher, “I did a thing!” and then the Event Manager is watching. This manager either records some data, or he might relay what he has heard to others if necessary. With this basic idea as a guiding principle, I hope to make it so that all gameplay actors can just do what they do normally, independent from the Event Type, and only that Event Manager cares what the game rules are. With a simple Eventy Type switch, he can take the information gameplay actors are notifying him about and process it however he needs.
For instance, if player collides with a CP, the CP will send an Event Dispatch out to say, “The player has collided with me!”
The Event Manager will hear that and then ask, “okay, is this CP who is reporting collision one of our objectives?” And then, based on the Event Type, he may have further questions to ask, like, “How many points is that CP worth?”
What questions the Event Manager ask about some happenings going on is just switched on based on the event type.
I think that is the simplest way I can envision all of this working. I am not a good abstract thinker so I like to sketch things out in Scapple:
(note about Scapple: it’s a great mindmapper software because it is dead simple to use. But I think with just a tiny bit of extra functionality, this could all be done with blueprints. I made a feature request thread about this, but just in case anybody who has the chops for it reads this, I think extending blueprint comment notes so that you could format text to create notes like you see here would be a fantastic plugin. This way, you can easily sketch out your logic flow in a very quick way right in blueprint graphs, then you have a nice “paint by the numbers” experience, so to speak without having to do any alt+tabbing or extra reaching with the mouse.)
This helps me a lot with planning.
Well, over next couple days I’ll work on implementing and testing this out.