Lou Montana/Sandbox – User

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Add some data, yet to be categorised/organised)
m (Update w/ links)
 
(41 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{SideTOC}}
[[Category: Sandbox]]
[[Category: Sandbox]]
{{Feature|informative|To go on [[Initialisation Order]].}}


= Mission Design =
{| class="wikitable sortable align-center align-left-col-1"
|+ Order of Initialisation (use column sorting for respective machine order)
! rowspan="2" class="unsortable" style="text-align: center" | Task
! rowspan="2" | Exec Environment
! rowspan="1" colspan="5" class="unsortable" | Machine
|-
! Single Player
! Dedicated Server
! Hosted Server
! Multiplayer Client
! [[Multiplayer Scripting#Join In Progress|JIP]] MP Client


[[Mission Design]] is an important aspect to consider in order to keep the player(s) entertained. '''Arma is a game''' after all!
|-
| [[Arma 3: Functions Library|Functions]] with <syntaxhighlight lang="cpp" inline>recompile</syntaxhighlight> {{Link|Arma 3: Functions Library#Attributes 3|attribute}} are recompiled
| {{n/a}}
| 1 <!-- Single Player -->
| 1 <!-- Dedicated Server -->
| 1 <!-- Hosted Server -->
| 1 <!-- Multiplayer Client -->
| 1 <!-- JIP MP Client -->


But what makes a mission ''enjoyable''? This page aims to define what players usually expect from a game:
|-
# Wanting to play through the whole mission
| [[Arma 3: Functions Library|Functions]] with <syntaxhighlight lang="cpp" inline>preInit</syntaxhighlight> {{Link|Arma 3: Functions Library#Attributes 3|attribute}} are called
# Seeing an effect to their actions
| [[Scheduler#Unscheduled Environment|Unscheduled]]
# In the end, having '''a sense of accomplishment'''.
| 2 <!-- Single Player -->
| 2 <!-- Dedicated Server -->
| 2 <!-- Hosted Server -->
| 2 <!-- Multiplayer Client -->
| 2 <!-- JIP MP Client -->


<!-- {{Informative | This page does not apply to all milsim-targeted missions, which may or may not be completely "eventless"!}} -->
|-
| Object Init Event Handlers are called
| [[Scheduler#Unscheduled Environment|Unscheduled]]
| 3 <!-- Single Player -->
| 3 <!-- Dedicated Server -->
| 3 <!-- Hosted Server -->
| 3 <!-- Multiplayer Client -->
| {{Icon|unchecked}} <!-- JIP MP Client -->


|-
| Expressions of [[Eden Editor: Configuring Attributes|Eden Editor entity attributes]] are called<ref name="isPlayer"><sqf inline>isPlayer _entity</sqf> does not return [[true]] immediately. Once the entity has become a [[player]], it is transferred to the client.</ref>
| [[Scheduler#Unscheduled Environment|Unscheduled]]
| 4 <!-- Single Player -->
| 4 <!-- Dedicated Server -->
| 4 <!-- Hosted Server -->
| {{Icon|unchecked}} <!-- Multiplayer Client -->
| {{Icon|unchecked}} <!-- JIP MP Client -->


== Mission Structure ==
|-
| Object initialisation fields are called
| [[Scheduler#Unscheduled Environment|Unscheduled]]
| 5 <!-- Single Player -->
| 5 <!-- Dedicated Server -->
| 5 <!-- Hosted Server -->
| 4 <!-- Multiplayer Client -->
| 3 <!-- JIP MP Client -->


=== Gameplay Structure ===
|- style="background-color: #95F0AD"
| [[Event Scripts#init.sqs|init.sqs]] is executed
|
| 6 <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


{{wip}}
|- style="background-color: #95F0AD"
| [[Event Scripts#init.sqf|init.sqf]] is executed
| [[Scheduler#Scheduled Environment|Scheduled]]<ref name="enginewaits">Note '''in single player''' that while the environment is [[Scheduler#Scheduled Environment|Scheduled]] ([[canSuspend]] returns true), the engine seems to wait until the script is done executing, essentially behaving similarly to an [[Scheduler#Unscheduled Environment|Unscheduled environment]] - infinite loops will freeze the game, [[uiSleep]] may pause the game for up to ~20s (postInit), [[waitUntil]] can cause catastrophic issues, etc.</ref>
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


=== Narrative Structure ===
|-
| Expressions of [[Eden Editor: Configuring Attributes|Eden Editor scenario attributes]] are called<ref name="playerCommandNotAvailable">[[player]] is not available immediately.</ref>
| [[Scheduler#Unscheduled Environment|Unscheduled]]
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


{{Informative | The narrative structure only applies to story-driven scenarios and does not have to be respected for missions that are mostly focused on immersion/gameplay.}}
|- style="background-color: #95DEF0"
The basics are that most stories follow the {{Wikipedia|Narrative_structure|narrative structure}}, which can be boldly boiled down to the following step:
| Persistent functions are called
|
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


# An initial situation
|-
#* The initial situation does not have to be peaceful or positive
| [[Modules]] are initialised
#* [[:Category:Briefing|Briefing]] can be used to provide some background without having to create it in-game
|
# An occuring event, bringing imbalance to the situation
| <!-- Single Player -->
#* The origin of it is not always coming from the designated or future enemy
| <!-- Dedicated Server -->
#* The event can or can not come from a player's action
| <!-- Hosted Server -->
# Actions and resulting events
| <!-- Multiplayer Client -->
#* Actions can be taken against said event, but also (and/or) against its consequences
| {{Icon|unchecked}} <!-- JIP MP Client -->
# A ''dénouement'', meaning the end of actions and situation evolution, it can be:
#* A lead to solve the initial situation
#* A way to escape it
#* Reaching the goal set by it
# Ending
#* Ending does not always mean problem resolution; it can be:
#** Reducing the damages provoked by event's consequences
#** Leaving the immediate danger
#** Solving the initial problem and getting everything back to normal.


|- style="background-color: #DEF0AD"
| [[Event Scripts#initServer.sqf|initServer.sqf]] is executed
| [[Scheduler#Scheduled Environment|Scheduled]]
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| {{n/a}} <!-- Multiplayer Client -->
| {{n/a}} <!-- JIP MP Client -->


== Mission Goal ==
|- style="background-color: #DEF0AD"
| [[Event Scripts#initPlayerLocal.sqf|initPlayerLocal.sqf]] is executed
| [[Scheduler#Scheduled Environment|Scheduled]]
| <!-- Single Player -->
| {{n/a}} <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


While the ''mission's'' goal can remain hidden or obscure to the player, his ''current'' goal must be crystal clear. For example, the end goal of "fighting back" can remain hidden, but the first goal of "patrol the camp" must be made obvious so the player is not at loss and feels he has something to accomplish.
|- style="background-color: #DEF0AD"
| [[Event Scripts#initPlayerServer.sqf|initPlayerServer.sqf]] is executed on the server
| [[Scheduler#Scheduled Environment|Scheduled]]
| <!-- Single Player -->
| {{n/a}} <!-- Dedicated Server -->
| ?? <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


|-
| [[Arma 3: Functions Library|Functions]] with <syntaxhighlight lang="cpp" inline>postInit</syntaxhighlight> {{Link|Arma 3: Functions Library#Attributes 3|attribute}} are called
| [[Scheduler#Scheduled Environment|Scheduled]]<ref name="enginewaits"/>
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


== Action/Reward ==
|- style="background-color: #95DEF0"
| [[Event Scripts#init.sqs|init.sqs]] is executed
| [[Scheduler#Scheduled Environment|Scheduled]]
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


The meat of player's interest is here: an achieved goal must reward the player with an evolution: either a reward (new intel, less enemies, easier progress) or a scenario evolution (enemy counterattack, reinforcements incoming, radio update).
|- style="background-color: #95DEF0"
| [[Event Scripts#init.sqf|init.sqf]] is executed
| [[Scheduler#Scheduled Environment|Scheduled]]
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


|-
| [[remoteExec]]'s [[Multiplayer Scripting#Join In Progress|JIP]] queue
| {{n/a}}
| {{n/a}} <!-- Single Player -->
| {{n/a}} <!-- Dedicated Server -->
| {{n/a}} <!-- Hosted Server -->
| {{n/a}} <!-- Multiplayer Client -->
| 42 <!-- JIP MP Client -->


== Multiplayer Specifics ==
|- style="background-color: #EEE"
| ''Scenario going''
| {{n/a}}
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


* Teamplay and cooperation
|-
* Winning over the other team (if PvP)
| [[Event Scripts#exit.sqf|exit.sqf]]
|
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


|-
| [[Event Scripts#exit.sqs|exit.sqs]]
|
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


== Examples ==
|-
| {{Link|Arma 3: Mission Event Handlers#Ended|"Ended" Mission Event Handler}}
|
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


{| class="wikitable"
! Initial Situation !! Event !! Actions !! Dénouement !! Ending !! Notes
|-
| During blufor/opfor war, a specops operation at night with the objective to blow up enemy tanks || {{n/a}} || '''Player's role:''' fulfilling the mission || Tanks are blown up || Extraction || This scenario may look bland, and should therefore focus on '''immersion''' and '''achievement'''
|-
| During blufor/opfor war, a specops operation at night with the objective to blow up enemy tanks || {{n/a}} || '''Player's role:''' fulfilling the mission || Tanks are blown up || Extraction || This scenario may look bland, and should therefore focus on '''immersion''' and '''achievement'''
|-
| Normal day || Enemies attack the base || Riposting, taking fire<br>'''Player's role:''' take strategical shooting positions and cover fellow soldiers || Killing/defeating all the enemies || Back to normal || Same as above, the scenario might be seen as too simple ("defending") and immersion should be prioritised
|-
|-
| Normal day || Nuclear attack || Panic, explosions, firefights<br>'''Player's role:''' survive || Getting to a long-range radio || HQ sends a team to extract the player || This whole scenario is based on player's survival
| {{Link|Arma 3: Mission Event Handlers#MPEnded|"MPEnded" Mission Event Handler}}
|}
|
| <!-- Single Player -->
| <!-- Dedicated Server -->
| <!-- Hosted Server -->
| <!-- Multiplayer Client -->
| <!-- JIP MP Client -->


-----
-----
↓ anyone feels like filling the table below…? ↓
= Arma 3: Vehicles Data =
''Arma 3: Vehicles Data: Fuel and Speed?''
{| class="bikitable sortable"
!rowspan="2" | Class !! rowspan="2" | Name !! colspan="4" | Full tank consumption time !! colspan="3" | Speed
|-
! Idle !! slow speed !! medium speed !! max speed !! slow speed !! medium speed !! max speed
|-
| B_Truck_01_mover_F || HEMTT || 05:18:00 || 03:15:00 || 03:38:00 || 03:18:00 || 026,83 km/h || 070,94 km/h || 082,85 km/h
|-
| B_MRAP_01_F || Hunter (unarmed) || 04:33:00 || 02:47:00 || 01:56:00 || 01:44:00 || 037,13 km/h || 099,81 km/h || 116,45 km/h
|-
| B_LSV_01_unarmed_F || Prowler (unarmed) || 04:09:00 || 01:38:00 || 01:50:00 || 01:38:00 || 053,96 km/h || 147,06 km/h || 172,47 km/h
|-
| B_Quadbike_01_F || Quad || 01:54:00 || 01:09:00 || 01:12:00 || 01:06:00 || 027,14 km/h || 070,77 km/h || 082,20 km/h
|-
| B_APC_Tracked_01_AA_F || IFV-6a Cheetah || 03:11:00 || 02:07:00 || 02:14:00 || 01:56:00 || 023,31 km/h || 046,31 km/h || 061,07 km/h
|-
| B_APC_Wheeled_01_cannon_F || AMV-7 Marshall || 04:55:00 || 02:58:00 || 02:58:00 || 02:34:00 || 036,20 km/h || 060,41 km/h || 113,00 km/h
|-
| B_APC_Tracked_01_CRV_F || CRV-6e Bobcat || 03:11:00 || 02:05:00 || 02:13:00 || 01:55:00 || 023,31 km/h || 046,31 km/h || 061,07 km/h
|}
|}


Code used:
<spoiler><pre>veh = vehicle player;
wantedDelta = 3;
previousPos = [0,0,0];
currentPos = [0,0,0];
previousFuel = 0;
currentFuel = 0;
t = 0;
onEachFrame {
isNil {
vehSpeed = speed veh;
if (t <= time) then {
previousPos = currentPos;
currentPos = getPosATL veh;
distanceDelta = currentPos distance previousPos;
previousFuel = currentFuel;
currentFuel = fuel veh;
fuelLossPerMinute = (previousFuel - currentFuel) * (60 / (wantedDelta + (time - t)));
remainingTime = if (fuelLossPerMinute > 0) then {
[(currentFuel / fuelLossPerMinute) * 60, "HH:MM:SS"] call BIS_fnc_secondsToString;
} else { -1 };
timeToEmpty = if (fuelLossPerMinute > 0) then {
[(1 / fuelLossPerMinute) * 60, "HH:MM:SS"] call BIS_fnc_secondsToString;
} else { -1 };
t = time + wantedDelta;
};


hintSilent format [
== See Also ==
"Speed: %1\nFuel loss: %2\n\nRemaining time: %3\nTime to empty: %4",
vehSpeed,
fuelLossPerMinute,
remainingTime,
timeToEmpty];


copyToClipboard format ["[%1, %2, %3]", typeOf veh, timeToEmpty, vehSpeed];
* [[Arma 3: Functions Library]]<!--
};
* [[Arma 2: Functions Library]] -->
};
* [[Arma 3: Remote Execution]], [[BIS_fnc_MP]] <!-- keep? -->
</pre></spoiler>
* [[Eden Editor: Configuring Attributes|Eden Editor: Configuring Attributes]]
* [[Event Scripts]]
* [[Scheduler]]

Latest revision as of 00:29, 18 March 2024

Order of Initialisation (use column sorting for respective machine order)
Task Exec Environment Machine
Single Player Dedicated Server Hosted Server Multiplayer Client JIP MP Client
Functions with recompile attribute are recompiled N/A 1 1 1 1 1
Functions with preInit attribute are called Unscheduled 2 2 2 2 2
Object Init Event Handlers are called Unscheduled 3 3 3 3 Unchecked
Expressions of Eden Editor entity attributes are called[1] Unscheduled 4 4 4 Unchecked Unchecked
Object initialisation fields are called Unscheduled 5 5 5 4 3
init.sqs is executed 6
init.sqf is executed Scheduled[2]
Expressions of Eden Editor scenario attributes are called[3] Unscheduled
Persistent functions are called
Modules are initialised Unchecked
initServer.sqf is executed Scheduled N/A N/A
initPlayerLocal.sqf is executed Scheduled N/A
initPlayerServer.sqf is executed on the server Scheduled N/A ??
Functions with postInit attribute are called Scheduled[2]
init.sqs is executed Scheduled
init.sqf is executed Scheduled
remoteExec's JIP queue N/A N/A N/A N/A N/A 42
Scenario going N/A
exit.sqf
exit.sqs
"Ended" Mission Event Handler
"MPEnded" Mission Event Handler


See Also

  1. isPlayer _entity does not return true immediately. Once the entity has become a player, it is transferred to the client.
  2. 2.0 2.1 Note in single player that while the environment is Scheduled (canSuspend returns true), the engine seems to wait until the script is done executing, essentially behaving similarly to an Unscheduled environment - infinite loops will freeze the game, uiSleep may pause the game for up to ~20s (postInit), waitUntil can cause catastrophic issues, etc.
  3. player is not available immediately.