Server Events: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
No edit summary
 
(46 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{being updated}}
Server events are [[events]] which are communicated to the server, and may affect all [[stakeholder]]s. For example, a server event can automatically plan a [[measure]] or change attribute values of [[areas]] and [[neighborhoods]], resulting in new [[overlay]] and [[indicator]] results.  
{{learned|file=ServerSideLogo-Q3-2015.jpg|what a Server Side event is|how Server Side events relate to the Tygron engine|about the different Server Side events in the Tygron engine|how to add a Server Side event to your project|how to change a Server Side event in your project}}
==What is a Server Event==
:''Main article: [[Events]]''
Server events are events which are communicated to the server, and may affect all stakeholders. An example of this is the activation of a measure. These events may affect the 3D world and the indicator scores.


==How do Server Events relate to the Tygron Engine==
Server Events can be used in multiple locations in the {{software}}; as part of a [[measure]], when a [[scenario]] is activated, as part of a larger [[Events#Event Bundles|event bundle]] in the [[Actions|action]] menu, or during a [[Cinematics|cinematic sequence]]. Server Events allow for events to be triggered during a session, which will result in a reaction from the server.
Server Events can be used in multiple locations in the Tygron Engine; as part of a [[Measures|measure]], at the start of a [[Levels|level]], as part of a larger [[Events#Event Bundles|event bundle]] in the [[Actions|action]] menu, etc. Server Events allow for events to be triggered during a session, which will result in a reaction from the server.
 
:''See also: [[Measures]], [[Scenarios]], [[Actions]] & [[Cinematics]]''


==Different Server Event types==
==Different Server Event types==
There are two flavors of Server Events: '''Logic Events''' and '''Player Events'''. The difference between these Event Types is that for Player Events at least one dedicated stakeholder needs to be assigned to the Server Event itself as event property. A good example of this is the asking for or receiving of a money transfer (MONEY_TRANSFER_ASK & MONEY_TRANSFER_GIVE) as a Server Event.  
There are two flavors of Server Events: '''Logic Events''' and '''Participant Events'''. The difference between these Event Types is that for Participant Events at least one dedicated stakeholder needs to be assigned to the Server Event ''itself as event property''. A good example of this is the asking for or receiving of a money transfer (MONEY_TRANSFER_ASK & MONEY_TRANSFER_GIVE) as a Server Event.  


Logic Events do not require such a dedicated stakeholder and can be fired without one being assigned as property. A good example of this is the activation of a specific terrain type (TERRAIN_SET_ACTIVE) when creating a [[Terrains#Flood Terrain|flooding]] as part of a measure. The event CINEMATIC_STAKEHOLDER_START is also a Logic Event Type, because the stakeholder is not a property of the event, but of the linked cinematic.
Logic Events do not require such a dedicated stakeholder and can be fired without one being assigned as property. A good example of this is the activation of a specific [[areas|area]] (AREA_SET_ACTIVE) when creating a [[Areas#Flooding|flooding]] as part of a measure. Events like CINEMATIC_STAKEHOLDER_START are also Logic Event Types, because the stakeholder is not a property of the event, but of the linked cinematic.
===Logic Event Types===
===Logic Event Types===
Below is a list describing available Logic Server Event Types:
Below is a list describing the available Logic Server Event Types:
{| class="wikitable"
{| class="wikitable"
|-
|'''ACTION_LOG_EXPORT'''
|''Export history of actions taken by participants.''
|-
|-
|'''ACTION_MENU_SET_FUNCTION_AVAILABLE'''
|'''ACTION_MENU_SET_FUNCTION_AVAILABLE'''
|''Add or remove a function from a particular Action Menu''
|''Add or remove a function from a particular Action Menu.''
|-
|-
|'''ACTION_MENU_SET_MEASURE_AVAILABLE'''
|'''ACTION_MENU_SET_MEASURE_AVAILABLE'''
|''Add or remove a measure from a particular Action Menu''
|''Add or remove a measure from a particular Action Menu.''
|-
|-
|'''ACTION_MENU_SET_UPGRADE_AVAILABLE'''
|'''ACTION_MENU_SET_UPGRADE_AVAILABLE'''
|''Add or remove an upgrade from a particular Action Menu''
|''Add or remove an upgrade from a particular Action Menu.''
|-
|'''AREA_SET_ACTIVE'''
|''Activate/deactivate a Area.''
|-
|-
|'''BEAMER_SET_LAYER'''
|'''AREA_SET_ATTRIBUTE'''
|''Set the beamer layer to a specific overlay type''
|''Set Area Attribute to given number Value.''
|-
|'''AREAS_SET_ATTRIBUTES'''
|''Per entry in the array, set the value of the attribute for the Area.''
|-
|'''BUILDING_SET_ATTRIBUTE'''
|''Set Building Attribute to given number Value.''
|-
|'''BUILDING_SET_ATTRIBUTES'''
|''Per entry in the array, set the values of the attribute for the Building.''
|-
|-
|'''CINEMATIC_STAKEHOLDER_START'''
|'''CINEMATIC_STAKEHOLDER_START'''
|''Start a cinematic for a specific stakeholder''
|''Start a cinematic for a specific stakeholder.''
|-
|-
|'''CINEMATIC_STAKEHOLDER_STOP'''
|'''CINEMATIC_STAKEHOLDER_STOP'''
|''Stop any cinematic for a specific stakeholder''
|''Stop any cinematic for a specific stakeholder.''
|-
|-
|'''LEVEL_SET_ACTIVE'''
|'''MEASUREMENT_LINE_ADD'''
|''Activate a game level''
|''Add a LineMeasurement for an Overlay for a specific timeframe.''
|-
|-
|'''MEASURE_UPDATE_CUSTOM'''
|'''MEASUREMENT_POINT_ADD'''
|''Update a custom made measure''
|''Add a PointMeasurement for an Overlay.''
|-
|-
|'''MESSAGE_ACTIVATE'''
|'''MEASUREMENT_ITEM_ADD'''
|''Activate a specific message''
|''Add a ItemMeasurement for an Overlay.''
|-
|-
|'''MESSAGE_REVOKE'''
|'''MEASUREMENT_SET_SUM'''
|''Revoke a message. Effects are not revoked''
|''Set a Measurement to add its base Overlays to itself.''
|-
|-
|'''MESSAGE_RESET'''
|'''MEASUREMENT_REMOVE'''
|''Reset a message. Sets the message as inactive and clears the send date.''
|''Remove a measurement.''
|-
|-
|'''SETTINGS_ALLOW_GAME_INTERACTION'''
|'''MEASUREMENT_SAVE'''
|''Allow interaction with the project during a session, after a pause moment or level switch''
|''Save a measurement.''
|-
|-
|'''SETTINGS_SET_MESSAGE_AUTO_RESPOND'''
|'''MEASUREMENT_SET_OVERLAYS'''
|''When activated, messages to non-human players and session facilitators are automatically replied to''
|
|-
|-
|'''SPECIAL_EFFECT_SET_ACTIVE'''
|'''NEIGHBORHOOD_SET_ATTRIBUTE'''
|''Activate/deactivate a special effect''
|''Set an attribute for a neighborhood.''
|-
|'''NET_CLUSTER_SET_FRACTION_CONNECTED'''
|''Set the fraction of connected loads with a cluster.''
|-
|'''NET_CLUSTER_SET_LOAD_ATTRIBUTE'''
|''For each NetLoad of a NetCluster, set the value of the attribute.''
|-
|'''NET_CLUSTER_SET_LOAD_ATTRIBUTES'''
|''For each NetLoad of a NetCluster, set the values of the provided attributes.''
|-
|'''NET_CLUSTERS_SET_STATE'''
|''Per NetCluster, set all its Net Loads of the provided NetType to the given TimeState.''
|-
|'''NET_CLUSTERS_SET_LOAD_ATTRIBUTES'''
|''Per NetCluster, for each NetLoad of that NetCluster, set the values of the provided attributes.''
|-
|'''NET_CLUSTERS_SET_DEFAULT_FRACTION_CONNECTED'''
|''Set the default fraction of connected loads with a cluster.''
|-
|'''NET_LINE_SET_ATTRIBUTE'''
|''Set the attribute of a NetLine to the provided value.''
|-
|'''NET_LINES_SET_ATTRIBUTE'''
|''For each NetLine, set the value of the attribute.''
|-
|'''NET_LINES_SET_ATTRIBUTES'''
|''Per entry in the array, set the value of the attribute for the Netline.''
|-
|'''SCENARIO_SET_ACTIVE'''
|''Activate a scenario in a project session.''
|-
|'''SEARCH'''
|''Search for Neighborhood, Building or Address.''
|-
|'''SET_NET_SETTING_BOOLEAN'''
|''For boolean valued NetSettings, set the value to true or false.''
|-
|-
|'''TERRAIN_SET_ACTIVE'''
|'''SET_TRAFFIC_MULTIPLIER'''
|''Activate/deactivate a terrain''
|''Multiply visual (only) traffic density with this factor.''
|-
|-
|'''TERRAIN_SET_POLYGON'''
|'''SPECIAL_EFFECT_SET_ACTIVE'''
|''Activate/deactivate a polygon as terrain (Safe Zone, Flood Hazard Zone, etc)''
|''Activate/deactivate a special effect.''
|-
|-
|'''TIME_SET_SIM_MULTIPLIER'''
|'''UNIT_TYPE_SET_ACTIVE'''
|''Set the game time multiplier. A value of 1 means that 1 sec in real life is also 1 sec in simulation time. 2 means 1 sec in real life is 2 sec in simulation time''
|''Activate/deactivate units of a specific type.''
|-
|-
|'''UNIT_SET_ACTIVE'''
|'''ZONE_SET_ATTRIBUTE'''
|''Activate/deactivate a unit (vehicles etc)''
|''Set an attribute for a zone.''
|-
|-
|'''WEATHER_SET_DATA'''
|'''ZONES_SET_ATTRIBUTES'''
|''Set rain data of the weather''
|''Set attributes to values for zones.''
|-
|-
|'''ZOOMLEVEL_SET_ACTIVE'''
|'''ZOOMLEVEL_SET_ACTIVE'''
|''Activate or deactivate a zoom level''
|''Activate or deactivate a zoom level.''
|}
|}


===Player Event Types===
===Participant Event Types===
Below is a list describing the available Player Event Types:
Below is a list describing the available Participant Event Types:
{| class="wikitable"
{| class="wikitable"
|-
|-
|'''ACTION_MENU_SET_ACTIVE'''
|'''ACTION_MENU_SET_ACTIVE'''
|''Set a category of actions available for a stakeholder''  
|''Set a category active for a stakeholder.''  
|-
|-
|'''MEASURE_CANCEL_CONSTRUCTION'''
|'''MEASURE_CANCEL_CONSTRUCTION'''
|''Cancel a measure planned by a stakeholder while in pre-construction phase''
|''Cancel a measure planned by an Stakeholder while in pre-construction phase.''
|-
|-
|'''MEASURE_PLAN_CONSTRUCTION'''
|'''MEASURE_PLAN_CONSTRUCTION'''
|''Plan construction of a measure by a stakeholder that is not yet planned''
|''Plan construction of a measure by an Stakeholder that is not yet planned.''
|-
|'''MONEY_TRANSFER_GIVE'''
|''Give money from one stakeholder to another.''
|-
|'''NET_CLUSTER_SET_LOAD_ATTRIBUTE'''
|''For each NetLoad of a NetCluster, set the value of the attribute.''
|-
|-
|'''MESSAGE_NEW'''
|'''NET_CLUSTER_SET_LOAD_ATTRIBUTES'''
|''Send a message between Stakeholders through the message panel''
|''For each NetLoad of a NetCluster, set the value of the attribute.''
|-
|-
|'''MONEY_TRANSFER_ASK'''
|'''NET_CLUSTER_SET_STATE'''
|''Ask for money from one stakeholder to another''
|''Set TimeState for all Net Loads of Net Cluster.''
|-
|-
|'''MONEY_TRANSFER_GIVE'''
|'''NET_CLUSTER_SET_STATE_FOR_NET_TYPE'''
|''Give money from one stakeholder to another''
|''Set TimeState for Net Loads of Net Cluster, based on NetType.''
|-
|-
|'''SETTINGS_SET_ALLOWED_WATER_LEVEL_INCREASE'''
|'''NET_CLUSTER_SET_STATES'''
|''Set the maximum allowed water rise amount in meters in 'polder water' (= open water)''
|''Set TimeState for all Net Loads of Net Cluster.''
|}
|}


==Adding Server Side Events to a project==
==Adding Server Side Events to a project==
As mentioned above, events can be added to a project on multiple occasions and locations. Please refer to the main article relating to these locations for more information about the specific steps to take.
[[File:ScenarioEventLeft.png|frame|right|Add events to a scenario ([[Left Panel|left panel]])]]
[[File:Event_buttons.png|frame|right|Add & Remove Event buttons ([[Right Panel|right panel]])]]
As mentioned above, events can be added to a project element on multiple occasions and locations. Please refer to the main article relating to these elements for more information about the specific steps to take.
 
In general, adding Events to an element in the {{software}} happens on the [[Right Panel|right panel]], after selecting the element (ex. measures, scenario, etc) to have an event added to on the [[Left Panel|left panel]] first. Select on the right panel bottom the 'Add Event' button; a default blank event named ''NO_DEF'' is created in the list above the buttons. Selecting an Event on the list and using the 'Remove Event' button deletes the event from the list.


In general, adding Events to an element in the Tygron Engine happens on the [[Right Panel|right panel]] after selecting the element to have an event added to on the [[Left Panel|left panel]] first. Select on the right panel bottom the 'Add Event' button; a default blank event named ''NO_DEF'' is created in the list above the buttons. Selecting an Event on the list and using the 'Remove Event' button deletes the event from the list.
Selecting an event on the right panel also opens up the [[Bottom Panel|bottom panel]] where the actual event type can be selected. This selection can then be confirmed on the bottom panel by using the 'Commit' button. The 'Cancel' button clears the selection on the bottom panel.


[[File:LevelsEventsBottomPanel-Q3-2015.jpg|frame|left|Event bundle [[Bottom Panel|bottom panel]] with 'Commit' and 'Cancel' buttons]]
<br clear=all>
{{Editor steps|title=add events to a project element|Select Project Element to have events added to|Select the Event option on the left panel|Select 'Add event' on the bottom of the right panel|Select the newly added event on the right panel|Select the desired server event from the bottom  panel|Confirm the selection with the 'Commit' button (or use the 'Cancel' button to clear the selection}}
{{Editor steps|title=add events to a project element|Select Project Element to have events added to|Select the Event option on the left panel|Select 'Add event' on the bottom of the right panel|Select the newly added event on the right panel|Select the desired server event from the bottom  panel|Confirm the selection with the 'Commit' button (or use the 'Cancel' button to clear the selection}}


==Changing the properties of a Server Side Event in a project==
==Changing the properties of a Server Side Event in a project==
The properties of events can be edited on the bottom panel (see image above). On this panel a linked [[ID]] of a measure or cinematic can be linked to an event for instance. Also can a dedicated stakeholder be selected here for Participant Type Events. Again, any changed made need to be confirmed first with the 'Commit' button, or cancelled with the 'Cancel' button.

Latest revision as of 15:22, 20 January 2023

Server events are events which are communicated to the server, and may affect all stakeholders. For example, a server event can automatically plan a measure or change attribute values of areas and neighborhoods, resulting in new overlay and indicator results.

Server Events can be used in multiple locations in the Tygron Platform; as part of a measure, when a scenario is activated, as part of a larger event bundle in the action menu, or during a cinematic sequence. Server Events allow for events to be triggered during a session, which will result in a reaction from the server.

See also: Measures, Scenarios, Actions & Cinematics

Different Server Event types

There are two flavors of Server Events: Logic Events and Participant Events. The difference between these Event Types is that for Participant Events at least one dedicated stakeholder needs to be assigned to the Server Event itself as event property. A good example of this is the asking for or receiving of a money transfer (MONEY_TRANSFER_ASK & MONEY_TRANSFER_GIVE) as a Server Event.

Logic Events do not require such a dedicated stakeholder and can be fired without one being assigned as property. A good example of this is the activation of a specific area (AREA_SET_ACTIVE) when creating a flooding as part of a measure. Events like CINEMATIC_STAKEHOLDER_START are also Logic Event Types, because the stakeholder is not a property of the event, but of the linked cinematic.

Logic Event Types

Below is a list describing the available Logic Server Event Types:

ACTION_LOG_EXPORT Export history of actions taken by participants.
ACTION_MENU_SET_FUNCTION_AVAILABLE Add or remove a function from a particular Action Menu.
ACTION_MENU_SET_MEASURE_AVAILABLE Add or remove a measure from a particular Action Menu.
ACTION_MENU_SET_UPGRADE_AVAILABLE Add or remove an upgrade from a particular Action Menu.
AREA_SET_ACTIVE Activate/deactivate a Area.
AREA_SET_ATTRIBUTE Set Area Attribute to given number Value.
AREAS_SET_ATTRIBUTES Per entry in the array, set the value of the attribute for the Area.
BUILDING_SET_ATTRIBUTE Set Building Attribute to given number Value.
BUILDING_SET_ATTRIBUTES Per entry in the array, set the values of the attribute for the Building.
CINEMATIC_STAKEHOLDER_START Start a cinematic for a specific stakeholder.
CINEMATIC_STAKEHOLDER_STOP Stop any cinematic for a specific stakeholder.
MEASUREMENT_LINE_ADD Add a LineMeasurement for an Overlay for a specific timeframe.
MEASUREMENT_POINT_ADD Add a PointMeasurement for an Overlay.
MEASUREMENT_ITEM_ADD Add a ItemMeasurement for an Overlay.
MEASUREMENT_SET_SUM Set a Measurement to add its base Overlays to itself.
MEASUREMENT_REMOVE Remove a measurement.
MEASUREMENT_SAVE Save a measurement.
MEASUREMENT_SET_OVERLAYS
NEIGHBORHOOD_SET_ATTRIBUTE Set an attribute for a neighborhood.
NET_CLUSTER_SET_FRACTION_CONNECTED Set the fraction of connected loads with a cluster.
NET_CLUSTER_SET_LOAD_ATTRIBUTE For each NetLoad of a NetCluster, set the value of the attribute.
NET_CLUSTER_SET_LOAD_ATTRIBUTES For each NetLoad of a NetCluster, set the values of the provided attributes.
NET_CLUSTERS_SET_STATE Per NetCluster, set all its Net Loads of the provided NetType to the given TimeState.
NET_CLUSTERS_SET_LOAD_ATTRIBUTES Per NetCluster, for each NetLoad of that NetCluster, set the values of the provided attributes.
NET_CLUSTERS_SET_DEFAULT_FRACTION_CONNECTED Set the default fraction of connected loads with a cluster.
NET_LINE_SET_ATTRIBUTE Set the attribute of a NetLine to the provided value.
NET_LINES_SET_ATTRIBUTE For each NetLine, set the value of the attribute.
NET_LINES_SET_ATTRIBUTES Per entry in the array, set the value of the attribute for the Netline.
SCENARIO_SET_ACTIVE Activate a scenario in a project session.
SEARCH Search for Neighborhood, Building or Address.
SET_NET_SETTING_BOOLEAN For boolean valued NetSettings, set the value to true or false.
SET_TRAFFIC_MULTIPLIER Multiply visual (only) traffic density with this factor.
SPECIAL_EFFECT_SET_ACTIVE Activate/deactivate a special effect.
UNIT_TYPE_SET_ACTIVE Activate/deactivate units of a specific type.
ZONE_SET_ATTRIBUTE Set an attribute for a zone.
ZONES_SET_ATTRIBUTES Set attributes to values for zones.
ZOOMLEVEL_SET_ACTIVE Activate or deactivate a zoom level.

Participant Event Types

Below is a list describing the available Participant Event Types:

ACTION_MENU_SET_ACTIVE Set a category active for a stakeholder.
MEASURE_CANCEL_CONSTRUCTION Cancel a measure planned by an Stakeholder while in pre-construction phase.
MEASURE_PLAN_CONSTRUCTION Plan construction of a measure by an Stakeholder that is not yet planned.
MONEY_TRANSFER_GIVE Give money from one stakeholder to another.
NET_CLUSTER_SET_LOAD_ATTRIBUTE For each NetLoad of a NetCluster, set the value of the attribute.
NET_CLUSTER_SET_LOAD_ATTRIBUTES For each NetLoad of a NetCluster, set the value of the attribute.
NET_CLUSTER_SET_STATE Set TimeState for all Net Loads of Net Cluster.
NET_CLUSTER_SET_STATE_FOR_NET_TYPE Set TimeState for Net Loads of Net Cluster, based on NetType.
NET_CLUSTER_SET_STATES Set TimeState for all Net Loads of Net Cluster.

Adding Server Side Events to a project

Add events to a scenario (left panel)
Add & Remove Event buttons (right panel)

As mentioned above, events can be added to a project element on multiple occasions and locations. Please refer to the main article relating to these elements for more information about the specific steps to take.

In general, adding Events to an element in the Tygron Platform happens on the right panel, after selecting the element (ex. measures, scenario, etc) to have an event added to on the left panel first. Select on the right panel bottom the 'Add Event' button; a default blank event named NO_DEF is created in the list above the buttons. Selecting an Event on the list and using the 'Remove Event' button deletes the event from the list.

Selecting an event on the right panel also opens up the bottom panel where the actual event type can be selected. This selection can then be confirmed on the bottom panel by using the 'Commit' button. The 'Cancel' button clears the selection on the bottom panel.

Event bundle bottom panel with 'Commit' and 'Cancel' buttons


How to add events to a project element:
  1. Select Project Element to have events added to
  2. Select the Event option on the left panel
  3. Select 'Add event' on the bottom of the right panel
  4. Select the newly added event on the right panel
  5. Select the desired server event from the bottom panel
  6. Confirm the selection with the 'Commit' button (or use the 'Cancel' button to clear the selection

Changing the properties of a Server Side Event in a project

The properties of events can be edited on the bottom panel (see image above). On this panel a linked ID of a measure or cinematic can be linked to an event for instance. Also can a dedicated stakeholder be selected here for Participant Type Events. Again, any changed made need to be confirmed first with the 'Commit' button, or cancelled with the 'Cancel' button.