Grimes Posted April 12, 2012 Posted April 12, 2012 Lately I've been testing out some ways to make a longish mission featuring ground combat. The problem is that it is highly impractical due to the limited amount of ammo and the removal of "rearming" capabilities for AI. There seems to be logic built into the sim that makes tanks fire at targets at longer ranges when they are stationary. In one of the tests a M1A1 basically " " a T-72 at 5 km, whereas if the roles are switched the T-72 is much more inaccurate. For example lets think of a basic Russian offensive push against a NATO defensive line of tanks. The T-72 will generally start firing around 5km away while the stationary NATO tank shoots around 3km, this should be a massive advantage for the T-72 however most of the shots miss. Depending on the rate of closer, by the time the T-72 gets within range of the NATO tanks the T-72 will have used up most of its ammo. You can easily tell how much ammo is remaining via the debrief screen when the tank switches from AP to HE and then to the AT-11. This is all well and good if the tank is expected to be in 1 and only 1 engagement, however this clearly becomes an issue for "sustained offensive" types of missions. Its worth noting that I was able to work around part of the issue by changing default ROE rules and to force the attackers to start shooting once they are closer. It seems the closer the tank is to their target once they start firing more accurate their shots will be. I know that makes sense, but it seems to only be applied WHEN the tank starts shooting. If the tank starts shooting at 5km out (as they can by default) all shots will land short even as the tank gets closer to its target. The key issue still remains though, all of the tanks have limited ammo and are incapable of being rearmed. I've attempted to rectify the issue by digging through lua files and comparing em to older code from BS1. In WH, it seems the only ground combat unit that has built in reload logic are the MRLS units. A GRAD for instance will fire on a target every hour on the dot as long as it still has been given a "fire at point" task. Interestingly enough the T-72 in BS1 had the same behavior but not in WH/BS2. A potential key line that has been removed from BS1 to WH/BS2 is GT.WS[ws].ammunition_reserve = 23 While the GRAD in WH/BS2 has a line GT.WS[ws].LN[1].barrels_reload_type = 2; I've tried to implement both into the T-72B.lua file to see if it had any effect, sadly its behavior remained the same. The only viable change I was able to make in was changing the ammo capacity to a larger number. For instance I was able to give the T-72 100 rounds of 2A46M-125_HE ammo. For whatever reason the AP and AT-11 ammo isn't listed as an obvious parameter, but HE does a decent enough job killing tanks, so I'm not sure it matters. Changing the total ammo is one work-around, but not exactly the best way to do it. I hope that with Combined Arms on the way and the warehouse system we might see some improvements to how ammunition is handled with AI. That is however just a hope as very little info is available on how both of those feature will impact ground AI. Just thought I'd post on some interesting and potentially detrimental behavioral issues with the AI in the current version of the sim... The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Joyride Posted April 12, 2012 Posted April 12, 2012 Curious if there is any way to provide unlimited ammo for all ground units? Would be a useful option for mission creators.
ED Team BIGNEWY Posted April 12, 2012 ED Team Posted April 12, 2012 Curious if there is any way to provide unlimited ammo for all ground units? Would be a useful option for mission creators. no, its a pain in the arse to be frank lol Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status Windows 11, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 64GB DDR @3200, ASUS ROG Strix Z490-F Gaming, PIMAX Crystal
Speed Posted April 12, 2012 Posted April 12, 2012 Thank you Grimes for posting your research. You do similar things to the things I do when I'm trying to develop a new Lua capability. These variables should be accessible in the main simulation (aka "server") Lua environment. I'll check them out, on the off chance that a run-time modification of them might be able to change the amount of ammunition a tank can hold. Most likely, however, a run-time modification of the ammo capacity will not change anything, as for many similar Lua variables, the C++ executable only gets information on them once, very early on, and then never looks at the Lua variable again. Who knows, maybe I could make a function to increase/decrease ammo capacity of unactivated units-perhaps the Lua variable is referenced when units become activated. Unfortunately, the game variables that hold the current amount of ammunition a unit is holding are not exposed in Lua, so there's nothing I can do to edit them. Anyway, you inspired me to try a few experiments :) Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
Grimes Posted April 13, 2012 Author Posted April 13, 2012 Found this looking through the "IFV" of the AKSoldier for i=2,8 do -- 8 clips, 240 rounds __LN.PL[i] = {}; set_recursive_metatable(__LN.PL[i], __LN.PL[1]); end The same basic code exists within the T-72B.lua file for both the coaxial and the commanders gun, however I had no idea what it did without the commented notation. I copied it to the area containing info on the main cannon and it works! Sort of. The tank fires its initial salvo of AP and then HE rounds. Then the lua code insert kicks in and it fires AP rounds pretty much non-stop until the looped function ends. It took about 25 minutes for it to stop shooting AP rounds. Once the loop ends it will fire its AT-11. Unfortunately the plume of smoke at the end of the barrel and from the shell hitting the ground if it misses failed to render once it gets into the looped function. I think the tank is switching to the AT-11 animations, while still firing tank shells. After about a half hour or so it seems to reload. Each time starting with HE rounds with smoke plume from firing and if the shells miss working correctly. Once it switches to AP the smoke from firing and missing fails to render. It appears to fire much less HE rounds than its first salvo of HE and it doesn't quite fire as many AP rounds. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Speed Posted April 13, 2012 Posted April 13, 2012 Well, I just started playing around with this myself. If you want to increase the number of rounds of AP, then it looks like you need to modify this value: db["Units"]["GT_t"]["LN_t"]["tank_gun_2A46"]["PL"][1]["ammo_capacity"] This "tank_gun_2A46" is used for more than one tank, the T-72 inherits it. Not sure which file it's defined in though, I can look if you want. By default, db["Units"]["GT_t"]["LN_t"]["tank_gun_2A46"]["PL"][1]["ammo_capacity"] is 22. Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
Speed Posted April 13, 2012 Posted April 13, 2012 (edited) Ah here it is, in ./Scripts/Database/scripts/cannon.lua: GT_t.LN_t.tank_gun_2A46 = {} -- 125mm D-81 gun for T-72, T-80, T-90 GT_t.LN_t.tank_gun_2A46.type = 2 GT_t.LN_t.tank_gun_2A46.distanceMin = 50 GT_t.LN_t.tank_gun_2A46.distanceMax = 3500 GT_t.LN_t.tank_gun_2A46.max_trg_alt = 3000 GT_t.LN_t.tank_gun_2A46.reactionTime = 2 GT_t.LN_t.tank_gun_2A46.platform_max_speed = 9 GT_t.LN_t.tank_gun_2A46.sound = { single_shot = "Weapons/Cannon/125mmGun", } GT_t.LN_t.tank_gun_2A46.sensor = {} set_recursive_metatable(GT_t.LN_t.tank_gun_2A46.sensor, GT_t.WSN_t[7]) GT_t.LN_t.tank_gun_2A46.PL = {} GT_t.LN_t.tank_gun_2A46.PL[1] = {} GT_t.LN_t.tank_gun_2A46.PL[1].shot_delay = 7.5 GT_t.LN_t.tank_gun_2A46.PL[1].ammo_capacity = 22 GT_t.LN_t.tank_gun_2A46.PL[1].shell_name = {"2A46M_125_AP"}; GT_t.LN_t.tank_gun_2A46.major_weapon = true; GT_t.LN_t.tank_gun_2A46.BR = { {pos = {5.4, 0,0} } } BTW, I can confirm, as I thought, that run-time modification (as in, editing the value of these variables in memory using net.dostring_in in multiplayer) to these variables does nothing. The variables are probably loaded into C++ and then never looked at again in Lua. That's the way it is with a lot of things. That's also why I had never tried this particular thing before, because I didn't think it would work. But you never know. Edited April 13, 2012 by Speed Intelligent discourse can only begin with the honest admission of your own fallibility. Member of the Virtual Tactical Air Group: http://vtacticalairgroup.com/ Lua scripts and mods: MIssion Scripting Tools (Mist): http://forums.eagle.ru/showthread.php?t=98616 Slmod version 7.0 for DCS: World: http://forums.eagle.ru/showthread.php?t=80979 Now includes remote server administration tools for kicking, banning, loading missions, etc.
Stuka Posted April 13, 2012 Posted April 13, 2012 I hope that with Combined Arms on the way and the warehouse system we might see some improvements to how ammunition is handled with AI. That is however just a hope as very little info is available on how both of those feature will impact ground AI. Did I mis something somewhere? What is that upcoming warehouse system you're talking about ? Windows 11 | i9 12900KF | 64GB DDR4 | RTX 3090 | TM Warthog HOTAS | Saitek Combat Rudder Pedals | TM MFDs + Lilliput 8" | TIR5 Pro
ED Team BIGNEWY Posted April 13, 2012 ED Team Posted April 13, 2012 Planned FC3 feature. Resource management system. outstanding ! :thumbup: Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status Windows 11, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 64GB DDR @3200, ASUS ROG Strix Z490-F Gaming, PIMAX Crystal
Eddie Posted April 13, 2012 Posted April 13, 2012 outstanding ! :thumbup: Maybe. Your guess is as good as mine as to what the "resourse management system" actually is and what it does.
ED Team BIGNEWY Posted April 13, 2012 ED Team Posted April 13, 2012 Maybe. Your guess is as good as mine as to what the "resourse management system" actually is and what it does. anything is a step in the right direction ;) Forum rules - DCS Crashing? Try this first - Cleanup and Repair - Discord BIGNEWY#8703 - Youtube - Patch Status Windows 11, NVIDIA MSI RTX 3090, Intel® i9-10900K 3.70GHz, 5.30GHz Turbo, Corsair Hydro Series H150i Pro, 64GB DDR @3200, ASUS ROG Strix Z490-F Gaming, PIMAX Crystal
Grimes Posted April 13, 2012 Author Posted April 13, 2012 There is a file called "warehouses" sitting within each mission file. It appears to keep track of fuel, ammunition, and airplanes available for each airbase. However the file currently has no function within the game and it is questionable if the resource management system will expand beyond airbases to include ground AI units. Speed, it appears that client side modification of the database files is a no-go. I attempted to join a server last night and the game kept crashing whenever I joined the server. Weapons.dll was causing the crash. Interestingly I tried to just comment out the changes to the file, but the crash remained. I had to replace it with the original in order to join the server without issue. Gonna check later if the same thing occurs with server side modification. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Grimes Posted April 15, 2012 Author Posted April 15, 2012 Server side modification of the database files works without issue. I was able to connect with an unmodded client to the server. I also tried attaching a modified file into the mission file, however that didn't work. So my guess is it loads all of those details whenever multiplayer starts and not loading a specific mission. The right man in the wrong place makes all the difference in the world. Current Projects: Grayflag Server, Scripting Wiki Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread) SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum
Recommended Posts