Difference between revisions of "Persistence"
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{Partof_Data}} | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
==How It Works== | ==How It Works== | ||
+ | ALIVE Persistence stores mission and player data either locally or in the cloud, allowing players to retain the state of the mission across multiple sessions. This works both for players disconnecting and rejoining in progress as well as between server restarts. | ||
− | |||
− | + | ''Usage'': Place the [[Database|ALiVE Data]] module and set the Database Source to Cloud or Local as required. For cloud persistence, you must register a free account on the [[War Room]]. Local persistence does not require a War Room account. You can register an account to view Mission Stats whilst using Local persistence if you prefer. | |
+ | |||
+ | |||
+ | ==Configuring Module Persistence== | ||
+ | Persistence is configurable on different modules, allowing mission makers and server admins to choose the level of mission data to be stored and recalled. To turn on persistence, choose the option in the relevant module. Persistence is OFF by default. | ||
[[File:Icon_sys_profile.png|50px|Profiles]] Virtual AI System persistence stores the state of all virtual AI profiles including current location and combat effectiveness. | [[File:Icon_sys_profile.png|50px|Profiles]] Virtual AI System persistence stores the state of all virtual AI profiles including current location and combat effectiveness. | ||
Line 23: | Line 16: | ||
[[File:Icon_mil_opcom.png|50px|OPCOM]] Military AI Commander persistence stores the current orders relating to each Objective. If AI Commander persistence is off when a server starts, the AI Comd will review the current state of assigned objectives based on the location of available units and issue fresh orders as normal. | [[File:Icon_mil_opcom.png|50px|OPCOM]] Military AI Commander persistence stores the current orders relating to each Objective. If AI Commander persistence is off when a server starts, the AI Comd will review the current state of assigned objectives based on the location of available units and issue fresh orders as normal. | ||
− | [[File:Icon_cqb.png|50px|CQB]] With Military CQB Persistence on, ambient CQB | + | [[File:Icon_cqb.png|50px|CQB]] With Military CQB Persistence on, ambient CQB sectors are stored to DB (not individual CQB units). Players should take care clear a sector fully before a server restart. If not, the sector may still be considered occupied and fresh CQB units will spawn in that sector. |
− | [[File:Icon_sys_rwg.png|50px|Player]] Player Persistence comes with the [[ALiVE Player]] module and stores a large amount of player data to the database, including location, medical state and equipment. The module has a option to turn Database saving OFF. In this case Player data will be saved for the current mission only - once the game is restarted, the player states will be reset. This is useful for people who want player persistence for JIP or disconnected players but | + | [[File:Icon_sys_rwg.png|50px|Player]] Player Persistence comes with the [[ALiVE Player]] module and stores a large amount of player data to the database, including location, medical state and equipment. The module has a option to turn Database saving OFF. In this case Player data will be saved for the current mission only - once the game is restarted, the player states will be reset. This is useful for people who want player persistence for JIP or disconnected players but not between missions. |
− | [[File:Icon_mil_ML.png|50px|Logistics]] Player Logistics persistence is enabled by default and will store the location and contents of vehicles, objects and players. Vehicles and objects are saved when they are moved or accessed by a player. | + | [[File:Icon_mil_ML.png|50px|Logistics]] Player Logistics persistence is enabled by default and will store the location and contents of vehicles, objects and players. Vehicles and objects are saved when they are moved or accessed by a player using ALiVE [[Logistics Support]]. |
==Exiting and Shutting Down== | ==Exiting and Shutting Down== | ||
+ | When players leave the mission they should use the ALiVE specific ''Player Save & Exit'' button. Quitting the mission normally (with the BIS exit or Abort buttons) may cause persistent data to fail. Similarly, when closing the mission down be sure to use the ''Server Save & Exit'' button. | ||
+ | |||
+ | |||
+ | ==Resetting Stats and Persistence== | ||
+ | * War Room uses onLoadName (set in description.ext or mission options in the Eden editor) as a unique id for recording stats. | ||
+ | * Persistence uses the mission.pbo filename as a unique id for saving persistent states. | ||
+ | |||
+ | For example: | ||
+ | |||
+ | # To keep the same Stats and Mission Persistence, keep both onLoadName and Filename the same. | ||
+ | # To reset Persistence but keep Stats (for example, to retain stats across a campaign of several ops), change the Filename only. | ||
+ | # To reset Stats but keep Mission Persistence (for example, to record separate stats for each session), change the onLoadName only. | ||
+ | # To reset both Stats and Persistence, change onLoadName AND Filename. | ||
+ | |||
+ | None of these effect the mission name that shows in the game browser (which is set in mission.sqm) so you can call it whatever you want. | ||
+ | |||
+ | |||
+ | ==Persistence Confidence Check== | ||
+ | Follow the Server Setup instructions in the War Room, ensuring your servers public IP is registered. | ||
+ | #In server.cfg include persistent=1; | ||
+ | #Start your dedicated server with the following mod params -mod=@CBA_A3;@aliveserver;@ALiVE; | ||
+ | #Start your Arma 3 client with the following mod params -mod=@CBA_A3;@ALiVE; | ||
+ | #Main Menu > Multiplayer > select your dedicated server > JOIN | ||
+ | #/ #login yourpassword | ||
+ | #Maps > Stratis | ||
+ | #Missions > ALIVE | Quick Start (COOP 9) | ||
+ | #CONTINUE | ||
+ | #Select a slot (Squad Leader) | ||
+ | #OK | ||
+ | #When the map loads, if you have successfully saved a mission before with SPOTREPS, PATROLREPS, SITREPS or markers, they should be displayed on the map. The map diary should also include entries relating to the reports. | ||
+ | #CONTINUE | ||
+ | #A hint to the right hand side should appear stating your web profile has been loaded, if not persistence has failed. | ||
+ | #If you have saved a previous mission, then you should be restored to your last location with your last loadout. | ||
+ | |||
+ | To see an example of a mission that is successfully loaded and saved see [http://alivemod.com/wiki/index.php/Database/Example_RPT here] | ||
+ | |||
+ | |||
+ | ==Persistence Script Commands== | ||
+ | You can save and retrieve custom value using the following funcs. These functions need to be run SERVER side and @AliveServer needs to be installed and running. | ||
+ | |||
+ | <syntaxhighlight lang="php"> | ||
+ | ["MyCustomVariable", _value] call ALiVE_fnc_setData //will save to the Cloud on next Server Save & Exit | ||
+ | _value = ["MyCustomVariable"] call ALiVE_fnc_getData //will load on next mission start or when command is executed | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | For local persistence, you can use the following | ||
+ | <syntaxhighlight lang="php"> | ||
+ | ["MyCustomVariable",_value] call ALiVE_fnc_ProfileNameSpaceSave; //will save to local ProfileNameSpace on next mission save | ||
+ | _value = "MyCustomVariable" call ALiVE_fnc_ProfileNameSpaceLoad; //will load on next mission start or when command is executed | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | We recommend that you save no more than 10KB worth of data in TOTAL for custom variables. | ||
+ | |||
+ | |||
+ | Manually clear data from the ProfileNameSpace when running Local persistence using the following commands. Be sure to use Server Exec if running on a dedicated server. | ||
+ | <syntaxhighlight lang="php"> | ||
+ | call ALiVE_fnc_ProfileNameSpaceClear //removes current mission data only | ||
+ | call ALiVE_fnc_ProfileNameSpaceWipe //removes all mission data completely | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | Autosave can be scripted in using Local persistence only (not available with Cloud). The server may lag/desync for a few seconds while saving takes place: | ||
+ | <syntaxhighlight lang="php"> | ||
+ | 900 call ALiVE_fnc_AutoSave_PNS //where 900 is the save interval in seconds | ||
+ | -1 call ALiVE_fnc_AutoSave_PNS //run at any time will disable autosave | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | |||
+ | |||
− | + | Example snippet - Grabbing a variable, checking if it was saved, if not -- use a default value, otherwise react accordingly | |
+ | <syntaxhighlight lang="php"> | ||
+ | ["ScriptStarted", _started] call ALiVE_fnc_ProfileNameSpaceSave; | ||
+ | </syntaxhighlight> | ||
+ | in your init.sqf or similar: | ||
+ | <syntaxhighlight lang="php"> | ||
+ | _scriptStarted = "ScriptStarted" call ALiVE_fnc_ProfileNameSpaceLoad; | ||
+ | if (isnil "_scriptStarted" || {!_scriptStarted}) then { | ||
+ | // start script | ||
+ | ["ScriptStarted", true] call ALiVE_fnc_ProfileNameSpaceSave; | ||
+ | }; | ||
+ | </syntaxhighlight> | ||
− | + | ==Editor Notes== | |
+ | Note that when editing missions that are persistent, units placed on the map in the editor may be moved to their stored location when the server restarts. | ||
− | + | To exclude an object or vehicle from persistence, simply sync it to the Player Logistics (Disable) module. | |
Persistence is predicated on the mission.pbo name. You can can change the displayed mission name in mission.sqm no problems, but the pbo must remain the same. To reset the Persistence state of a mission (start a fresh one) simply rename the pbo file. See [[ALiVE Data]] for more info. | Persistence is predicated on the mission.pbo name. You can can change the displayed mission name in mission.sqm no problems, but the pbo must remain the same. To reset the Persistence state of a mission (start a fresh one) simply rename the pbo file. See [[ALiVE Data]] for more info. | ||
[[Category:War Room]] | [[Category:War Room]] |
Latest revision as of 04:04, 9 February 2018
ALiVE Data |
Contents
How It Works
ALIVE Persistence stores mission and player data either locally or in the cloud, allowing players to retain the state of the mission across multiple sessions. This works both for players disconnecting and rejoining in progress as well as between server restarts.
Usage: Place the ALiVE Data module and set the Database Source to Cloud or Local as required. For cloud persistence, you must register a free account on the War Room. Local persistence does not require a War Room account. You can register an account to view Mission Stats whilst using Local persistence if you prefer.
Configuring Module Persistence
Persistence is configurable on different modules, allowing mission makers and server admins to choose the level of mission data to be stored and recalled. To turn on persistence, choose the option in the relevant module. Persistence is OFF by default.
Virtual AI System persistence stores the state of all virtual AI profiles including current location and combat effectiveness.
Military AI Commander persistence stores the current orders relating to each Objective. If AI Commander persistence is off when a server starts, the AI Comd will review the current state of assigned objectives based on the location of available units and issue fresh orders as normal.
With Military CQB Persistence on, ambient CQB sectors are stored to DB (not individual CQB units). Players should take care clear a sector fully before a server restart. If not, the sector may still be considered occupied and fresh CQB units will spawn in that sector.
Player Persistence comes with the ALiVE Player module and stores a large amount of player data to the database, including location, medical state and equipment. The module has a option to turn Database saving OFF. In this case Player data will be saved for the current mission only - once the game is restarted, the player states will be reset. This is useful for people who want player persistence for JIP or disconnected players but not between missions.
Player Logistics persistence is enabled by default and will store the location and contents of vehicles, objects and players. Vehicles and objects are saved when they are moved or accessed by a player using ALiVE Logistics Support.
Exiting and Shutting Down
When players leave the mission they should use the ALiVE specific Player Save & Exit button. Quitting the mission normally (with the BIS exit or Abort buttons) may cause persistent data to fail. Similarly, when closing the mission down be sure to use the Server Save & Exit button.
Resetting Stats and Persistence
- War Room uses onLoadName (set in description.ext or mission options in the Eden editor) as a unique id for recording stats.
- Persistence uses the mission.pbo filename as a unique id for saving persistent states.
For example:
- To keep the same Stats and Mission Persistence, keep both onLoadName and Filename the same.
- To reset Persistence but keep Stats (for example, to retain stats across a campaign of several ops), change the Filename only.
- To reset Stats but keep Mission Persistence (for example, to record separate stats for each session), change the onLoadName only.
- To reset both Stats and Persistence, change onLoadName AND Filename.
None of these effect the mission name that shows in the game browser (which is set in mission.sqm) so you can call it whatever you want.
Persistence Confidence Check
Follow the Server Setup instructions in the War Room, ensuring your servers public IP is registered.
- In server.cfg include persistent=1;
- Start your dedicated server with the following mod params -mod=@CBA_A3;@aliveserver;@ALiVE;
- Start your Arma 3 client with the following mod params -mod=@CBA_A3;@ALiVE;
- Main Menu > Multiplayer > select your dedicated server > JOIN
- / #login yourpassword
- Maps > Stratis
- Missions > ALIVE | Quick Start (COOP 9)
- CONTINUE
- Select a slot (Squad Leader)
- OK
- When the map loads, if you have successfully saved a mission before with SPOTREPS, PATROLREPS, SITREPS or markers, they should be displayed on the map. The map diary should also include entries relating to the reports.
- CONTINUE
- A hint to the right hand side should appear stating your web profile has been loaded, if not persistence has failed.
- If you have saved a previous mission, then you should be restored to your last location with your last loadout.
To see an example of a mission that is successfully loaded and saved see here
Persistence Script Commands
You can save and retrieve custom value using the following funcs. These functions need to be run SERVER side and @AliveServer needs to be installed and running.
["MyCustomVariable", _value] call ALiVE_fnc_setData //will save to the Cloud on next Server Save & Exit _value = ["MyCustomVariable"] call ALiVE_fnc_getData //will load on next mission start or when command is executed
For local persistence, you can use the following
["MyCustomVariable",_value] call ALiVE_fnc_ProfileNameSpaceSave; //will save to local ProfileNameSpace on next mission save _value = "MyCustomVariable" call ALiVE_fnc_ProfileNameSpaceLoad; //will load on next mission start or when command is executed
We recommend that you save no more than 10KB worth of data in TOTAL for custom variables.
Manually clear data from the ProfileNameSpace when running Local persistence using the following commands. Be sure to use Server Exec if running on a dedicated server.
call ALiVE_fnc_ProfileNameSpaceClear //removes current mission data only call ALiVE_fnc_ProfileNameSpaceWipe //removes all mission data completely
Autosave can be scripted in using Local persistence only (not available with Cloud). The server may lag/desync for a few seconds while saving takes place:
900 call ALiVE_fnc_AutoSave_PNS //where 900 is the save interval in seconds -1 call ALiVE_fnc_AutoSave_PNS //run at any time will disable autosave
Example snippet - Grabbing a variable, checking if it was saved, if not -- use a default value, otherwise react accordingly
["ScriptStarted", _started] call ALiVE_fnc_ProfileNameSpaceSave;
in your init.sqf or similar:
_scriptStarted = "ScriptStarted" call ALiVE_fnc_ProfileNameSpaceLoad; if (isnil "_scriptStarted" || {!_scriptStarted}) then { // start script ["ScriptStarted", true] call ALiVE_fnc_ProfileNameSpaceSave; };
Editor Notes
Note that when editing missions that are persistent, units placed on the map in the editor may be moved to their stored location when the server restarts.
To exclude an object or vehicle from persistence, simply sync it to the Player Logistics (Disable) module.
Persistence is predicated on the mission.pbo name. You can can change the displayed mission name in mission.sqm no problems, but the pbo must remain the same. To reset the Persistence state of a mission (start a fresh one) simply rename the pbo file. See ALiVE Data for more info.