I don't have a concrete example, but an abstract one.
Let's say we have 3 lines of code. Line 1 and 2 are used by other events, and line 2 and 3 are also used by other events. Do we need 3 common events with each one containing 1 line of code?
If you're about to say: "No, no CE for just 1 line!", then how about we have 20 lines, with lines 1-15 being used elsewhere and 5-20 being used on different occassions. Do we need to split it into 1-5, 5-15 and 15-20?
Again, I'm just pointing out that you run into some problems (where there might not even be a definite solution to). And that in addition to deleting instances later on (making the usage of a CE redundant) or splitting everything up until you can't work with it properly anymore. It's just very vague often times, and you need to decide on each occasion what to do. I understand that, of course. 😉 But how do YOU deal with these inconsistencies and this vagueness?
There is nothing inherently wrong with having common events containing one event command. In general the amount of lines is a bad metric that can easily lead you astray and lose focus of what’s important. For your 3 line example. Well… it can be 0, 1, 2, 3, 4, 5 or whatever number of common events that is preferable. In general I cannot know.
Instead try to think of the event code in logical units. Are there parts that more naturally fits cohere. Groups of cohesive units that are sorta distinct from each other are in my experience good candidates for extractions.
There are also elements of how you want to express the functionality. This can help guide you towards a design which by itself tell a lot of what you want with the code. What your intension is.Of course sometimes it is just more convenient to create that common event or merge those two.
Should a common event become redundant, why then I would remove it. I have done so many times and I consider it a natural part of cleanup.
So to summarize this incomplete list:
- Proper cohesion
- Right abstraction levels
- Convenience
Try not to over focus on the common events. There are more aspect when constructing events.
Archeia has been nice to give us a concrete example where the Nova skill will trigger 3 times every 4 turns.
My first advice to her would be to change the structure of the events to a more flat version and loosing up the conditional branches:
Changing the conditionals from == to >= does not change the amount of force actions when both variables are 0 and 0 initially. If for some reason the Nova counter starts as say 5, well… What happens in the == case and what happens in the >= case? Similarly, what happens if the Turn counter is say 5 or 7 when the Nova counter is 0?
Most of the time building robustness into your events isn’t too difficult although it does require you to be aware and think about it.
Another thing I am sure you have noticed by now. The nova execution code is a candidate for a common event. The biggest indicator is that the nova skill is inherent to the actor, not it does not appear to be specific to the given battle. As such I will recommend creating a common event with logic and call that from the battle event.
If the skill is specific to the given battle then that dependency is better expressed by keeping the logic in the battle event. There is a convenience aspect so you may still decide to extract the logic to a common event. Of course, the special circumstances should then be document.
Note that the robustness changes are far more important in this case than discussions evolving around where to place the various logic.
*hugs*