1. Introduction
This plugins allows to keep tracks of time for different timeline paradigm(1), attached events(2) to them and managed serialization for Save and Load game.
1 Real life time, Game life and Level life
2 Light blueprint asset carrying data and/or simple functionalities you design
2. Usages
I use this for different purposes.
First I created this to manage a bonus/malus system cause I needed to centralized their life duration.
Then I realized that it can be very helpful for different purposes in my game as creating promotional content, bonus/malus, temporary skills, XP earning factors, ... with a limited time and having precise stats for player activities.
3. Definitions
3.1. Timeline
A timeline is a simple queue of events which is dedicated to store (to keep traces for stats) and notify them (depending on their parameters and timeline paradigm) on their lifetime events: start & time increase.
As a client, you should never have to use it.
3.2. Timeline manager
Is working as a remote control for Timeline, it controls time state (Play, Pause) and stream (tick interval, slow motion, ...).
As a client, it is your main interface.
3.3. Timeline manager types
3.3.1. - Real Life
The intent of the Real Life timeline is to track times since the first start of the game.
It is not affected by time alterations such as play/pause and slow motion.
After the game stops, it should replay all the missing time on game reloading to update attached Events states.
As real life is, its state is always Play.
Be careful when you attached events, it could increase memory if they have indeterminate life time.
3.3.2. - Game Life
It keeps track of player game session. It follows the same stream, Play/Pause, Stop, slow motion, ...
After the game stops, it should restart at the exact same time as the last session.
Be careful too when you attached event here.
3.3.3. - Level Life
The same as Game Life but it is reinitialized when level changes.
You can be less worried on attaching event here, but be aware that all events are definitively removed on reinitialization (level changes).
3.3.4. - And ...
You can easily create your own timeline manager. See Developers docs.
3.4. Event
It is intended to be the most extensible as possible.
So in its actual state, it is just a base UObject which embeds the necessary data to managed its lifetime.
You can specialized it with a dedicated Blueprint asset or in c++ classes (creating a Decorator of the UNEventBase) to do what your want.
To get some examples:
- I create a scheduled event to trigger a message to motivate the player when it cumulates an amount of succeeded actions during a determinate range of time.
- In combination with my Factors Factory System and Interaction System, I used them to create a temporary Bonus/Malus factor after an Actor interaction.
- ... Sky's the limit!
4. Getting started - a step by step guide
To maintain a short doc here, please read this page here
5. Open Source
This plugins is open source (license apache2) and can be downloaded here
https://github.com/NansPellicari/UE4-TimelineSystem