Event Manager Prototype - in design

Freeform discussion about anything related to modding Transcendence.
Post Reply
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

I have created the inner workings of a global event timer, a simple and generic method that anyone can attach timer events to- from anything, and I plan on making the events mod-able from the event invoker and most other features will be easy to config for your own uses. This mod will perform global active and passive event management, and you can key into it for a variety of unique mod features

My prototype used the calendar update code, but over rides the calendar update and makes it a passive update, only called when the actual date is meant to be displayed. I rmade an event list in the initialization routine that sets the calendar and it fires a message off every ### amount of ticks (game hours) where-ever I am, and keeps consistent enough from system to system.

If I wanted I could have an organic weapon that grew more powerful over time.

If I wanted I could have a time delay trap effect.. or even worse, tribbles! that bred insane amounts until cargo was stuffed.

Rather than running all that code to generate an active real time date every hour (120 ticks) as the calendar was set up, I now simply increment the ticker and check the eventList for any timestamps that are equal to the ticker. If an event is found, it gets performed right there during the update.

I can add an event to the event list with script from anywhere, and it can perform an active or passive function. Messages are running- for instance, I can have Eridani station set a message to occur for hours down the road- even if I am fighting Dwarg at the time. :)

This post is to introduce the idea to you all, and to see if anyone has some ideas on what types of things to do with a global event manager. i am a little while from releasing a playable version, but have the core created.

This method can adjust trade or fuel prices over time, it can evolve items, it can set revenge counters and summon enemies, traps, tricks or any assortment of interesting effects can be created. It can call an OnFireEvent to call any other event in the game, and be set by an easy method of passing the delay in with optional additional parameters.

In essence, this counter can run any concept that requires a 4 second delay or more. It is consistent system to system, and can therefore be used to promote missions and other more complex situations.

Let me know what features you would like included, or what you might like to see this concept do.
F50
Fleet Officer
Fleet Officer
Posts: 1004
Joined: Sat Mar 11, 2006 5:25 pm

Just make it obvious where to put your own events!

Excellent work Periculi!

Just to be mean, what if you want a delay that is not a multiple of four seconds?
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Just to be mean, what if you want a delay that is not a multiple of four seconds?
Then it is beyond the current scope of this mod.

The 4 second delay (120 ticks) is from the timing I set up for the calendar- I wanted to use a larger time between updates, rather than running the scripts more often (like every 30 ticks as 1 second). This is a utility to pass calendar based global data around, not for micro managing ship and environ effects. Hopefully it won't get too cpu intensive.

As this is designed more for events that don't really require either fine tuned time increments or real time updates it is a decent amount of time to use as a 1 hour marker, I felt.

My thoughts on using this mod are more for concepts such as a News Network/Mission Manager, or for minor delay effects like traps and growing or evolving items and also possibly for a good base for a dynamic trade system.

The active cycle will mainly be concerned with keeping time and sending messages- the real meat of the event manager script will be found in the passive updating areas such as Ship Interior or Station screens.
Sponge
Militia Commander
Militia Commander
Posts: 250
Joined: Sun Jan 28, 2007 7:51 pm

This is really awesome. Can't wait to see the finished product.
User avatar
Periculi
Fleet Officer
Fleet Officer
Posts: 1282
Joined: Sat Oct 13, 2007 7:48 pm
Location: Necroposting in a forum near you

Here is a proof of concept for the core: Mod on Xelerus

Drop this in your extensions folder and check it out!

What this is doing now is using a timer in every system that runs in the background updating the ticker and checking for events every 120 ticks (calling this time a game hour).

The calendar feature is found in the Ship Interior- it is an example of a passive update where it only runs the script when it needs it. The calendar updates from the ticker whenever you go to the Ship Interior. This can be used for many event management ideas that don't actually need to be updated actively all the time. Passive events could be much more complex than the active ones due to generally being called from dockscreens where the game is 'slower' paced.

The active updater is a message system only for the time being. It can be tested using the Test Wolfen, where a TimerROM has been added to the playership and can be used to set an Egg Timer alert message. You can stack as many messages as you want, each time you invoke the timer a new alert message is added to the stack. What this is for is testing the continuity of events across multiple systems, and the ability to cycle through the list of events. This simple model will not be the ultimate method, so don't use it as a 'preferred' method- I plan to change the way the method passes data into the event list, but wanted to do this to see if it worked in a basic fashion.

This mod sample provides some simple proof of concepts for you to play with. The next few steps in development will be to create more passive and active methods to use, generic functions to call up for future mod expansions, and a few other generic functions to keep the list cleaned.

For a real release I have planned out a few examples of the variety of ideas I came up with, which could be available in a week or so.
Post Reply