1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Dedicated Server - Dynamic Race Bot [DRB]

Discussion in 'Automobilista 2 - General Discussion' started by Svenny, Dec 25, 2023.

  1. Mikk Schleifer

    Mikk Schleifer Active Member AMS2 Club Member

    Joined:
    Nov 30, 2019
    Messages:
    209
    Likes Received:
    182
    0.4.2 and lua 0.4.3 workin fine here
     
    • Like Like x 1
  2. Diesels

    Diesels New Member

    Joined:
    Dec 27, 2024
    Messages:
    13
    Likes Received:
    3
    I can try that tomorrow, a litte bit more busy atm, sorry.
     
  3. Diesels

    Diesels New Member

    Joined:
    Dec 27, 2024
    Messages:
    13
    Likes Received:
    3
    So this new one also did not work, and I am beginning to think this is some mistake on my side.
    This is the ams2_drb_config.json that i use. It works with 0.4.1 but not 0.4.2 0.4.3 and the newest one.
    Code:
    // Config version.
    version : 4
    
    // Default configuration.
    config : {
    
        // Is the current rotation index persistent? If true, the rotation will continue after server restart,
        // If false, the rotation will always start from the first setup.
        // You can always delete the sms_rotate_data.json file from lua_config to reset the persisted index.
        "persist_index" : true,
    
        // Default = false
        // Setting to true will output to console certain results  
        "welcome_msg": true,
        "announce_bot" : "[DRB]: Dynamic Race System is running on this server.",
        "send_combo_info": true,
        // Please keep as short as possible - long message don't get split and horizontal scrolling in game chat isn't great.
        "community_msg": "",
        "voice_chat_msg": "",
    
        // Server Admins
        // Admins regardless of if host or not can issue commands via in game chat.
        // Commands:
        // "advance" : Advances session to next or if in Race, resets race to start.
        // "reset" : performs a soft restart of server - destroys session and will need to load back into lobby
        // "+" : Whilst in lobby, admin can skip current combo and generate new combo.
        // "kp" : Will kick player from server. eg type in chat "kp Svenny". It will find player with that name and kick them and ban them for x secs.
        // If the player being kicked is an admin, it will fail..
        // Multiple admins are allowed, just need to separate each with a comma. eg: "72315679455879643,79666345689456463"
        "ingame_admins_steamids" : "mysteamid",
        "ban_secs" : 600,
    
        // Set to true to have all races use to Dedicated Servers date.
        // If false, dates are as per track defaults.
        "use_current_date" : false,
        // Dynamic Dates are randomly selected between default track dates and current date
        "use_dynamic_date" : true,
    
        // Default true
        // This disables the rotation section below and selects track and vehicles/classes
        //  from the none commented out tracks, vehicles/vehicle classes below
        "full_dynamic_system" : true,
        "enable_dynamic_combos": true,
        "enable_dynamic_vehicles" : false,
        "enable_dynamic_vehicle_classes" : true,
    
        // Allow Multi class/track day sessions
        "enable_dynamic_multi_classes" : true,
        // Max is 10. Set to zero for DRB to randomly select number of slots
        "enable_dynamic_multi_classes_count" : 10,
    
        // Enabled by default
        // This will calculate weather probability over the rotation list.
        // If disabled, historical real time weather is used. Note that P/Q/R's *_time_progression must be set or defaults to 1
        "enable_dynamic_weather_system" : true,  
        "dynamic_weather_forecast"    : "MediumCloud",
        "dynamic_weather_probability"    : 10,
        // So the above probability factor is calculated over each session.
        // If rotations are configured it will be over rotations.
        // If NOT using rotations, define the probability of x race weekends. Default is 10.
        "dynamic_weather_probability_sessions"    : 10,
        // By default each slot simulates 60 mins.
        // 4 slots * 60 is 240mins, real-time stage length is 10 mins
        // to work out date/weather progression is 240 / stage length = 24
        // This value then gets rounded down to the nearest progression multiplier which is 20
        // NOTE: If a session's time progression is > 0 then that takes precedence over this calculation.
        "dynamic_weather_slot_duration": 60,
    
    
        // Enable Race stage timeframe
        "dynamic_race_timeframe" : true,
        // Enable Night Races. Default false
        "enable_night_races" : true,
        // Set the 24hr hour range for when the race can start
        // If enable_night_races is true, the below will be overriden in game with start = 0 and end = 23 for race session only..
        "dynamic_race_earliest_start_hour" : 5,
        "dynamic_race_latest_start_hour" : 22,
    
        // Stage Length and Max Number of Slots to randomise between.
        // Short stages should have low max slots to avoid rapid, unrealistic weather changes
        // Set length to zero to disable stage
        "practice_length_mins" : 45,
        // Max Number of Slots to randomise between.
        "practice_weather_slots_max" : 2,
        // Progression options are 1,5,10,15,20,25,30,35,40,45,50,55,60
        // Set this to zero to have DRB calculate it automatically
        "practice_time_progression": 0,
      
    
        // Stage Length.
        // Short stages should have low max slots to avoid rapid, unrealistic weather changes
        // Set length to zero to disable stage
        "qualify_length_mins" : 15,
        // Max Number of Slots to randomise between.
        "qualify_weather_slots_max" : 1,
        // Progression options are 1,5,10,15,20,25,30,35,40,45,50,55,60
        // Set this to zero to have DRB calculate it automatically
        "qualify_time_progression": 0,
      
    
        // Stage Length.
        // Short stages should have low max slots to avoid rapid, unrealistic weather changes
        // Set length to zero to disable stage
        // If raced_timed is false, race length is how many laps
        "race_length" : 45,
        "race_timed" : true,
        // Max Number of Slots to randomise between.
        "race_weather_slots_max" : 4,
        // Progression options are 1,5,10,15,20,25,30,35,40,45,50,55,60
        // Set this to zero to have DRB calculate it automatically
        "race_time_progression": 0,  
    
        // These are the weather events and the order in which that will be sorted and have factors applied.
        // Suggest to leave this as is and if you don't want a certain event to be used,
        // use the extreme weather events list below instead  
        "weather" : [
            {"name" : "Hazy","id" : 1,},
            {"name" : "Clear","id" : 2,},
            {"name" : "LightCloud","id" : 3,},
            {"name" : "MediumCloud","id" : 4,},
            {"name" : "HeavyCloud","id" : 5,},
            {"name" : "Overcast","id" : 6,},
            {"name" : "LightRain","id" : 7,},
            {"name" : "Rain","id" : 8,},
            {"name" : "Storm","id" : 9,},
            {"name" : "ThunderStorm","id" : 10,},
            {"name" : "Foggy","id" : 11,},
            {"name" : "FogWithRain","id" : 12,},
            {"name" : "HeavyFog","id" : 13,},
            {"name" : "HeavyFogWithRain","id" :14,},
            {"name" : "Random","id" :15,}
        ],
        // Weather Weight
        // Assign a value to each weather type. The higher the number the more weight is assigned to that weather
        // type
        // A weight of zero excludes this weather from the available weather types
        "weather_weight" : {
            "Hazy" : 5,
            "Clear" : 15,
            "LightCloud" : 12,
            "MediumCloud" : 10,
            "HeavyCloud" : 9,
            "Overcast" : 7,
            "LightRain" : 6,
            "Rain" : 0,
            "Storm" : 0,
            "ThunderStorm" : 0,
            "Foggy" : 4,
            "FogWithRain" : 0,
            "HeavyFog" : 3,
            "HeavyFogWithRain" : 0,
            "Random" : 0,
        },
        // Credit to Coanda https://forum.reizastudios.com/threads/automobilista-2-extended-car-info-spreadsheet.16746/
        // Other data sourced manually from game itself.
        "vehicle_classes_with_lights" : [
            "P1",
            "P1 Gen2",
            "P2",
            "P3",
            "P4",
            "Opala86",
            "StockCarV8_2020",
            "StockCarV8_2021",
            "StockCarV8_2022",
            "StockCarV8_2023",
            "StockCarV8_2024",
            "Carrera Cup",
            "CopaClassicB",
            "CopaUno",
            "TSICup",
            "Group A",
            "Group C",
            "DPI",
            "LMDh",
            "LMP2",
            "LMP2_Gen1",
            "TC60S",
            "TC60S2",
            "TC70S",
            "Procar",
            "GTOpen",
            "GT1",
            "GTE",      
            "GT3",      
            "GT3_Gen2",      
            "GT4",      
            "G40Cup",      
            "G55Supercup",      
            "SuperV8",      
            "Cat620R",      
            "Cat_Academy",      
            "Cat_Supersport",      
            "Street",      
            "Supercars",      
            "Hypercars",
            "RX",      
        ],  
        "flags" : [
            "ABS_ALLOWED",
            "ALLOW_CUSTOM_VEHICLE_SETUP",
            //"ANTI_GRIEFING_COLLISIONS",
            "AUTO_START_ENGINE",
            "COOLDOWNLAP",
            // "DISABLE_DRIVING_LINE",
            // "FORCE_MANUAL",
            "FORCE_REALISTIC_DRIVING_AIDS",
            // "HAS_BROADCASTER",
            // "HAS_RACE_DIRECTOR",
            "MECHANICAL_FAILURES",
            // "ONLINE_REPUTATION_ENABLED",
            // "PASSWORD_PROTECTED",
            "PIT_SPEED_LIMITER",
            "PIT_STOP_ERRORS_ALLOWED",
            // "SC_ALLOWED",
            "TCS_ALLOWED",
            "TIMED_RACE",
            "WAIT_FOR_RACE_READY_INPUT",
        ],
        // The default setup. This is a table with attributes and values. The following rules apply to the attributes:
        // - If TrackId is specified: The track to enforce. Automatically sets 1 to ServerControlsTrack
        // - If VehicleModelId is specified: The vehicle to enforce. Automatically sets 1 to ServerControlsVehicle, sets FORCE_IDENTICAL_VEHICLES to Flags
        // - If VehicleClassId is specified: The class to enforce. Automatically sets 1 to ServerControlsVehicleClass, sets FORCE_SAME_VEHICLE_CLASS to Flags
        // - Track, vehicle model, vehicle class and all enum/flags attributes can use values in string forms - so you can use either track id, or track name.
        // - Flags in string form can contain multiple flags separated by comma, so for example "ABS_ALLOWED,SC_ALLOWED,TCS_ALLOWED"
        // - The setup should never contain any of the "ServerControls" attributes, those are decided automatically.
        // - The setup should never contain both VehicleModelId and VehicleClassId at the same time. Restrict either the class or specific vehicle.
        // - The Flags attribute should never contain FORCE_IDENTICAL_VEHICLES or FORCE_SAME_VEHICLE_CLASS flags, those are decided automatically.
        "default" : {
            "GridSize" : 32,
            "MaxPlayers" : 4,
            // 0 = Default/Qualify, 1 = Host First, 2 = Host Middle, 3 = Host Last, 4 = Random
            "GridLayout" : 0,
            // If flag ONLINE_REPUTATION_ENABLED enabled
            // AMS2 Builtin Ranks 0 = U, 1 = F, 2 = E, 3 = D, 4 = C, 5 = B, 6 = A, 7 = S
            //"MinimumOnlineRank" : 3,
            // Minimum online strength. Valid values are in range from 100 to 5000.
            //"MinimumOnlineStrength" : 1200,
            // AI Difficulty
            "OpponentDifficulty" : 90,
            // Penalty values are 0 = None, 1 = Full
            "PenaltiesType" : 1,
            "AllowedCutsBeforePenalty" : 6,
            "DriveThroughPenalty" : 1,
            "PitWhiteLinePenalty" : 1,  
            "FullCourseYellows" : 0,
            // Scheduled FCY values are 0 = Off, 1 = 25%, 2 = 50%, 3 = 75%, 4 = Random
            "RaceScheduledFullCourseYellow" : 0,
            // Random Failure values are 0 = Off, 1 = Standard, 2 = SYNC_TO_RACE, 3 = X2, 4 = X3, 5 = X4, 6 = X5, 7 = X10
            "DamageRandomFailures" : 7,
            // Damage Types : OFF = 0, VISUAL_ONLY = 1, PERFORMANCEIMPACTING = 2, FULL = 3
            "DamageType" : "OFF",
            // Damage Scales : LOW = 0, MEDIUM = 1, HIGH = 2, MAX = 3
            "DamageScale" : 0,
            // Fuel & Tire Usage Options : OFF , STANDARD, X2 , X3 , X4 , X5 3
            "TireWearType" : "X3",
            "FuelUsageType" : "X2",
             // Views = ANY = 0, CockpitHelmet = 2
            "AllowedViews" : 0,
            // User Control in Pits. 0 = Auto Drive in and out, 1 is controlled by player
            "ManualPitStops" : 1,
            // The pit speed limit in KPH. Values between 40 and 200 in steps of 5 are valid (rounded down when needed). Unset, 0 or < 40 will result in track default limit
            "PitSpeedLimit" : 0,
            "DisablePitstopRefuelling" : 0,
            "RaceMandatoryPitStops" : 0,
            // PitStopsMinTyresRange 0 - 4
            "RaceMandatoryPitStopsMinTyres" : 0,
            "RaceFormationLap" : 0,
            "RaceRollingStart" : 0,
            "RaceExtraLap" : 1,
             // Session Details
            "AutoAdvanceSession" : 0,
            //Practice
            "PracticeLength" : 2,
            "PracticeDateHour" : 8,
            // Track Preset Options = Default Progressing, Wet, Damp, Green, Light Rubber, Medium Rubber, Heavy Rubber
            "PracticeLiveTrackPreset" : "Default Progressing",
            "PracticeDateProgression" : 1,
            // Qualify
            // Private session is 1 or 0 to have all drivers on track during Qualifying.
            "QualifyPrivateSession" : 1,
            "QualifyLength" : 10,
            "QualifyDateHour" : 10,
            // Track Preset Options = Default Progressing, Wet, Damp, Green, Light Rubber, Medium Rubber, Heavy Rubber
            "QualifyLiveTrackPreset" : "Default Progressing",
            //Race
            "RaceLength" : 8,
            "RaceDateHour" : 12,
            // Track Preset Options = Default Progressing, Wet, Damp, Green, Light Rubber, Medium Rubber, Heavy Rubber
            "RaceLiveTrackPreset" : "Default Progressing",
            "RaceDateProgression" : 1,
          
        },
        // The rotation. Array of setups to rotate. If empty, just the default setup will be used with no actual rotation happening.
        // These setups are applied on top of the default setup, then applied to the game. Previous setup in the rotation is never used.
        // So for example if you wanted to repeat the same track in multiple consecutive setups, different from the default track,
        // each of those setups needs to explicitly include that track. Also remember that apart from the flags nothing can be "removed"
        // from the default setup, so if the default setup contains a track, some track will always be enforced (either the default one,
        // or the setup-specific one). And one last thing, these override setups can never include an attribute that's not specified in
        // the default setup - it can just override some of the default attributes, not add new ones. The only exception are the
        // track/vehicle/class attributes.
        // Attributes in these setups can have a special attribute RemoveFlags set, which will remove the specified flags from the default
        // setup instead of adding them to it (which is what the Flags attribute will do)
        "rotation" : []
    }
     
  4. Svenny

    Svenny Member

    Joined:
    Jul 25, 2023
    Messages:
    43
    Likes Received:
    38
    Thanks. Not sure why this isn't working your end.
    I've tried your config, and it works with latest lua version (not released), the lua file I attached a few posts pack and also 0.4.3 download in the first post.

    Can I suggest you remove/delete the ams2_drb lua folder, any ams2_drb.* files in the lua_config folder and start from scatch again.

    Have you changed anything in the main server.cfg file since it worked?
     
  5. Diesels

    Diesels New Member

    Joined:
    Dec 27, 2024
    Messages:
    13
    Likes Received:
    3
    So I deleted everything and started new with 0.4.3 and it worked. And I also found the Problem, wich is the ams2_drb_data.json. I made a new one starting with the default one and when I only allw the classes GT3gen1, gen2 and GT4 the server no longer works or appears in the server browser.
     
    • Informative Informative x 1
  6. Svenny

    Svenny Member

    Joined:
    Jul 25, 2023
    Messages:
    43
    Likes Received:
    38
    Thanks for the update. When selecting the 3 classes only, do you have the multiclass option also set like you had configured before or was it just using the default settings?
    I'll try default and those 3 classes only to see if I can replicate.

    EDIT: Was able to replicate using only 3 classes enabled and 10 in the mutliclass. This caused an infinite loop when selecting classes trying to get to 10 but could only select 3. New download version available 0.4.4 - Just copy the main "ams2_drb/ams2_drb.lua". I've also added some additional chat messages for admins only to remove vehicles/classes and tracks incase they had been missed on setup + autosaves.
     
    Last edited: Jan 12, 2025
    • Like Like x 2
  7. Diesels

    Diesels New Member

    Joined:
    Dec 27, 2024
    Messages:
    13
    Likes Received:
    3
    Tested 0.4.4 and everything works now, I had no Problems.:)
     
    • Like Like x 1

Share This Page