Changes

Jump to navigation Jump to search

Games/ATS/Modding guides/1.29

7,408 bytes added, 07:54, 27 April 2018
Changes
* If the load failed because of some removed templates (e.g. road look us_tmpl5), copy corresponding definitions from previous versions.
* Try to save it. The save might fail because of conflict between compounds. In that case check the game log without exiting the game (so you can easily repeat the save). If the log contains compound errors, you can fix them in the following way:
** <strong>"Compound X contains item Y which also exists as independent one" </strong> - use the g_delete_uid Y console command to delete the item.** <strong>"Duplicate item X found in compounds:" </strong> - use the find dialog to find one from the compounds and dismiss it (using item properties). This will turn this into the previous case where compound conflicts with independent items.
* Do rebuild (F8)
* Save map
* Save map
= Changes = == New navigation data == New navigation algorithm uses detailed info from traffic lanes so it can take lane counts, direction and other things into consideration. Be careful to have correct navigation data in map. For example if crossing prefab does not have a AI lane for right turn, the navigation will not turn right even if that means that it will find a much longer path. The '''''map_data''''' unit in '''''/def/map_data.sii''''' contains a few attributes which can be used used to tweak the routing heuristic and the estimated driving time.  General values used by navigation:* '''''navigation_maximum_speed''''' (25.0) - Maximum reasonable speed used for navigation computations (in m/s). Keep it small to improve efficiency of the search.* '''''navigation_turn_back_length''''' (400000.0) - Length of artificial connections representing u-turn not allowed by AI lines.* '''''navigation_prefer_small_wide_road_penalty''''' (10.0) - Penalty applied to roads with more than one lane in a direction when using prefer_small_roads routing mode. Multiplicative.* '''''navigation_special_prefab_additive_penalty''''' (0.0) - Penalty in meters applied to paths going over special prefabs (e.g. gas stations) outside cities. Additive. Generally should be left at zero unless no gas/weight station prefab used in map includes normal road in addition to the gas station area.* '''''navigation_special_prefab_additive_penalty_city''''' (0.0) - Penalty in meters applied to paths going over special prefabs (e.g. gas stations) in cities. Additive. Usually should be left at zero, see '''''navigation_special_prefab_additive_penalty'''''.* '''''navigation_gps_avoid_additive_penalty''''' (20000.0) - Penalty in meters applied to paths going over roads or prefabs marked as "GPS Avoid". Additive. Weights used for path finding in '''''prefer_shorter''''' routing mode.* '''''navigation_city_penalty''''' (1.0) - Penalty applied to paths through city area. Multiplicative* '''''navigation_slow_road_penalty''''' (5.0) - Penalty applied to paths through slow time area. Multiplicative Weights used for path finding in '''''best''''' routing mode:* '''''navigation_narrow_road_max_speed_usage''''' (0.8) - Portion of maximal speed to use on narrow roads.* '''''navigation_road_max_speed_usage''''' (0.9) - Portion of maximal speed to use on normal roads.* '''''navigation_city_or_slowtime_speed_penalty''''' (0.25) - Penalty applied to speed when driving through city or slow time area. Multiplicative.* '''''navigation_semaphore_wait_duration''''' (90.0) - Time cost of going through semaphore in game-time seconds.* '''''navigation_stop_wait_duration''''' (60.0) - Time cost of going through stop sign in game-time seconds.* '''''navigation_turn_own_side_duration''''' (15.0) - Time cost of turning to the own side (e.g. right in USA/continental, left in UK). Additive.* '''''navigation_turn_oposite_side_duration''''' (45.0) - Time cost of turning to the oposite side (e.g. left in USA/continental, right in UK). Additive. Weights used for time evaluation:* '''''navigation_time_narrow_road_max_speed_usage''''' (0.8) - Portion of maximal speed to use on narrow roads - time calculation.* '''''navigation_time_road_max_speed_usage''''' (0.9) - Portion of maximal speed to use on normal roads - time calculation.* '''''navigation_time_city_or_slowtime_speed_penalty''''' (0.85) - Penalty applied to speed when driving through city or slow time area - time calculation. Multiplicative.* '''''navigation_time_semaphore_wait_duration''''' (60.0) - Time cost of going through semaphore in game-time seconds - time calculation.* '''''navigation_time_stop_wait_duration''''' (30.0f) - Time cost of going through stop sign in game-time seconds - time calculation.* '''''navigation_time_turn_own_side_duration''''' (10.0f) - Time cost of turning to the own side (e.g. right in USA/continental, left in UK) - time calculation. Additive.* '''''navigation_time_turn_oposite_side_duration''''' (30.0) - Time cost of turning to the oposite side (e.g. left in USA/continental, right in UK) - time calculation. Additive. A road items in editor can be marked with "GPS Avoid" flag. This will cause the navigation to apply a huge penalty to paths using this road. There is no such flag for prefab items however prefab_model definition supports a gps_avoid attribute which will enable it for all uses of that prefab in map. == Prefabs == The prefab format was changed to include separate data for use by the new navigation. The game should be able to automatically convert old prefabs with correctly formed AI lines and new version of conversion tools will generate them automatically. === Format changes === The new format adds navigational nodes. They are derived from both normal prefab nodes and AI curves. Each navigational node corresponds to either normal node or to end point of AI curve. Basically it is a simplified graph over AI curves representing places important for the navigation (e.g. for of AI lane) to reduce the size of the navigational graph. The table of navigational nodes is stored in the same way as other tables. Offset and size of this table is stored directly after matching fields for intersection table. Each navigational node has the following format  <nowiki>u8 type; // Type of node. 0 = physical node, 1 = AI curveu16 index; // Depending on the type it is either index of normal node or index of AI curve to whose ending point this nav node correspondsu8 connection_count; // Number of outgoing connections leading to other navigational nodes (0-4)connection_info connections[4]; // Information about those connections. First connection_count entries are used. Rest is set to {{Note|Work In Progress }0xffff, MAX_FLOAT, 0, 0xffff[8]}</nowiki> Each connection info structure has the following format  <nowiki>u16 target_node; // Index of navigational node this connection leads tofloat length; // Length of the connection in metersu8 curve_count; // Number of AI curves the connection is created from, limited to 8, if more would be necessary, insert additional nav nodeu16 curve_indices[8]; // Indices of the relevant AI curves in order they should be used. First curve_count entries are used, reset is set to 0xffff.</nowiki>
= Changes =Additionally the AI curve structure was changed by adding a u32 value at its end. This value contains index of a navigational node which should be used if navigation starts from that AI curve or 0xffffffff if there is none. Basically it is a reverse mapping to the curve_indices from from nodes.
== Flares Data data ==
Flare blink unit (usually found as hookup defined models inside '''''/unit/hookup''''' directory) was reworked to use blinking pattern instead of just simple ON and OFF delays. Thus '''''blink_delay_on''''' and '''''blink_delay_off''''' attributes were removed and replaced with '''''blink_pattern''''' and '''''blink_step_length'''''. Unit is now defined as follows:
Consequentially flare blink sync inherited attributes and behavior from flare blink unit and has the same two new attributes: '''''blink_pattern''''' and '''''blink_step_length'''''.
 
== Time zones data ==
 
Time zones are (for now) country based. Each country has defined '''''time_zone''''' (integer, in minutes) and '''''time_zone_name''''' (string). Eg. pacific daylight time is -420 minutes with "PDT" name.
 
In addition there is default timezone, stored in '''''economy_data''''' unit ('''''default_time_zone''''', '''''default_time_zone_name'''''), this is zone basic game time is expected int and its used every time where relevant spatial location and thus time zone is not known.
 
== Economy data ==
 
Some old values has been exported to '''''economy_data''''' unit ('''''/def/economy_data.sii''''') attributes:
* '''''tow_price_base''''' (150.0)
* '''''tow_price_factor''''' (0.4)
* '''''tow_time_base''''' (1800.0)
* '''''tow_time_factor''''' (3.0)
* '''''tow_fuel_ratio''''' (0.3)
* '''''truck_scales_cost''''' (10)
== Traffic ==

Navigation menu