Euro Truck Simulator 2

Euro Truck Simulator 2

View Stats:
adishrtv Jun 25, 2020 @ 8:00am
Ai mods
Can anyone help me how to make ai related mods or connect me to someone who create ai mods? I am totally interested and dedicated to make some tweaks with ai
< >
Showing 1-9 of 9 comments
Underscore_101_3 Jun 25, 2020 @ 8:49am 
Are you looking at AI traffic behaviour, or realistic company mods that may or may not add other kinds of traffic?
adishrtv Jun 25, 2020 @ 8:56am 
Originally posted by Underscore_101_3:
Are you looking at AI traffic behaviour, or realistic company mods that may or may not add other kinds of traffic?
Yes, i want to make a mod related to ai traffic behavior.
mojo_musica Jun 25, 2020 @ 10:23am 
Originally posted by adishrtv:
Originally posted by Underscore_101_3:
Are you looking at AI traffic behaviour, or realistic company mods that may or may not add other kinds of traffic?
Yes, i want to make a mod related to ai traffic behavior.

Do you program or write code for a living?
Are you totally familiar with creating Artificial Intelligence algorithms?
Before you start this project, do you know how the existing AI for traffic is implemented in the game?
What programming language does it use and which programming language are you going to use?

It may prove to be a little bit more complicated than skinning a truck or making accessories.

I wonder why nobody has made a mod like that before?
mojo_musica Jun 25, 2020 @ 5:14pm 
Originally posted by huskycorgi:
https://ets2.lt/en/search/car+traffic/

Is that just car mods? It looks like just car mods.
Does it alter the AI behaviour of traffic, like the OP is thinking of doing?
Underscore_101_3 Jun 25, 2020 @ 7:40pm 
You have all the files you need in the def files of the game, they are the same files modders use to alter AI behaviour.

I've never messed with them myself for AI traffic, but to find them you need to extract def.scs from: C:\Program Files (x86)\Steam\steamapps\common\Euro Truck Simulator 2

Find the files you need to change and make a mod for it using the same folder structure.

For more information i suggest the official SCS forum:
https://forum.scssoft.com/
and
https://modding.scssoft.com/wiki/Tutorials

Also, Google is your friend.
Last edited by Underscore_101_3; Jun 25, 2020 @ 7:42pm
adishrtv Jun 25, 2020 @ 9:25pm 
Originally posted by mojo_musica:
Originally posted by adishrtv:
Yes, i want to make a mod related to ai traffic behavior.

Do you program or write code for a living?
Are you totally familiar with creating Artificial Intelligence algorithms?
Before you start this project, do you know how the existing AI for traffic is implemented in the game?
What programming language does it use and which programming language are you going to use?

It may prove to be a little bit more complicated than skinning a truck or making accessories.

I wonder why nobody has made a mod like that before?
Yes,i am a software developer. I also know about machine learning and AI
adishrtv Jun 25, 2020 @ 9:25pm 
Originally posted by Underscore_101_3:
You have all the files you need in the def files of the game, they are the same files modders use to alter AI behaviour.

I've never messed with them myself for AI traffic, but to find them you need to extract def.scs from: C:\Program Files (x86)\Steam\steamapps\common\Euro Truck Simulator 2

Find the files you need to change and make a mod for it using the same folder structure.

For more information i suggest the official SCS forum:
https://forum.scssoft.com/
and
https://modding.scssoft.com/wiki/Tutorials

