The challenge of synchronizing the locations of moving ships or other objects among network players is interesting. LAC's "classic" missions had no provision for transmitting the locations of any objects other than the ten aircraft that may be flown by Sentient players. When creating new missions, It's simple enough for each independent copy of LAC to move objects around according to the advance of its own local timers, but in multi-player missions, new players may enter, exit, or re-enter at any moment during a mission's progress, so there is an obvious need for them to learn the current mission state soon after their entry so that they can synchronize appropriate mission timers and thereafter they will perceive or calculate the locations of objects the same as those that have been in the mission longer.
To facilitate all of this, LAC has tools to dynamically define a "Commander" for each mission. Under this approach, the "MissionCommander" is the Sentient player with the highest current value of "MyNetworkId". Since version 8.15, LAC's network processing constantly monitors all incoming network packets for the received values of "MyNetworkId", to determine who is using the highest value. That logic sets a new unsigned global variable named "MissionCommander" to one of the ten values "1", "2", "3", "4", "5", "6", "7", "8", "9", or "0" correspondingly (where "0" represents "10"). By consulting the value of "MissionCommander" about every 10 seconds and comparing it with the value of "MyNetworkId", mission designers can always know how to code for two cases as follows:
1 of 2: If the current player is the MissionCommander, then he TRANSMITS mission milestone numbers to other players whenever his mission timers advance to any of 10 strategically chosen, comprehensively documented, "MissionChronoMilestones".
or
2 of 2: If the current player is NOT the MissionCommander then he expects to RECEIVE mission status information from the MissionCommander from time to time, alerting him of the times when all of his mobile mission assets (like ships) should "leap" to the predetermined locations corresponding with one of those 10 strategically chosen, comprehensively documented, "MissionChronoMilestones".
Thereafter, the MissionCommander can transmit periodic, specifically formatted Morse Code Radio messages to indicate arrival at a specific "MissionChronoMilestone" in the mission, which implies a corresponding location for all mission objects. For example, transmission of sequences like these alert other mission players that the MissionCommander has reached a "Chrono Milestone":
Like other Morse Code Radio commands already in use, those messages are transmitted as eight or more C characters followed by one or more identical numeric digits, and receipt of eight or more sequential "C" characters and any digit would then trigger synchronization of all of the timers for all of the players participating in the mission according to one of ten predefined, comprehensively documented, MissionChronoMilestones, immediately jumping all of the mission's ships or other moving, non-aircraft mission objects to one of ten sets of predetermined locations. During a 30-minute mission, one of those Morse transmissions might be issued every three minutes, for example. Accordingly, a new player would never need to wait longer than 3 minutes before receiving news of the location of moving ships.
However, under this scheme, from time to time a new player might receive one of those updates and assume that the corresponding mission state is accurate, but some details could still be incorrect. For example, perhaps one of the ships normally positioned for the corresponding state had already been sunk. To overcome this problem, any player that knows that a strategic mission asset has already been destroyed can alert all other players by simply "claiming" to have inflicted new, overwhelmingly destructive, damage upon it from time to time (whenever circumstances indicate that some other player might need a tactical situation update).
This scheme results in reasonable means of synchronizing the motion and/or destruction of all mission assets as many as ten times as a new mission progresses through any combination of as many as ten "MissionChronoMilestones".
In support of this scheme, LAC versions since 8.21 (early June 2020) include enhanced network code to update the value of "MissionCommander" every ten seconds with the NetworkId of the player that has been using the highest value among the ten that are valid. I have also already enhanced LAC's Morse Code Radio to detect incoming commands structured with eight "C" characters followed by a single digit, which updates a new, global, unsigned character variable named "MissionChronoMilestone". Both of those two new global variables can be consulted by mission designers at any time.
Accordingly, Mission designers can define as many as 10 "MissionChronoMilestones", each of which can precisely map the locations, orientations, velocities, and alive/dead status of any important mission objects that might move around and which ought to be robustly synchronized across all players. At any time, the player designated as "MissionCommander" can command all players to activate the mission-wide positions, orientations, and status corresponding with any of those ten Milestones. After that, any trusted player can invert the alive/dead status of any of those 10 separate mission objects to ensure that the other players see the same mix of object positions and object alive/dead status that he sees.
As of this update in early July of 2020, all seven of our sample missions (those marked "TEST" in the menus) incorporate all of this "MissionChronoMilestone" logic, and those that include moving aircraft carriers exchange MissionChronoMilestone messages and synchronize carrier locations across all participating players as described above. New Mission Designers can use those existing sample missions as a pattern for their work as they enhance the simple circlular navigation of those existing aircraft carriers in more sophisticated missions, or as they add more strategic Mobile MissionObjects.
Last edit: bbosen 2020-07-14
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The challenge of synchronizing the locations of moving ships or other objects among network players is interesting. LAC's "classic" missions had no provision for transmitting the locations of any objects other than the ten aircraft that may be flown by Sentient players. When creating new missions, It's simple enough for each independent copy of LAC to move objects around according to the advance of its own local timers, but in multi-player missions, new players may enter, exit, or re-enter at any moment during a mission's progress, so there is an obvious need for them to learn the current mission state soon after their entry so that they can synchronize appropriate mission timers and thereafter they will perceive or calculate the locations of objects the same as those that have been in the mission longer.
To facilitate all of this, LAC has tools to dynamically define a "Commander" for each mission. Under this approach, the "MissionCommander" is the Sentient player with the highest current value of "MyNetworkId". Since version 8.15, LAC's network processing constantly monitors all incoming network packets for the received values of "MyNetworkId", to determine who is using the highest value. That logic sets a new unsigned global variable named "MissionCommander" to one of the ten values "1", "2", "3", "4", "5", "6", "7", "8", "9", or "0" correspondingly (where "0" represents "10"). By consulting the value of "MissionCommander" about every 10 seconds and comparing it with the value of "MyNetworkId", mission designers can always know how to code for two cases as follows:
or
Thereafter, the MissionCommander can transmit periodic, specifically formatted Morse Code Radio messages to indicate arrival at a specific "MissionChronoMilestone" in the mission, which implies a corresponding location for all mission objects. For example, transmission of sequences like these alert other mission players that the MissionCommander has reached a "Chrono Milestone":
CCCCCCCC1
CCCCCCCC2
CCCCCCCC3
CCCCCCCC4
CCCCCCCC5
CCCCCCCC6
CCCCCCCC7
CCCCCCCC8
CCCCCCCC9
CCCCCCCC0
Like other Morse Code Radio commands already in use, those messages are transmitted as eight or more C characters followed by one or more identical numeric digits, and receipt of eight or more sequential "C" characters and any digit would then trigger synchronization of all of the timers for all of the players participating in the mission according to one of ten predefined, comprehensively documented, MissionChronoMilestones, immediately jumping all of the mission's ships or other moving, non-aircraft mission objects to one of ten sets of predetermined locations. During a 30-minute mission, one of those Morse transmissions might be issued every three minutes, for example. Accordingly, a new player would never need to wait longer than 3 minutes before receiving news of the location of moving ships.
However, under this scheme, from time to time a new player might receive one of those updates and assume that the corresponding mission state is accurate, but some details could still be incorrect. For example, perhaps one of the ships normally positioned for the corresponding state had already been sunk. To overcome this problem, any player that knows that a strategic mission asset has already been destroyed can alert all other players by simply "claiming" to have inflicted new, overwhelmingly destructive, damage upon it from time to time (whenever circumstances indicate that some other player might need a tactical situation update).
This scheme results in reasonable means of synchronizing the motion and/or destruction of all mission assets as many as ten times as a new mission progresses through any combination of as many as ten "MissionChronoMilestones".
In support of this scheme, LAC versions since 8.21 (early June 2020) include enhanced network code to update the value of "MissionCommander" every ten seconds with the NetworkId of the player that has been using the highest value among the ten that are valid. I have also already enhanced LAC's Morse Code Radio to detect incoming commands structured with eight "C" characters followed by a single digit, which updates a new, global, unsigned character variable named "MissionChronoMilestone". Both of those two new global variables can be consulted by mission designers at any time.
Accordingly, Mission designers can define as many as 10 "MissionChronoMilestones", each of which can precisely map the locations, orientations, velocities, and alive/dead status of any important mission objects that might move around and which ought to be robustly synchronized across all players. At any time, the player designated as "MissionCommander" can command all players to activate the mission-wide positions, orientations, and status corresponding with any of those ten Milestones. After that, any trusted player can invert the alive/dead status of any of those 10 separate mission objects to ensure that the other players see the same mix of object positions and object alive/dead status that he sees.
As of this update in early July of 2020, all seven of our sample missions (those marked "TEST" in the menus) incorporate all of this "MissionChronoMilestone" logic, and those that include moving aircraft carriers exchange MissionChronoMilestone messages and synchronize carrier locations across all participating players as described above. New Mission Designers can use those existing sample missions as a pattern for their work as they enhance the simple circlular navigation of those existing aircraft carriers in more sophisticated missions, or as they add more strategic Mobile MissionObjects.
Last edit: bbosen 2020-07-14