Devblog #6 - Node system
As mentioned in devblog 4, let's talk about the node system !
As you may have guessed it, nodes are a vital pieces of the puzzle.
We need to get it right and we especially want to avoid a complete rework of the system (even though it could happen in the future).
This devblog might be a bit technical, we'll cover some code, sorry !
After some thoughts on the subject, that's what we came up out of it :
- Every node is a scene (an independent part with it's own properties).
- Every node scene inherits from a base script 'GameEffect' that contains several methods of application.
- Each node has a special implementation that derives from the 'GameEffect' parent which implements it's own behaviour.
- The character and each enemy hold a list of GameEffects (which can be ANY node since each node derives from the GameEffect class) filled at the start or when he acquires a new skill.
- With the help of the different methods of applications, the player and enemy scripts both know when, where and how to apply the effect.
We ensured that we have a stable & modular system that allow us to create as many node as we want while keeping an easy way to create and manage multiple nodes at the same time.
This system was created to avoid what we call the 'spaghetti code' phenomenon (Source code that goes in every directions without much consistency).
Here, every game effect is handled within it's own script and we don't have to handle every each effect in the same place.
You might not see the benefit right away, but it's very important to keep things clean and organized, it can go sideway very easily.
The next questions we'll have to answer with this system is how to handle conflicts with multiple similar nodes (what if we have a node that fire 3 bullets horizontally and a node that transform your shots in a single laser beam ?)
This kind of systems are bound to evolve as we progress in the development and discover new flaws or improvements but we are confident in the current way we handle nodes.
That sums up what I had to say today, I hope I wasn't too boring with the technical side of things.
See you next week !