Difference between revisions of "Documentation/Engine/Detours"

From SCS Modding Wiki
Jump to navigation Jump to search
Line 19: Line 19:
 
= Data units =
 
= Data units =
 
Similar to the road events, detours work with one master unit describing general behaviour of the feature and then with units describing closure and event visualization for different lanes and roads.
 
Similar to the road events, detours work with one master unit describing general behaviour of the feature and then with units describing closure and event visualization for different lanes and roads.
 +
 +
= Master data unit =
 +
<pre>
 +
SiiNunit
 +
{
 +
 +
journey_events_detour_data : .master
 +
{
 +
    min_game_time_delay: 2400 // 4 (hours) * 60 (hour2min) * 20 (map scale) / 2 (some time spend in city)
 +
max_game_time_delay: 4800 // 8 (hours) * 60 (hour2min) * 20 (map scale) / 2 (some time spend in city)
 +
    minimal_level:              2
 +
}
 +
 +
}
 +
</pre>
  
 
== Cutscenes data unit ==
 
== Cutscenes data unit ==
 
Because DE are part of the journey event framework, they use the same cutscene units as the random road events.
 
Because DE are part of the journey event framework, they use the same cutscene units as the random road events.
 
You can see detailed descriptions of the cutscene unit here: [[Documentation/Engine/Random Road Events#Cutscenes_for_random_events]]
 
You can see detailed descriptions of the cutscene unit here: [[Documentation/Engine/Random Road Events#Cutscenes_for_random_events]]

Revision as of 12:11, 21 December 2018

Detour preview 1
Detour preview 2

Detours (DE) are dynamically generated situations causing closure of a whole road.

DE are procedurally generated and do not need specific data definition for specific detours. Only things you need to provide are cutscenes for road closure, road blocks and for the detour cause event.

How does it work?

There are several conditions which must be met to generate detour.

  • Player must take an offline job.
  • There must be enough time passed since the last detour.
  • Job GPS route must contain suitable road for closure.

When player take an offline job, the game analyze the found GPS route and if it finds any valid detours, game chooses it. When there are multiple valid detours, the game chooses randomly one of them.

You may noticed that there is no mention of cutscenes. It is because the analyzation algorithm do not consider provided cutscenes for closure visualization (because of performance). Cutscene are generated when player approach the closure and only at this time the game search for correct cutscene.

Data units

Similar to the road events, detours work with one master unit describing general behaviour of the feature and then with units describing closure and event visualization for different lanes and roads.

Master data unit

SiiNunit
{

journey_events_detour_data : .master
{
    min_game_time_delay:		2400		// 4 (hours) * 60 (hour2min) * 20 (map scale) / 2 (some time spend in city)
	max_game_time_delay:		4800		// 8 (hours) * 60 (hour2min) * 20 (map scale) / 2 (some time spend in city)
    minimal_level:              2
}

}

Cutscenes data unit

Because DE are part of the journey event framework, they use the same cutscene units as the random road events. You can see detailed descriptions of the cutscene unit here: Documentation/Engine/Random Road Events#Cutscenes_for_random_events