Also, Google is your friend.
I am looking for the exact file that changes the traffic behavior.thanks mate
Karlia (Banned) Jun 25, 2020 @ 11:08pm 
What you are looking for is the traffic_data.sii unfortunately it has very little to offer in its vanilla form as many are commented out and or ommited.
SiiNunit { # For modders: Please do not modify this file if you want to add a new entry. Create in # this directory a new file "<base_name>.<idofyourmod>.sii" where <base_name> is name of # base file without the extension (e.g. "city" for "/def/city.sii") and <idofyourmod> is # some string which is unlikely to conflict with other mod. # # Warning: Even if the units are specified in more than one source file, they share the # same namespace so suffixes or prefixes should be used to avoid conflicts. traffic_data : .traffic.data { # max_vehicle_count: 50 # Total AI vehicle count limit (including trucks) ## Global AI safety modifier - influences 'safety factor' for all AI vehicles ## Valid values: <-1;1> where '-1' means 'minimum safety for all' and '1' means 'maximum safety for all' ## Vehicles with low safety factor tend to brake more abruptly, use low spacing distances, use lights later in case of low visibility... # # ai_safety_modifier: 0.3 ## Global AI patience modifier - influences 'patience factor' for all AI vehicles ## Valid values: <-1;1> where '-1' means 'minimum patience for all' and '1' means 'maximum patience for all' ## Vehicles with low patience factor tend to overtake more often, have lower waiting times (e.g. when yielding), use horns sooner (when blocked)... # # ai_patience_modifier: 0.0 ## Horn and blink delay intervals - how long before an AI vehicle uses its horn (e.g. when blocked) ## or lights (e.g. when yielding) to notify other vehicle about something ## The actual value used depends on vehicle's 'patience factor': lower patience -> lower delay # # ai_horn_delay: (4.0, 8.0) # ai_blink_delay: (3.0, 6.0) ## Yield attributes. If a vehicle (including player's one) is forced to give way to other ones for too long time, a 'yield event' can occur. ## This should help reducing traffic jams, which can occur at small roads during rush hours. ## To make a vehicle yield to another one, the following conditions must be met: ## ## 1. Vehicles must be on 'small roads' (max 1 lane in each direction) ## 2. The speed of the driving vehicle must not be higher than 'ai_yield_max_speed' [m/s] ## 3. The waiting vehicle must have been waiting at least 'ai_yield_wait_time' [s]. ## 4. Yielding vehicle waits for the other one until it moves, but only for 'ai_yield_timeout' [s]. If nothing happens, yielding is cancelled. ## ## The actual values used depend on yielding vehicle's 'patience factor': # # ai_yield_max_speed: (18.0, 26.0) # lower patience -> lower speed # ai_yield_wait_time: (20.0, 30.0) # lower patience -> higher wait time # ai_yield_timeout: (3.0, 5.0) # lower patience -> lower timeout ## Obsolete attributes: # # mass_truck: 10500.0 # the attribute is obsolete - mass is now set per-vehicle # mass_trailer: 20000.0 # the attribute is obsolete - mass is now set per-vehicle # mass_car: 2000.0 # the attribute is obsolete - mass is now set per-vehicle # max_truck_count: 4 # the attribute is obsolete - vehicle max count is now set per vehicle type ai_displacement_curve_coef: 0.65 # limit curve displacement in curves ## Drag length limits - virtually 'shortens' vehicles/trailers to allow then to turn in sharp curves ## This attribute affects only on vehicles/trailers which are LONGER than the values set. ## The side effect of 'shortening' is that vehicles/trailers slide to sides when turning. ## It is more noticeable when the real length is much bigger than the limit # ai_drag_length_limits[0]: 6.0 # vehicles ai_drag_length_limits[1]: 10.0 # trailers } }

Here is a copy of mine with extra parameters if you wish to play with it.
to activate it, just make a new folder in your mod folder, call it say "traffic" or what ever without the quotes. inside that folder make a "def" folder and drop it in there as traffic_data.sii, then activate it in the mod manager, from there you can tweak as you wish.
You may need to change the numbers on this line to suit "max_vehicle_count: 650 # Total AI vehicle count limit (including trucks)" the default is 50

SiiNunit { traffic_data : .traffic.data { max_vehicle_count: 650 # Total AI vehicle count limit (including trucks) sound_distance: (9.500, 225.000) sound_volume: (0.000, 1.500) ai_horn_delay: (30.0, 60.0) ai_blink_delay: (3.0, 4.5) ai_overtake_time: 9.0 #14.0 ai_change_lane_time: 6.5 ai_change_lane_distance: 18.0 ai_speed_threshold: 1.0 ai_acceleration_threshold: 1.0 ai_patience_modifier: 0.0 ai_patience_time: (0.02, 0.4) ai_caution_time: (0.02, 0.2) speed_lane_intervals_min: 200 speed_lane_default: 140 ai_speed_coef_sunlight: (0.92, 1.1) ai_speed_coef_wetness: (0.95, 0.98) ai_speed_coef_fog: (0.90, 0.97) ai_yield_max_speed: (18.0, 26.0) # lower patience -> lower speed ai_yield_wait_time: (20.0, 30.0) # lower patience -> higher wait time ai_yield_timeout: (3.0, 5.0) # lower patience -> lower timeout ai_deceleration_coef: (0.15, 0.35) ai_acceleration_threshold: 100 ai_avoid_speed_coef: (0.95, 1.35) ai_displacement_curve_coef: 0.65 # limit curve displacement in curves ai_drag_length_limits[0]: 6.0 # vehicles ai_drag_length_limits[1]: 10.0 # trailers } }
And finally here is a list of all the parameters I know of, there may be some redundant ones in it now as the list a getting on in age and the values are not at default.
max_vehicle_count: 50 ai_drag_length_limits[0]: 6.0 # vehicles ai_drag_length_limits[1]: 10.0 # trailers ai_safety_modifier: 0.0 ai_patience_modifier: -0.7 ai_horn_delay: (5.0, 10.0) ai_blink_delay: (3.0, 6.0) ai_yield_max_speed: (18.0, 26.0) ai_yield_wait_time: (20.0, 30.0) ai_yield_timeout: (3.0, 5.0) spawn_items_update_delay: 0.0 speed_lane_default: 140 speed_lane_coef_gap: 15 #speed_lane_coef_range: (1.2, 1.2) ai_low_probability_coef: 0.2 ai_avoid_speed_coef: (1.5, 1.2) #ai_lights_on_sunlight:(0.95, 0.97) ai_speed_coef_wetness: (0.95, 0.95) ai_speed_coef_fog: (0.85, 0.95) spawn_distance_min: 100.0 ai_acceleration_threshold: 3.0 ai_deceleration_coef: (0.32, 0.40) #ai_speed_threshold: 15.0 #spawn_distance_backward: 500.0 #spawn_distance_forward: 700.0 remove_distance_backward: 2500.0 remove_distance_forward: 2000.0 spawn_frequency_bias: (0.001,0.0000001) #spawn_frequency_bias: (1.0, 10.0) vehicle_mass_slope_coef: 1.2 vehicle_mass_speed_min: 6.0 ai_patience_time: (0.3, 0.6) ai_caution_time: (0.1, 0.4) ai_avoid_speed_coef: (1.3, 1.2) ai_safe_distance_crash: 20.0 ai_spacing_time: (1.0, 1.5) ai_stop_distance: (1.5, 2.0) #sound_pitch_coef: (0.75, 1.25) #sound_pitch_speed: (-50, 50) #sound_pitch: (0.1, 1.9) #sound_distance: (5.0, 150.0) #sound_volume_speed: (5.0, 25.0) #sound_volume: (0.33, 2.0) #sound_volume_coef: (1.0, 2.0) ai_speed_coef_curvature: (0.87, 0.96) ai_displacement_curve_coef: 0.65 ai_speed_coef_preferred: (1.2, 1.1) ai_blinker_time: (0.33, 0.66) ai_blinker_offset: (0.1, 0.9) ai_revive_distance_base: 0.02 ai_revive_delay: (6.0, 8.0) ai_revive_delay_dir_coef: 1.1 #ai_revive_speed_limit: #ai_revive_wheel_speed_limit: ai_revive_distance_limit: 10.0 ai_revive_distance_limit: 150.0 ai_revive_timeout: 0.5 ai_revive_crash_delay: 5.5 ai_revive_reverse_len: 0.33 ai_revive_reverse_offset: 0.33 ai_change_lane_time: 4.0 ai_change_lane_distance: 30.0 #speed_safe_range: (15.0, 35.0) ai_item_cache_time: 10.0 ai_item_cache_distance_min: 2500 ai_overtake_time: 20.0 ai_speed_coef_dangerous_actor: (0.33, 0.66) #vehicle_cache_size: 3 #vehicle_cache_refresh: 0.5 wheel_suspension_damping_coef: 0.02 wheel_slope_threshold: 0.20 wheel_fixed_width: 100.0 wheel_lower_stop: -0.025 wheel_upper_stop: 0.15 speed_lane_intervals_min: 2500
Happy modding :)
Last edited by Karlia; Jun 26, 2020 @ 1:29am
< >
Showing 1-9 of 9 comments
Per page: 1530 50

Date Posted: Jun 25, 2020 @ 8:00am
Posts: 9