(New) Non-Linear Event Handling System

How to implement a Non-Linear Event Driven System which can still be scripted, but remains non-linear. This is not the random missions that were implemented in Daggerfall, but this is a more solid and defined system than I have yet discovered.

(New) The Tree View

Here is a basic definition of the NLEä in a step by step manner. First off we will have a look at a simple event link. What we are dealing with here are EVENTS, TRIGGERS, and PREREQUISITES. Basically, the TRIGGER is what happens in your game world to cause an EVENT. A TRIGGER is attached to an EVENT, but we will get to that later. PREREQUISITE EVENTS work like this. An event will only be TRIGGERED if the PREREQUISITE EVENT(s) of that EVENT have already been TRIGGERED.


Event2 has a PREREQUISITE Event1 that MUST have already been TRIGGERED for Event2 to be TRIGGERED.

Now that we have defined how a simple PREREQUISITE works, we need to look at multiple PREREQUISITES. Multiple PREREQUISITES work in the same way that single ones do, only the prerequisite links must ALL have been TRIGGERED before a secondary event can be TRIGGERED.


Here, Event3 will only be TRIGGERED if Event1 and Event2 have BOTH been TRIGGERED.

That is the simple look at PREREQUISITE LINKs done now. Let us now move on to some more complicated examples. The simple case basically covers every link combination with the CONDITIONAL COMPARISON of 'AND'. If we want more complexity, and therefore more option, then we are going to need to include some more choice in how the EVENTS can be TRIGGERED and what causes what to TRIGGER and when.


Here, Event4 will only be TRIGGERED if Event1, Event2, and Event3 have ALL been TRIGGERED.

The example image works almost identically to that in the previous image, except that it takes three EVENTS to determine the fourth. The CONDITIONAL 'AND' could have been left out and the three PREREQUISITE LINKs could have just entered Event4 for the same result. The reason why we add in the CONDITIONAL? Because it allows you the added flexibility to do things like this...


Here, Event4 will only be TRIGGERED if EITHER Event1, Event2, or Event3 have been TRIGGERED.

Using BASIC LOGIC we can come up with certain CONDITIONAL statements to COMPARE the EVENT TRIGGERS. In the previous example, we can use the 'OR' CONDITIONAL statement to TRIGGER Event4 if any of Event1, Event2, or Event3 had been TRIGGERED. Similarly, we could have used any one of 'AND', 'OR', 'XOR', 'NOT', 'NAND', 'NOR' etc. to CONDITIONALLY MODIFY our EVENT. The 'OR' statement is used to create GROUPs that allow for easier Diagram Flow. Next, we move on to grouping.


E1&2 is a group that is defined as the combination of Event1 AND Event2. E1&2 is then CONDITIONALLY COMPARED to Event3 with the XOR statement. Event4 will only be TRIGGERED if E1&2 is TRUE or Event3 is TRUE, but NOT BOTH.

This shows the ability to GROUP EVENTS so as to make it easier to follow the flow. So now we must have come to the CASCADING PREREQUISITES.


An example of a CASCADING PREREQUISITE Flow Diagram.

The above diagram shows a little more clearly the need for GROUPS. Group1 XOR Event3 is the first CONDITIONAL COMPARISON in the diagram. What if there was no GROUP? Event1 XOR Event2 XOR Event3 would mean that if Event1 happened, then Event2 and Event3 can't have happened for Event4 to TRIGGER. The group enables Event1 AND Event2 to have TRIGGERED but NOT Event3 or Event3 to have TRIGGERED but NOT Event1 and NOT Event2. The CASCADING PREREQUISITE works a bit like a linear story. You must have passed on page, before you continue to the next. The story occurs in order, and so does the CASCADING PREREQUISITE FLOW. Take note that Event3 appears twice on this tree. This is just to show as an example of using multiple instances of a PREREQUISITE for different EVENTS. It is because of this reason that the only real way I can see of implementing this system is with the use of a complex Linked List DataBase.

So now you are saying, "Hang on. Didn't you say that this was Non-Linear?" and I answer "Yes". The reason it is non-linear is because you may have any number of seperate FLOWS that are independant of each other. These FLOWS could happen in any order that they wished. This is all dependant on the TRIGGER and how it is defined. So far I have only mentioned the TRIGGER as being something that is used to attach an EVENT with something else. A TRIGGER can be an EVENT in itself, but works along these lines. A TRIGGER may be a location, a time, a player, a non-player, an EVENT, or a combination of those mentioned. For example, a TRIGGER might be when a player enters a room (player and location TRIGGER) or may be when an EVENT occurs at night (EVENT and time TRIGGER, which is almost a PREREQUISITE in itself with EVENT and TIME being the two EVENTS) or it might just be a time.

This system allows for many EVENTS to be occuring at different intervals which can basically be structured stories in themselves which allow for non-linearity to be implemented into a game, without leaving the game world inconsistent. The need for PREREQUISITE EVENTS in the system is to ensure that the world is CONSISTENT while being non-linear. I believe that this is the first step that needs to be taken for games to have interesting non-linearity about them.

One thing that I have missed out on at the moment is the definition of an EVENT. I will state what you can make an EVENT do, and how you might go about it. This includes RESETING the STATUS of an EVENT TRIGGER, but setting the EVENT back to an 'UNTRIGGERED' state.

(New) Advancement of the idea to a NLE Web

The expansion of the idea of the Non-Linear Event Tree is to make a Non-Linear Event WEB. What is the difference between a tree and a web? Well, the tree basically converges until it eventually reaches a conclusion, or it diverges until it finalises as a numerous amount of events. The web works on a combination of the converging and diverging. The web allows for a number of events to converge into one, or one event to diverge into many. This complexity is coupled with the difficulty of programming, but with some clever dynamic pointer arrays the results are quite positive.

(New) Implementing the actual system

Wait until I have a bit of code written up that allows you to branch through the event tree and allows you to set prerequisite EVENTS and conditionals. I have done some, but it only allows for creating new events, and linking them. It basically combines EVENTS, GROUPS and CONDITIONALS into one nice linked list. Both a simple linked list keeps all of the data accessible while the web is stored between the events as dynamic pointer arrays to and from instances of other events. When I have a working model I will upload it here as a story generator, or an event scriptor that will allow people to use it in their games if they wish.