First commit for bot gen project
This commit is contained in:
parent
3a64c84d0a
commit
6df06c5063
25
Bots.sln
Normal file
25
Bots.sln
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31424.327
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator", "Generator\Generator.csproj", "{79CD3722-D6A7-4BA1-8CDF-533A77566D93}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{79CD3722-D6A7-4BA1-8CDF-533A77566D93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{79CD3722-D6A7-4BA1-8CDF-533A77566D93}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{79CD3722-D6A7-4BA1-8CDF-533A77566D93}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{79CD3722-D6A7-4BA1-8CDF-533A77566D93}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D699C02A-AD6B-404C-B792-53E00F98E563}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
125
Generator/BaseBotGenerator.cs
Normal file
125
Generator/BaseBotGenerator.cs
Normal file
@ -0,0 +1,125 @@
|
||||
using Generator.Helpers;
|
||||
using Generator.Models;
|
||||
using Generator.Models.Input;
|
||||
using Generator.Models.Output;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace Generator
|
||||
{
|
||||
public class BaseBotGenerator
|
||||
{
|
||||
private readonly List<Datum> _rawParsedBots;
|
||||
|
||||
public BaseBotGenerator(List<Datum> parsedBots)
|
||||
{
|
||||
_rawParsedBots = parsedBots;
|
||||
}
|
||||
|
||||
public List<Bot> AddBaseDetails()
|
||||
{
|
||||
var stopwatch = Stopwatch.StartNew();
|
||||
LoggingHelpers.LogToConsole("Started processing bot base");
|
||||
|
||||
var assaultBot = new Bot(BotType.assault);
|
||||
var raiderBot = new Bot(BotType.pmcBot);
|
||||
var marksmanBot = new Bot(BotType.marksman);
|
||||
|
||||
var rawBots = new List<Bot>
|
||||
{
|
||||
assaultBot,
|
||||
raiderBot,
|
||||
marksmanBot
|
||||
};
|
||||
|
||||
foreach (var botToUpdate in rawBots)
|
||||
{
|
||||
var rawBotData = _rawParsedBots
|
||||
.Where(x => string.Equals(x.Info.Settings.Role, botToUpdate.botType.ToString(), StringComparison.OrdinalIgnoreCase)).ToList();
|
||||
UpdateBodyPartHealth(botToUpdate, rawBotData);
|
||||
}
|
||||
|
||||
foreach (var bot in rawBots)
|
||||
{
|
||||
AddDifficulties(bot, _rawParsedBots);
|
||||
foreach (var rawParsedBot in _rawParsedBots)
|
||||
{
|
||||
AddVisualAppearanceItems(bot, rawParsedBot);
|
||||
AddName(bot, rawParsedBot.Info.Nickname);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
stopwatch.Stop();
|
||||
LoggingHelpers.LogToConsole($"Time taken to generate base bot files: {LoggingHelpers.LogTimeTaken(stopwatch.Elapsed.TotalSeconds)} seconds");
|
||||
|
||||
|
||||
return rawBots;
|
||||
}
|
||||
|
||||
private void AddDifficulties(Bot bot, List<Datum> rawParsedBots)
|
||||
{
|
||||
var botType = bot.botType;
|
||||
var firstBotOfDesiredType = rawParsedBots.First(x => x.Info.Settings.Role == botType.ToString());
|
||||
|
||||
switch (botType)
|
||||
{
|
||||
case BotType.assault:
|
||||
DifficultyHelper.AddAssaultDifficulties(bot);
|
||||
break;
|
||||
case BotType.pmcBot:
|
||||
break;
|
||||
case BotType.marksman:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateBodyPartHealth(Bot botToUpdate, List<Datum> rawParsedBots)
|
||||
{
|
||||
var firstBotOfDesiredType = rawParsedBots.First(x => x.Info.Settings.Role == botToUpdate.botType.ToString());
|
||||
botToUpdate.health.BodyParts.Head.min = firstBotOfDesiredType.Health.BodyParts.Head.Health.Current;
|
||||
botToUpdate.health.BodyParts.Head.max = firstBotOfDesiredType.Health.BodyParts.Head.Health.Maximum;
|
||||
|
||||
botToUpdate.health.BodyParts.Chest.min = firstBotOfDesiredType.Health.BodyParts.Chest.Health.Current;
|
||||
botToUpdate.health.BodyParts.Chest.max = firstBotOfDesiredType.Health.BodyParts.Chest.Health.Maximum;
|
||||
|
||||
botToUpdate.health.BodyParts.Stomach.min = firstBotOfDesiredType.Health.BodyParts.Stomach.Health.Current;
|
||||
botToUpdate.health.BodyParts.Stomach.max = firstBotOfDesiredType.Health.BodyParts.Stomach.Health.Maximum;
|
||||
|
||||
botToUpdate.health.BodyParts.LeftArm.min = firstBotOfDesiredType.Health.BodyParts.LeftArm.Health.Current;
|
||||
botToUpdate.health.BodyParts.LeftArm.max = firstBotOfDesiredType.Health.BodyParts.LeftArm.Health.Maximum;
|
||||
|
||||
botToUpdate.health.BodyParts.RightArm.min = firstBotOfDesiredType.Health.BodyParts.RightArm.Health.Current;
|
||||
botToUpdate.health.BodyParts.RightArm.max = firstBotOfDesiredType.Health.BodyParts.RightArm.Health.Maximum;
|
||||
|
||||
botToUpdate.health.BodyParts.LeftLeg.min = firstBotOfDesiredType.Health.BodyParts.LeftLeg.Health.Current;
|
||||
botToUpdate.health.BodyParts.LeftLeg.max = firstBotOfDesiredType.Health.BodyParts.LeftLeg.Health.Maximum;
|
||||
|
||||
botToUpdate.health.BodyParts.RightLeg.min = firstBotOfDesiredType.Health.BodyParts.RightLeg.Health.Current;
|
||||
botToUpdate.health.BodyParts.RightLeg.max = firstBotOfDesiredType.Health.BodyParts.RightLeg.Health.Maximum;
|
||||
}
|
||||
|
||||
private void AddVisualAppearanceItems(Bot finalAssaultBot, Datum bot)
|
||||
{
|
||||
finalAssaultBot.appearance.head.AddUnique(bot.Customization.Head);
|
||||
finalAssaultBot.appearance.body.AddUnique(bot.Customization.Body);
|
||||
finalAssaultBot.appearance.hands.AddUnique(bot.Customization.Hands);
|
||||
finalAssaultBot.appearance.feet.AddUnique(bot.Customization.Feet);
|
||||
finalAssaultBot.appearance.voice.AddUnique(bot.Info.Voice);
|
||||
}
|
||||
|
||||
private void AddName(Bot finalAssaultBot, string nickName)
|
||||
{
|
||||
var name = nickName.Split();
|
||||
finalAssaultBot.firstName.AddUnique(name[0]);
|
||||
if (name.Length > 1)
|
||||
{
|
||||
finalAssaultBot.lastName.AddUnique(name[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
231
Generator/BotGearGenerator.cs
Normal file
231
Generator/BotGearGenerator.cs
Normal file
@ -0,0 +1,231 @@
|
||||
using Generator.Helpers;
|
||||
using Generator.Models;
|
||||
using Generator.Models.Input;
|
||||
using Generator.Models.Output;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace Generator
|
||||
{
|
||||
public class BotGearGenerator
|
||||
{
|
||||
private readonly List<Bot> _baseBots;
|
||||
private readonly List<Datum> _rawParsedBots;
|
||||
|
||||
public BotGearGenerator(List<Bot> baseBots, List<Datum> parsedBots)
|
||||
{
|
||||
_baseBots = baseBots;
|
||||
_rawParsedBots = parsedBots;
|
||||
}
|
||||
|
||||
internal List<Bot> AddGear()
|
||||
{
|
||||
var stopwatch = Stopwatch.StartNew();
|
||||
LoggingHelpers.LogToConsole("Started processing bot gear");
|
||||
|
||||
foreach (var bot in _baseBots)
|
||||
{
|
||||
AddEquipmentChances(bot);
|
||||
AddGenerationChances(bot);
|
||||
AddModChances(bot);
|
||||
foreach (var rawParsedBot in _rawParsedBots)
|
||||
{
|
||||
AddEquippedGear(bot, rawParsedBot);
|
||||
AddEquippedMods(bot, rawParsedBot);
|
||||
}
|
||||
}
|
||||
|
||||
stopwatch.Stop();
|
||||
LoggingHelpers.LogToConsole($"Time taken to generate gear: {LoggingHelpers.LogTimeTaken(stopwatch.Elapsed.TotalSeconds)} seconds");
|
||||
|
||||
return _baseBots;
|
||||
}
|
||||
|
||||
private void AddEquippedMods(Bot botToUpdate, Datum rawParsedBot)
|
||||
{
|
||||
var modItemsInRawBot = new List<Item>();
|
||||
var itemsWithModsInRawBot = new List<Item>();
|
||||
|
||||
modItemsInRawBot = rawParsedBot.Inventory.items
|
||||
.Where(x => x.slotId?.StartsWith("mod_") == true).ToList();
|
||||
|
||||
// get items with Mods by iterating over mod items and getting the parent item
|
||||
itemsWithModsInRawBot.AddRange(modItemsInRawBot
|
||||
.Select(modItem => rawParsedBot.Inventory.items
|
||||
.Find(x => x._id == modItem.parentId)));
|
||||
|
||||
var itemsWithModsDictionary = botToUpdate.inventory.mods;
|
||||
foreach (var itemToAdd in itemsWithModsInRawBot)
|
||||
{
|
||||
var modsToAdd = modItemsInRawBot.Where(x => x.parentId == itemToAdd._id).ToList();
|
||||
|
||||
AddItemToDictionary(itemToAdd, modsToAdd, itemsWithModsDictionary);
|
||||
}
|
||||
|
||||
botToUpdate.inventory.mods = itemsWithModsDictionary;
|
||||
}
|
||||
|
||||
private void AddItemToDictionary(
|
||||
Item itemToAdd,
|
||||
List<Item> modsToAdd,
|
||||
Dictionary<string, Dictionary<string, List<string>>> itemsWithModsDictionary)
|
||||
{
|
||||
// item key already exists, need to merge mods
|
||||
if (itemsWithModsDictionary.ContainsKey(itemToAdd.slotId))
|
||||
{
|
||||
foreach (var modItem in modsToAdd)
|
||||
{
|
||||
var itemToAddModsTo = itemsWithModsDictionary[itemToAdd.slotId];
|
||||
// Item doesnt have this mod, add it then add template id
|
||||
if (!itemToAddModsTo.ContainsKey(modItem.slotId))
|
||||
{
|
||||
// Mod doesnt exist on item
|
||||
itemToAddModsTo.Add(modItem.slotId, new List<string>()); // add mod
|
||||
itemToAddModsTo[modItem.slotId].AddUnique(modItem._tpl);
|
||||
}
|
||||
|
||||
itemToAddModsTo[modItem.slotId].AddUnique(modItem._tpl); // add template id to it
|
||||
}
|
||||
}
|
||||
else // item doesnt exist, create it
|
||||
{
|
||||
itemsWithModsDictionary.Add(itemToAdd.slotId, new Dictionary<string, List<string>>());
|
||||
// Add mod types to item
|
||||
foreach (var modItem in modsToAdd)
|
||||
{
|
||||
itemsWithModsDictionary[itemToAdd.slotId].Add(modItem.slotId, new List<string>());
|
||||
}
|
||||
|
||||
// Get item we're adding mod templateIds to
|
||||
var itemToUpdate = itemsWithModsDictionary[itemToAdd.slotId];
|
||||
foreach (var modItem in modsToAdd)
|
||||
{
|
||||
var modToUpdate = itemToUpdate[modItem.slotId];
|
||||
modToUpdate.Add(modItem._tpl);
|
||||
}
|
||||
|
||||
}
|
||||
var result = JsonConvert.SerializeObject(itemsWithModsDictionary, Formatting.Indented);
|
||||
}
|
||||
|
||||
private void AddModChances(Bot bot)
|
||||
{
|
||||
switch (bot.botType)
|
||||
{
|
||||
case BotType.assault:
|
||||
bot.chances.mods = new Mods(muzzle: 18, barrel: 100, handguard: 100, stock: 66, magazine: 100,
|
||||
mount: 15, flashlight: 100, tactical_001: 99, tactical_002: 0, tactical_003: 0,
|
||||
mount_000: 15, pistol_grip: 97, tactical: 87, scope: 17, reciever: 92,
|
||||
sight_rear: 56, charge: 13, mount_001: 0, equipment: 30, gas_block: 100,
|
||||
launcher: 0, sight_front: 25, stock_000: 0, foregrip: 0, tactical_000: 0,
|
||||
nvg: 0, pistol_grip_akms: 100, stock_akms: 100, equipment_000: 0, equipment_001: 0,
|
||||
equipment_002: 0, bipod: 0);
|
||||
break;
|
||||
case BotType.pmcBot:
|
||||
bot.chances.mods = new Mods(muzzle: 67, barrel: 100, handguard: 97, stock: 81, magazine: 100,
|
||||
mount: 35, flashlight: 100, tactical_001: 9, tactical_002: 0, tactical_003: 0,
|
||||
mount_000: 28, pistol_grip: 97, tactical: 32, scope: 57, reciever: 100,
|
||||
sight_rear: 58, charge: 81, mount_001: 38, equipment: 0, gas_block: 100,
|
||||
launcher: 0, sight_front: 65, stock_000: 100, foregrip: 30, tactical_000: 18,
|
||||
nvg: 25, pistol_grip_akms: 97, stock_akms: 0, equipment_000: 0, equipment_001: 0,
|
||||
equipment_002: 0, bipod: 0);
|
||||
break;
|
||||
case BotType.marksman:
|
||||
bot.chances.mods = new Mods(muzzle: 0, barrel: 100, handguard: 0, stock: 73, magazine: 100,
|
||||
mount: 100, flashlight: 0, tactical_001: 0, tactical_002: 0, tactical_003: 0,
|
||||
mount_000: 0, pistol_grip: 0, tactical: 33, scope: 89, reciever: 0,
|
||||
sight_rear: 17, charge: 0, mount_001: 0, equipment: 0, gas_block: 0,
|
||||
launcher: 0, sight_front: 25, stock_000: 0, foregrip: 0, tactical_000: 33,
|
||||
nvg: 100, pistol_grip_akms: 0, stock_akms: 0, equipment_000: 0, equipment_001: 0,
|
||||
equipment_002: 0, bipod: 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void AddGenerationChances(Bot bot)
|
||||
{
|
||||
switch (bot.botType)
|
||||
{
|
||||
case BotType.assault:
|
||||
case BotType.pmcBot:
|
||||
case BotType.marksman:
|
||||
bot.generation = new GenerationChances(0, 1, 1, 2, 0, 3, 2, 4, 0, 5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void AddEquipmentChances(Bot bot)
|
||||
{
|
||||
switch (bot.botType)
|
||||
{
|
||||
case BotType.assault:
|
||||
bot.chances.equipment = new EquipmentChances(73, 0, 62, 28, 36, 0, 100, 38, 95, 0, 5, 72, 100, 100);
|
||||
break;
|
||||
case BotType.pmcBot:
|
||||
bot.chances.equipment = new EquipmentChances(89, 56, 58, 49, 84, 0, 100, 58, 100, 0, 18, 0, 100, 100);
|
||||
break;
|
||||
case BotType.marksman:
|
||||
bot.chances.equipment = new EquipmentChances(8, 8, 8, 42, 0, 0, 100, 25, 100, 0, 0, 33, 100, 100);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void AddEquippedGear(Bot finalAssaultBot, Datum bot)
|
||||
{
|
||||
// add equipped gear
|
||||
foreach (var inventoryItem in bot.Inventory.items)
|
||||
{
|
||||
switch (inventoryItem.slotId?.ToLower())
|
||||
{
|
||||
case "headwear":
|
||||
finalAssaultBot.inventory.equipment.Headwear.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
case "earpiece":
|
||||
finalAssaultBot.inventory.equipment.Earpiece.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
case "facecover":
|
||||
finalAssaultBot.inventory.equipment.FaceCover.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
case "armorvest":
|
||||
finalAssaultBot.inventory.equipment.ArmorVest.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
case "eyewear":
|
||||
finalAssaultBot.inventory.equipment.Eyewear.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
case "armband":
|
||||
finalAssaultBot.inventory.equipment.ArmBand.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
case "tacticalvest":
|
||||
finalAssaultBot.inventory.equipment.TacticalVest.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
case "backpack":
|
||||
finalAssaultBot.inventory.equipment.Backpack.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
case "firstprimaryweapon":
|
||||
finalAssaultBot.inventory.equipment.FirstPrimaryWeapon.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
case "secondprimaryweapon":
|
||||
finalAssaultBot.inventory.equipment.SecondPrimaryWeapon.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
case "holster":
|
||||
finalAssaultBot.inventory.equipment.Holster.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
case "scabbard":
|
||||
finalAssaultBot.inventory.equipment.Scabbard.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
case "pockets":
|
||||
finalAssaultBot.inventory.equipment.Pockets.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
case "securedcontainer":
|
||||
finalAssaultBot.inventory.equipment.SecuredContainer.AddUnique(inventoryItem._tpl);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
103
Generator/BotLootGenerator.cs
Normal file
103
Generator/BotLootGenerator.cs
Normal file
@ -0,0 +1,103 @@
|
||||
using Generator.Helpers;
|
||||
using Generator.Models.Input;
|
||||
using Generator.Models.Output;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace Generator
|
||||
{
|
||||
public class BotLootGenerator
|
||||
{
|
||||
private readonly List<Bot> _botsWithGear;
|
||||
private readonly List<Datum> _rawParsedBots;
|
||||
|
||||
public BotLootGenerator(List<Bot> botsWithGear, List<Datum> rawParsedBots)
|
||||
{
|
||||
_botsWithGear = botsWithGear;
|
||||
_rawParsedBots = rawParsedBots;
|
||||
}
|
||||
|
||||
internal List<Bot> AddLoot()
|
||||
{
|
||||
var stopwatch = Stopwatch.StartNew();
|
||||
LoggingHelpers.LogToConsole("Started processing bot loot");
|
||||
|
||||
// Iterate over assault/raider etc
|
||||
foreach (var bot in _botsWithGear)
|
||||
{
|
||||
foreach (var rawParsedBot in _rawParsedBots)
|
||||
{
|
||||
AddPocketLoot(bot, rawParsedBot);
|
||||
}
|
||||
|
||||
AddTacticalVestLoot(bot, _rawParsedBots);
|
||||
AddBackbackLoot(bot, _rawParsedBots);
|
||||
AddSecureContainerLoot(bot, _rawParsedBots);
|
||||
}
|
||||
|
||||
stopwatch.Stop();
|
||||
LoggingHelpers.LogToConsole($"Time taken to generate loot: {LoggingHelpers.LogTimeTaken(stopwatch.Elapsed.TotalSeconds)} seconds");
|
||||
|
||||
return _botsWithGear;
|
||||
}
|
||||
|
||||
private void AddTacticalVestLoot(Bot finalAssaultBot, List<Datum> bots)
|
||||
{
|
||||
var tacVestItems = GetItemsStoredInEquipmentItem(bots, "TacticalVest");
|
||||
finalAssaultBot.inventory.items.TacticalVest.AddRange(tacVestItems);
|
||||
}
|
||||
|
||||
private void AddBackbackLoot(Bot finalAssaultBot, List<Datum> bots)
|
||||
{
|
||||
var backpackItems = GetItemsStoredInEquipmentItem(bots, "Backpack");
|
||||
finalAssaultBot.inventory.items.Backpack.AddRange(backpackItems);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void AddSecureContainerLoot(Bot finalAssaultBot, List<Datum> bots)
|
||||
{
|
||||
var tacVestItems = GetItemsStoredInEquipmentItem(bots, "SecuredContainer");
|
||||
finalAssaultBot.inventory.items.SecuredContainer.AddRange(tacVestItems);
|
||||
}
|
||||
|
||||
private void AddPocketLoot(Bot finalBot, Datum bot)
|
||||
{
|
||||
// pocket loot
|
||||
foreach (var lootItem in bot.Inventory.items.Where(x => x?.slotId?.StartsWith("pocket") == true))
|
||||
{
|
||||
finalBot.inventory.items.Pockets.AddUnique(lootItem._tpl);
|
||||
}
|
||||
}
|
||||
|
||||
private List<string> GetItemsStoredInEquipmentItem(List<Datum> bots, string containerName)
|
||||
{
|
||||
var itemsStoredInContainer = new List<string>();
|
||||
var containers = new List<string>();
|
||||
foreach (var bot in bots)
|
||||
{
|
||||
// find the container type we want on this bot (backpack etc)
|
||||
// Add to list
|
||||
var botContainers = bot.Inventory.items.Where(x => x.slotId == containerName);
|
||||
foreach (var c in botContainers)
|
||||
{
|
||||
containers.AddUnique(c._id);
|
||||
}
|
||||
|
||||
foreach (var item in bot.Inventory.items)
|
||||
{
|
||||
if (containers.Contains(item.parentId))
|
||||
{
|
||||
itemsStoredInContainer.AddUnique(item._tpl);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return itemsStoredInContainer;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
85
Generator/BotParser.cs
Normal file
85
Generator/BotParser.cs
Normal file
@ -0,0 +1,85 @@
|
||||
using Generator.Helpers;
|
||||
using Generator.Models.Input;
|
||||
using Generator.Models.Output;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace Generator
|
||||
{
|
||||
internal class BotParser
|
||||
{
|
||||
private readonly string _workingPath;
|
||||
private readonly string _dumpPath;
|
||||
private readonly string[] _botTypes;
|
||||
|
||||
public BotParser(string workingPath, string dumpPath, string[] botTypes)
|
||||
{
|
||||
_workingPath = workingPath;
|
||||
_dumpPath = dumpPath;
|
||||
_botTypes = botTypes;
|
||||
}
|
||||
|
||||
public List<Datum> Parse()
|
||||
{
|
||||
var stopwatch = Stopwatch.StartNew();
|
||||
|
||||
var failedFiles = 0;
|
||||
CreateDirIfDoesntExist(_dumpPath);
|
||||
|
||||
var botFiles = Directory.GetFiles(_dumpPath, "*.json", SearchOption.TopDirectoryOnly).ToList();
|
||||
Console.WriteLine($"{botFiles.Count} files found");
|
||||
|
||||
var parsedBots = new List<Datum>();
|
||||
foreach (var file in botFiles)
|
||||
{
|
||||
var splitFile = file.Split("\\");
|
||||
failedFiles++;
|
||||
|
||||
var json = File.ReadAllText(file);
|
||||
try
|
||||
{
|
||||
var bots = ParseJson(json, file);
|
||||
Console.WriteLine($"parsing: {bots.Count} bots in file {splitFile.Last()}");
|
||||
foreach (var bot in bots)
|
||||
{
|
||||
parsedBots.Add(bot);
|
||||
}
|
||||
}
|
||||
catch (JsonException jex)
|
||||
{
|
||||
|
||||
Console.WriteLine($"JSON Error message: {jex.Message} || file: {splitFile.Last()}");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
stopwatch.Stop();
|
||||
|
||||
Console.WriteLine($"Parsed: {parsedBots.Count} Failed: {failedFiles}. Took {LoggingHelpers.LogTimeTaken(stopwatch.Elapsed.TotalSeconds)} seconds");
|
||||
|
||||
|
||||
|
||||
return parsedBots;
|
||||
}
|
||||
|
||||
private void CreateDirIfDoesntExist(string path)
|
||||
{
|
||||
if (!Directory.Exists($"{path}"))
|
||||
{
|
||||
//create dump dir
|
||||
Directory.CreateDirectory($"{path}");
|
||||
}
|
||||
}
|
||||
|
||||
private static List<Datum> ParseJson(string json, string file)
|
||||
{
|
||||
//Console.WriteLine($"parsing file {file}");
|
||||
var serialisedObject = JsonConvert.DeserializeObject<Models.Input.Root>(json);
|
||||
return serialisedObject.data;
|
||||
}
|
||||
}
|
||||
}
|
12
Generator/Generator.csproj
Normal file
12
Generator/Generator.csproj
Normal file
@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
181
Generator/Helpers/DifficultHelper.cs
Normal file
181
Generator/Helpers/DifficultHelper.cs
Normal file
@ -0,0 +1,181 @@
|
||||
using Generator.Models.Output.Difficulty;
|
||||
|
||||
namespace Generator.Helpers
|
||||
{
|
||||
public static class DifficultHelper
|
||||
{
|
||||
public static Lay GenerateLay()
|
||||
{
|
||||
return new Lay(cHECK_SHOOT_WHEN_LAYING: false, dELTA_LAY_CHECK: 2, dELTA_GETUP: 2.7, dELTA_AFTER_GETUP: 10,
|
||||
cLEAR_POINTS_OF_SCARE_SEC: 20, mAX_LAY_TIME: 35, dELTA_WANT_LAY_CHECL_SEC: 5, aTTACK_LAY_CHANCE: 25,
|
||||
dIST_TO_COVER_TO_LAY: 3.5, dIST_TO_COVER_TO_LAY_SQRT: 12.5, dIST_GRASS_TERRAIN_SQRT: 0.160000011, dIST_ENEMY_NULL_DANGER_LAY: 15,
|
||||
dIST_ENEMY_NULL_DANGER_LAY_SQRT: 225, dIST_ENEMY_GETUP_LAY: 10, dIST_ENEMY_GETUP_LAY_SQRT: 100, dIST_ENEMY_CAN_LAY: 15,
|
||||
dIST_ENEMY_CAN_LAY_SQRT: 225, lAY_AIM: 0.6, mIN_CAN_LAY_DIST_SQRT: 121, mIN_CAN_LAY_DIST: 11,
|
||||
mAX_CAN_LAY_DIST_SQRT: 40000, mAX_CAN_LAY_DIST: 200, lAY_CHANCE_DANGER: 40, dAMAGE_TIME_TO_GETUP: 3);
|
||||
}
|
||||
|
||||
public static Core GenerateCore()
|
||||
{
|
||||
return new Core(visibleAngle: 140, visibleDistance: 130, gainSightCoef: 0.1,
|
||||
scatteringPerMeter: 0.1, scatteringClosePerMeter: 0.1, damageCoeff: 1, hearingSense: 2.85,
|
||||
canRun: true, canGrenade: true, aimingType: "normal", pistolFireDistancePref: 35,
|
||||
shotgunFireDistancePref: 50, rifleFireDistancePref: 100, accuratySpeed: 0.3, waitInCoverBetweenShotsSec: 1.5);
|
||||
}
|
||||
|
||||
public static Scattering GenerateScattering()
|
||||
{
|
||||
return new Scattering(minScatter: 0.015, workingScatter: 0.15, maxScatter: 0.3,
|
||||
speedUp: 0.6, speedUpAim: 1.8, speedDown: -0.2, toSlowBotSpeed: 1.8, toLowBotSpeed: 2.8, toUpBotSpeed: 4.3,
|
||||
movingSlowCoef: 1.4, toLowBotAngularSpeed: 140, toStopBotAngularSpeed: 80, fromShot: 0.001, tracerCoef: 1.3,
|
||||
handDamageScatteringMinMax: 0.7, handDamageAccuracySpeed: 1.3, bloodFall: 1.45, caution: 0.03, toCaution: 0.6,
|
||||
recoilControlCoefShootDone: 0.0003, recoilControlCoefShootDoneAuto: 0.00015, aMPLITUDE_FACTOR: 0.015,
|
||||
aMPLITUDE_SPEED: 0.001, dIST_FROM_OLD_POINT_TO_NOT_AIM: 15, dIST_FROM_OLD_POINT_TO_NOT_AIM_SQRT: 225,
|
||||
dIST_NOT_TO_SHOOT: 0.3, poseChnageCoef: 0.1, layFactor: 0.1, recoilYCoef: 0.0005, recoilYCoefSppedDown: -0.52, recoilYMax: 1);
|
||||
}
|
||||
|
||||
public static Boss GenerateBoss()
|
||||
{
|
||||
return new Boss(bOSS_DIST_TO_WARNING: 34, bOSS_DIST_TO_WARNING_SQRT: 1156, bOSS_DIST_TO_WARNING_OUT: 43,
|
||||
bOSS_DIST_TO_WARNING_OUT_SQRT: 1849, bOSS_DIST_TO_SHOOT: 16, bOSS_DIST_TO_SHOOT_SQRT: 256, cHANCE_TO_SEND_GRENADE_100: 100,
|
||||
mAX_DIST_COVER_BOSS: 25, mAX_DIST_COVER_BOSS_SQRT: 625, mAX_DIST_DECIDER_TO_SEND: 35, mAX_DIST_DECIDER_TO_SEND_SQRT: 1225,
|
||||
tIME_AFTER_LOSE: 15, tIME_AFTER_LOSE_DELTA: 60, pERSONS_SEND: 2, dELTA_SEARCH_TIME: 18,
|
||||
cOVER_TO_SEND: true, wAIT_NO_ATTACK_SAVAGE: 10, cHANCE_USE_RESERVE_PATROL_100: 50, kILLA_Y_DELTA_TO_BE_ENEMY_BOSS: 5,
|
||||
kILLA_DITANCE_TO_BE_ENEMY_BOSS: 45, kILLA_START_SEARCH_SEC: 40, kILLA_CONTUTION_TIME: 5, kILLA_CLOSE_ATTACK_DIST: 8,
|
||||
kILLA_MIDDLE_ATTACK_DIST: 22, kILLA_LARGE_ATTACK_DIST: 41, kILLA_SEARCH_METERS: 30, kILLA_DEF_DIST_SQRT: 225,
|
||||
kILLA_SEARCH_SEC_STOP_AFTER_COMING: 25, kILLA_DIST_TO_GO_TO_SUPPRESS: 6, kILLA_AFTER_GRENADE_SUPPRESS_DELAY: 2,
|
||||
kILLA_CLOSEATTACK_TIMES: 3, kILLA_CLOSEATTACK_DELAY: 10, kILLA_HOLD_DELAY: 5, kILLA_BULLET_TO_RELOAD: 15,
|
||||
sHALL_WARN: true, kILLA_ENEMIES_TO_ATTACK: 3, kILLA_ONE_IS_CLOSE: 30, kILLA_TRIGGER_DOWN_DELAY: 1, kILLA_WAIT_IN_COVER_COEF: 1,
|
||||
kOJANIY_DIST_WHEN_READY: 40, kOJANIY_DIST_TO_BE_ENEMY: 200, kOJANIY_MIN_DIST_TO_LOOT: 20, kOJANIY_MIN_DIST_TO_LOOT_SQRT: 400,
|
||||
kOJANIY_DIST_ENEMY_TOO_CLOSE: 17, kOJANIY_MANY_ENEMIES_COEF: 1.5);
|
||||
}
|
||||
|
||||
public static Mind GenerateMind()
|
||||
{
|
||||
return new Mind(hOW_WORK_OVER_DEAD_BODY: 2, mIN_SHOOTS_TIME: 2, mAX_SHOOTS_TIME: 4,
|
||||
tIME_LEAVE_MAP: 23, tIME_TO_RUN_TO_COVER_CAUSE_SHOOT_SEC: 15, dAMAGE_REDUCTION_TIME_SEC: 20, mIN_DAMAGE_SCARE: 20,
|
||||
cHANCE_TO_RUN_CAUSE_DAMAGE_0_100: 35, tIME_TO_FORGOR_ABOUT_ENEMY_SEC: 52, tIME_TO_FIND_ENEMY: 22, mAX_AGGRO_BOT_DIST: 100,
|
||||
hIT_POINT_DETECTION: 4, dANGER_POINT_CHOOSE_COEF: 1, sIMPLE_POINT_CHOOSE_COEF: 0.4, lASTSEEN_POINT_CHOOSE_COEF: 0.2,
|
||||
cOVER_DIST_COEF: 1.5, dIST_TO_FOUND_SQRT: 400, mAX_AGGRO_BOT_DIST_SQR: 10000, dIST_TO_STOP_RUN_ENEMY: 15,
|
||||
eNEMY_LOOK_AT_ME_ANG: 15, mIN_START_AGGRESION_COEF: 1, mAX_START_AGGRESION_COEF: 3, bULLET_FEEL_DIST: 360,
|
||||
bULLET_FEEL_CLOSE_SDIST: 1, aTTACK_IMMEDIATLY_CHANCE_0_100: 40, cHANCE_FUCK_YOU_ON_CONTACT_100: 10, fRIEND_DEAD_AGR_LOW: -0.2,
|
||||
fRIEND_AGR_KILL: 0.2, lAST_ENEMY_LOOK_TO: 40, cAN_RECIVE_PLAYER_REQUESTS: true, cAN_TAKE_ITEMS: true,
|
||||
cAN_USE_MEDS: true, sUSPETION_POINT_CHANCE_ADD100: 0, aMBUSH_WHEN_UNDER_FIRE: true, aMBUSH_WHEN_UNDER_FIRE_TIME_RESIST: 60,
|
||||
aTTACK_ENEMY_IF_PROTECT_DELTA_LAST_TIME_SEEN: 1.5, hOLD_IF_PROTECT_DELTA_LAST_TIME_SEEN: 8.5, fIND_COVER_TO_GET_POSITION_WITH_SHOOT: 2,
|
||||
pROTECT_TIME_REAL: true, cHANCE_SHOOT_WHEN_WARN_PLAYER_100: 25, cAN_PANIC_IS_PROTECT: false, nO_RUN_AWAY_FOR_SAFE: false,
|
||||
pART_PERCENT_TO_HEAL: 0.65, pROTECT_DELTA_HEAL_SEC: 10, cAN_STAND_BY: true, cAN_THROW_REQUESTS: true,
|
||||
gROUP_ANY_PHRASE_DELAY: 4, gROUP_EXACTLY_PHRASE_DELAY: 4, dIST_TO_ENEMY_YO_CAN_HEAL: 30, cHANCE_TO_STAY_WHEN_WARN_PLAYER_100: 80,
|
||||
dOG_FIGHT_OUT: 6, dOG_FIGHT_IN: 3, sHOOT_INSTEAD_DOG_FIGHT: 9, pISTOL_SHOTGUN_AMBUSH_DIST: 60,
|
||||
sTANDART_AMBUSH_DIST: 200, aI_POWER_COEF: 120, cOVER_SECONDS_AFTER_LOSE_VISION: 10, cOVER_SELF_ALWAYS_IF_DAMAGED: false,
|
||||
sEC_TO_MORE_DIST_TO_RUN: 10, hEAL_DELAY_SEC: 5, hIT_DELAY_WHEN_HAVE_SMT: -1, hIT_DELAY_WHEN_PEACE: -1,
|
||||
tALK_WITH_QUERY: true, wILL_PERSUE_AXEMAN: true);
|
||||
}
|
||||
|
||||
internal static Hearing GenerateHearing()
|
||||
{
|
||||
return new Hearing(bOT_CLOSE_PANIC_DIST: 2, cHANCE_TO_HEAR_SIMPLE_SOUND_0_1: 0.45,
|
||||
dISPERSION_COEF: 1.6, cLOSE_DIST: 10, fAR_DIST: 30, sOUND_DIR_DEEFREE: 30, dIST_PLACE_TO_FIND_POINT: 70,
|
||||
dEAD_BODY_SOUND_RAD: 30, lOOK_ONLY_DANGER: false, rESET_TIMER_DIST: 17, hEAR_DELAY_WHEN_PEACE: 0.85,
|
||||
hEAR_DELAY_WHEN_HAVE_SMT: 0.56, lOOK_ONLY_DANGER_DELTA: 9);
|
||||
}
|
||||
|
||||
public static Patrol GeneratePatrol()
|
||||
{
|
||||
return new Patrol(dEAD_BODY_LOOK_PERIOD: 8, lOOK_TIME_BASE: 12, cAN_CHOOSE_RESERV: true,
|
||||
tRY_CHOOSE_RESERV_WAY_ON_START: false, cAN_LOOK_TO_DEADBODIES: true, cAN_FRIENDLY_TILT: true,
|
||||
cAN_HARD_AIM: true, rESERVE_TIME_STAY: 72, fRIEND_SEARCH_SEC: 12, tALK_DELAY: 1.1,
|
||||
mIN_TALK_DELAY: 35, tALK_DELAY_BIG: 15.1, cHANGE_WAY_TIME: 125.1, mIN_DIST_TO_CLOSE_TALK: 5,
|
||||
vISION_DIST_COEF_PEACE: 0.5, mIN_DIST_TO_CLOSE_TALK_SQR: 25, cHANCE_TO_CUT_WAY_0_100: 75, cUT_WAY_MIN_0_1: 0.4,
|
||||
cUT_WAY_MAX_0_1: 0.65, cHANCE_TO_CHANGE_WAY_0_100: 50, cHANCE_TO_SHOOT_DEADBODY: 52, sUSPETION_PLACE_LIFETIME: 7,
|
||||
rESERVE_OUT_TIME: 30, cLOSE_TO_SELECT_RESERV_WAY: 25, mAX_YDIST_TO_START_WARN_REQUEST_TO_REQUESTER: 5);
|
||||
}
|
||||
|
||||
public static Cover GenerateCover()
|
||||
{
|
||||
return new Cover(rETURN_TO_ATTACK_AFTER_AMBUSH_MIN: 20, rETURN_TO_ATTACK_AFTER_AMBUSH_MAX: 50,
|
||||
sOUND_TO_GET_SPOTTED: 2, tIME_TO_MOVE_TO_COVER: 15, mAX_DIST_OF_COVER: 4, cHANGE_RUN_TO_COVER_SEC: 5,
|
||||
cHANGE_RUN_TO_COVER_SEC_GREANDE: 0.6, mIN_DIST_TO_ENEMY: 9, dIST_CANT_CHANGE_WAY: 5, dIST_CHECK_SFETY: 9,
|
||||
tIME_CHECK_SAFE: 2, hIDE_TO_COVER_TIME: 1.5, mAX_DIST_OF_COVER_SQR: 16, dIST_CANT_CHANGE_WAY_SQR: 25,
|
||||
sPOTTED_COVERS_RADIUS: 3, lOOK_LAST_ENEMY_POS_MOVING: 1.5, lOOK_TO_HIT_POINT_IF_LAST_ENEMY: 3, lOOK_LAST_ENEMY_POS_LOOKAROUND: 45,
|
||||
oFFSET_LOOK_ALONG_WALL_ANG: 20, sPOTTED_GRENADE_RADIUS: 16, mAX_SPOTTED_TIME_SEC: 45, wAIT_INT_COVER_FINDING_ENEMY: 2,
|
||||
cLOSE_DIST_POINT_SQRT: 4, dELTA_SEEN_FROM_COVE_LAST_POS: 15, mOVE_TO_COVER_WHEN_TARGET: false, rUN_COVER_IF_CAN_AND_NO_ENEMIES: false,
|
||||
sPOTTED_GRENADE_TIME: 7, dEPENDS_Y_DIST_TO_BOT: false, rUN_IF_FAR: 10, rUN_IF_FAR_SQRT: 225,
|
||||
sTAY_IF_FAR: 25, sTAY_IF_FAR_SQRT: 625, cHECK_COVER_ENEMY_LOOK: true, sHOOT_NEAR_TO_LEAVE: 2,
|
||||
sHOOT_NEAR_SEC_PERIOD: 0.5, hITS_TO_LEAVE_COVER: 1, hITS_TO_LEAVE_COVER_UNKNOWN: 1, dOG_FIGHT_AFTER_LEAVE: 4,
|
||||
nOT_LOOK_AT_WALL_IS_DANGER: true, mIN_DEFENCE_LEVEL: 22, gOOD_DIST_TO_POINT_COEF: 1.8, eNEMY_DIST_TO_GO_OUT: 1,
|
||||
sTATIONARY_WEAPON_NO_ENEMY_GETUP: 20, sTATIONARY_WEAPON_MAX_DIST_TO_USE: 25);
|
||||
}
|
||||
|
||||
public static Change GenerateChange()
|
||||
{
|
||||
return new Change(sMOKE_VISION_DIST: 0.6, sMOKE_GAIN_SIGHT: 1.6, sMOKE_SCATTERING: 1.6,
|
||||
sMOKE_PRECICING: 1.6, sMOKE_HEARING: 1, sMOKE_ACCURATY: 1.6, sMOKE_LAY_CHANCE: 1.6,
|
||||
fLASH_VISION_DIST: 0.05, fLASH_GAIN_SIGHT: 1.8, fLASH_SCATTERING: 1.6, fLASH_PRECICING: 1.6,
|
||||
fLASH_HEARING: 1, fLASH_ACCURATY: 1.6, fLASH_LAY_CHANCE: 1, sTUN_HEARING: 0.01);
|
||||
}
|
||||
|
||||
public static Grenade GenerateGrenade()
|
||||
{
|
||||
return new Grenade(dELTA_NEXT_ATTEMPT_FROM_COVER: 5, dELTA_NEXT_ATTEMPT: 10, mIN_DIST_NOT_TO_THROW: 8,
|
||||
nEAR_DELTA_THROW_TIME_SEC: 2, mIN_THROW_GRENADE_DIST: 12, mIN_THROW_GRENADE_DIST_SQRT: 144, mIN_DIST_NOT_TO_THROW_SQR: 64,
|
||||
rUN_AWAY: 22, rUN_AWAY_SQR: 484, aDD_GRENADE_AS_DANGER: 65, aDD_GRENADE_AS_DANGER_SQR: 4225,
|
||||
cHANCE_TO_NOTIFY_ENEMY_GR_100: 99, grenadePerMeter: 0.2, rEQUEST_DIST_MUST_THROW_SQRT: 4, rEQUEST_DIST_MUST_THROW: 2,
|
||||
bEWARE_TYPE: 2, sHOOT_TO_SMOKE_CHANCE_100: 30, cHANCE_RUN_FLASHED_100: 0, mAX_FLASHED_DIST_TO_SHOOT: 10,
|
||||
mAX_FLASHED_DIST_TO_SHOOT_SQRT: 100, fLASH_GRENADE_TIME_COEF: 0.3, sIZE_SPOTTED_COEF: 2, bE_ATTENTION_COEF: 4,
|
||||
tIME_SHOOT_TO_FLASH: 4, cLOSE_TO_SMOKE_TO_SHOOT: 5, cLOSE_TO_SMOKE_TO_SHOOT_SQRT: 25, cLOSE_TO_SMOKE_TIME_DELTA: 7,
|
||||
sMOKE_CHECK_DELTA: 1, dELTA_GRENADE_START_TIME: 0.7, aMBUSH_IF_SMOKE_IN_ZONE_100: 40, aMBUSH_IF_SMOKE_RETURN_TO_ATTACK_SEC: 30,
|
||||
nO_RUN_FROM_AI_GRENADES: false, mAX_THROW_POWER: 15.7, grenadePrecision: 0.3, sTOP_WHEN_THROW_GRENADE: true,
|
||||
wAIT_TIME_TURN_AWAY: 0.2, sMOKE_SUPPRESS_DELTA: 20, dAMAGE_GRENADE_SUPPRESS_DELTA: 8, sTUN_SUPPRESS_DELTA: 9,
|
||||
cHEAT_START_GRENADE_PLACE: false, cAN_THROW_STRAIGHT_CONTACT: true, sTRAIGHT_CONTACT_DELTA_SEC: -1, aNG_TYPE: 4);
|
||||
}
|
||||
|
||||
public static Move GenerateMove()
|
||||
{
|
||||
return new Move(bASE_ROTATE_SPEED: 270, rEACH_DIST: 0.5, rEACH_DIST_RUN: 0.8, sTART_SLOW_DIST: 1.5,
|
||||
bASESTART_SLOW_DIST: 1.1, sLOW_COEF: 7, dIST_TO_CAN_CHANGE_WAY: 8, dIST_TO_START_RAYCAST: 15, bASE_START_SERACH: 35,
|
||||
uPDATE_TIME_RECAL_WAY: 7, fAR_DIST: 4, fAR_DIST_SQR: 16, dIST_TO_CAN_CHANGE_WAY_SQR: 64, dIST_TO_START_RAYCAST_SQR: 225,
|
||||
bASE_SQRT_START_SERACH: 1225, y_APPROXIMATION: 0.7, dELTA_LAST_SEEN_ENEMY: 20, rEACH_DIST_COVER: 2, rUN_TO_COVER_MIN: 2,
|
||||
cHANCE_TO_RUN_IF_NO_AMMO_0_100: 100, rUN_IF_CANT_SHOOT: false, rUN_IF_GAOL_FAR_THEN: 10, sEC_TO_CHANGE_TO_RUN: 3);
|
||||
}
|
||||
|
||||
public static Shoot GenerateShoot()
|
||||
{
|
||||
return new Shoot(rECOIL_TIME_NORMALIZE: 2, rECOIL_PER_METER: 0.1, mAX_RECOIL_PER_METER: 0.2,
|
||||
hORIZONT_RECOIL_COEF: 0.4, wAIT_NEXT_SINGLE_SHOT: 0.3, wAIT_NEXT_SINGLE_SHOT_LONG_MAX: 3.3, wAIT_NEXT_SINGLE_SHOT_LONG_MIN: 0.8,
|
||||
mARKSMAN_DIST_SEK_COEF: 44, fINGER_HOLD_SINGLE_SHOT: 0.14, bASE_AUTOMATIC_TIME: 0.1, aUTOMATIC_FIRE_SCATTERING_COEF: 1.5,
|
||||
cHANCE_TO_CHANGE_TO_AUTOMATIC_FIRE_100: 76, fAR_DIST_ENEMY: 20, sHOOT_FROM_COVER: 4, fAR_DIST_ENEMY_SQR: 400,
|
||||
mAX_DIST_COEF: 1.35, rECOIL_DELTA_PRESS: 0.15, rUN_DIST_NO_AMMO: 25, rUN_DIST_NO_AMMO_SQRT: 625,
|
||||
cAN_SHOOTS_TIME_TO_AMBUSH: 333, nOT_TO_SEE_ENEMY_TO_WANT_RELOAD_PERCENT: 0.5, nOT_TO_SEE_ENEMY_TO_WANT_RELOAD_SEC: 2,
|
||||
rELOAD_PECNET_NO_ENEMY: 0.6, cHANCE_TO_CHANGE_WEAPON: 0, cHANCE_TO_CHANGE_WEAPON_WITH_HELMET: 0,
|
||||
lOW_DIST_TO_CHANGE_WEAPON: 10, fAR_DIST_TO_CHANGE_WEAPON: 50, sUPPRESS_BY_SHOOT_TIME: 6, sUPPRESS_TRIGGERS_DOWN: 3,
|
||||
wAIT_NEXT_STATIONARY_GRENADE: 1, fINGER_HOLD_STATIONARY_GRENADE: 0.3);
|
||||
}
|
||||
|
||||
public static Look GenerateLook()
|
||||
{
|
||||
return new Look(oLD_TIME_POINT: 11, wAIT_NEW_SENSOR: 2.1,wAIT_NEW__LOOK_SENSOR: 7.8, lOOK_AROUND_DELTA: 1.1,
|
||||
mAX_VISION_GRASS_METERS: 0.4, mAX_VISION_GRASS_METERS_FLARE: 7,mAX_VISION_GRASS_METERS_OPT: 0.9090909,
|
||||
mAX_VISION_GRASS_METERS_FLARE_OPT: 0.125, lightOnVisionDistance: 30,
|
||||
fAR_DISTANCE: 160, farDeltaTimeSec: 3, mIDDLE_DIST: 90, middleDeltaTimeSec: 1, closeDeltaTimeSec: 0.1,
|
||||
pOSIBLE_VISION_SPACE: 1.2, gOAL_TO_FULL_DISSAPEAR: 0.25, gOAL_TO_FULL_DISSAPEAR_SHOOT: 0.0001, bODY_DELTA_TIME_SEARCH_SEC: 1.7,
|
||||
cOME_TO_BODY_DIST: 1.2, mARKSMAN_VISIBLE_DIST_COEF: 1.15, vISIBLE_DISNACE_WITH_LIGHT: 43, eNEMY_LIGHT_ADD: 45,
|
||||
eNEMY_LIGHT_START_DIST: 40, cAN_LOOK_TO_WALL: false, dIST_NOT_TO_IGNORE_WALL: 15, dIST_CHECK_WALL: 20,
|
||||
lOOK_LAST_POSENEMY_IF_NO_DANGER_SEC: 25, mIN_LOOK_AROUD_TIME: 20, oPTIMIZE_TO_ONLY_BODY: true);
|
||||
}
|
||||
|
||||
public static Aiming GenerateAiming()
|
||||
{
|
||||
return new Aiming(mAX_AIM_PRECICING: 4, bETTER_PRECICING_COEF: 0.7, rECALC_DIST: 0.7, rECALC_SQR_DIST: 0.48999998,
|
||||
cOEF_FROM_COVER: 0.8, pANIC_COEF: 1.2, pANIC_ACCURATY_COEF: 1.2, hARD_AIM: 0.75, pANIC_TIME: 2, rECALC_MUST_TIME: 3,
|
||||
dAMAGE_PANIC_TIME: 15, dANGER_UP_POINT: 1.3, mAX_AIMING_UPGRADE_BY_TIME: 0.85, dAMAGE_TO_DISCARD_AIM_0_100: 100,
|
||||
mIN_TIME_DISCARD_AIM_SEC: 2.9, mAX_TIME_DISCARD_AIM_SEC: 3.2, xZ_COEF: 0.75, sHOOT_TO_CHANGE_PRIORITY: 5525,
|
||||
bOTTOM_COEF: 0.3, fIRST_CONTACT_ADD_SEC: 0.1, fIRST_CONTACT_ADD_CHANCE_100: 80, bASE_HIT_AFFECTION_DELAY_SEC: 1.77,
|
||||
bASE_HIT_AFFECTION_MIN_ANG: 14, bASE_HIT_AFFECTION_MAX_ANG: 28, bASE_SHIEF: 1, sCATTERING_HAVE_DAMAGE_COEF: 2,
|
||||
sCATTERING_DIST_MODIF: 0.7, sCATTERING_DIST_MODIF_CLOSE: 0.85, aIMING_TYPE: 5, dIST_TO_SHOOT_TO_CENTER: 3,
|
||||
dIST_TO_SHOOT_NO_OFFSET: 3, sHPERE_FRIENDY_FIRE_SIZE: -1, cOEF_IF_MOVE: 1.9, tIME_COEF_IF_MOVE: 1.5, bOT_MOVE_IF_DELTA: 0.01,
|
||||
nEXT_SHOT_MISS_CHANCE_100: 100, nEXT_SHOT_MISS_Y_OFFSET: 1, aNYTIME_LIGHT_WHEN_AIM_100: -1, aNY_PART_SHOOT_TIME: 30,
|
||||
wEAPON_ROOT_OFFSET: 0.35, mIN_DAMAGE_TO_GET_HIT_AFFETS: 1, mAX_AIM_TIME: 1.5, oFFSET_RECAL_ANYWAY_TIME: 1, y_TOP_OFFSET_COEF: 0.001,
|
||||
y_BOTTOM_OFFSET_COEF: 0.015, bASE_SHIEF_STATIONARY_GRENADE: 1.1, xZ_COEF_STATIONARY_GRENADE: 0.8, dEAD_BODY_LOOK_PERIOD: 8,
|
||||
cAN_HARD_AIM: true);
|
||||
}
|
||||
}
|
||||
}
|
81
Generator/Helpers/DifficultyHelper.cs
Normal file
81
Generator/Helpers/DifficultyHelper.cs
Normal file
@ -0,0 +1,81 @@
|
||||
using Generator.Models.Output;
|
||||
|
||||
namespace Generator.Helpers
|
||||
{
|
||||
public static class DifficultyHelper
|
||||
{
|
||||
public static void AddAssaultDifficulties(Bot bot)
|
||||
{
|
||||
bot.difficulty.easy = new Models.Output.Difficulty.DifficultySettings
|
||||
{
|
||||
Lay = EasyHelper.GenerateLay(),
|
||||
Aiming = EasyHelper.GenerateAiming(),
|
||||
Look = EasyHelper.GenerateLook(),
|
||||
Shoot = EasyHelper.GenerateShoot(),
|
||||
Move = EasyHelper.GenerateMove(),
|
||||
Grenade = EasyHelper.GenerateGrenade(),
|
||||
Change = EasyHelper.GenerateChange(),
|
||||
Cover = EasyHelper.GenerateCover(),
|
||||
Patrol = EasyHelper.GeneratePatrol(),
|
||||
Hearing = EasyHelper.GenerateHearing(),
|
||||
Mind = EasyHelper.GenerateMind(),
|
||||
Boss = EasyHelper.GenerateBoss(),
|
||||
Core = EasyHelper.GenerateCore(),
|
||||
Scattering = EasyHelper.GenerateScattering()
|
||||
};
|
||||
|
||||
bot.difficulty.normal = new Models.Output.Difficulty.DifficultySettings(){
|
||||
Lay = NormalHelper.GenerateLay(),
|
||||
Aiming = NormalHelper.GenerateAiming(),
|
||||
Look = NormalHelper.GenerateLook(),
|
||||
Shoot = NormalHelper.GenerateShoot(),
|
||||
Move = NormalHelper.GenerateMove(),
|
||||
Grenade = NormalHelper.GenerateGrenade(),
|
||||
Change = NormalHelper.GenerateChange(),
|
||||
Cover = NormalHelper.GenerateCover(),
|
||||
Patrol = NormalHelper.GeneratePatrol(),
|
||||
Hearing = NormalHelper.GenerateHearing(),
|
||||
Mind = NormalHelper.GenerateMind(),
|
||||
Boss = NormalHelper.GenerateBoss(),
|
||||
Core = NormalHelper.GenerateCore(),
|
||||
Scattering = NormalHelper.GenerateScattering()
|
||||
};
|
||||
|
||||
bot.difficulty.hard = new Models.Output.Difficulty.DifficultySettings()
|
||||
{
|
||||
Lay = DifficultHelper.GenerateLay(),
|
||||
Aiming = DifficultHelper.GenerateAiming(),
|
||||
Look = DifficultHelper.GenerateLook(),
|
||||
Shoot = DifficultHelper.GenerateShoot(),
|
||||
Move = DifficultHelper.GenerateMove(),
|
||||
Grenade = DifficultHelper.GenerateGrenade(),
|
||||
Change = DifficultHelper.GenerateChange(),
|
||||
Cover = DifficultHelper.GenerateCover(),
|
||||
Patrol = DifficultHelper.GeneratePatrol(),
|
||||
Hearing = DifficultHelper.GenerateHearing(),
|
||||
Mind = DifficultHelper.GenerateMind(),
|
||||
Boss = DifficultHelper.GenerateBoss(),
|
||||
Core = DifficultHelper.GenerateCore(),
|
||||
Scattering = DifficultHelper.GenerateScattering()
|
||||
};
|
||||
bot.difficulty.impossible = new Models.Output.Difficulty.DifficultySettings()
|
||||
{
|
||||
Lay = ImpossibleHelper.GenerateLay(),
|
||||
Aiming = ImpossibleHelper.GenerateAiming(),
|
||||
Look = ImpossibleHelper.GenerateLook(),
|
||||
Shoot = ImpossibleHelper.GenerateShoot(),
|
||||
Move = ImpossibleHelper.GenerateMove(),
|
||||
Grenade = ImpossibleHelper.GenerateGrenade(),
|
||||
Change = ImpossibleHelper.GenerateChange(),
|
||||
Cover = ImpossibleHelper.GenerateCover(),
|
||||
Patrol = ImpossibleHelper.GeneratePatrol(),
|
||||
Hearing = ImpossibleHelper.GenerateHearing(),
|
||||
Mind = ImpossibleHelper.GenerateMind(),
|
||||
Boss = ImpossibleHelper.GenerateBoss(),
|
||||
Core = ImpossibleHelper.GenerateCore(),
|
||||
Scattering = ImpossibleHelper.GenerateScattering()
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
}
|
181
Generator/Helpers/EasyHelper.cs
Normal file
181
Generator/Helpers/EasyHelper.cs
Normal file
@ -0,0 +1,181 @@
|
||||
using Generator.Models.Output.Difficulty;
|
||||
|
||||
namespace Generator.Helpers
|
||||
{
|
||||
public static class EasyHelper
|
||||
{
|
||||
public static Lay GenerateLay()
|
||||
{
|
||||
return new Lay(cHECK_SHOOT_WHEN_LAYING: false, dELTA_LAY_CHECK: 2, dELTA_GETUP: 2.7, dELTA_AFTER_GETUP: 10,
|
||||
cLEAR_POINTS_OF_SCARE_SEC: 20, mAX_LAY_TIME: 35, dELTA_WANT_LAY_CHECL_SEC: 5, aTTACK_LAY_CHANCE: 25,
|
||||
dIST_TO_COVER_TO_LAY: 3.5, dIST_TO_COVER_TO_LAY_SQRT: 12.25, dIST_GRASS_TERRAIN_SQRT: 0.160000011, dIST_ENEMY_NULL_DANGER_LAY: 15,
|
||||
dIST_ENEMY_NULL_DANGER_LAY_SQRT: 225, dIST_ENEMY_GETUP_LAY: 10, dIST_ENEMY_GETUP_LAY_SQRT: 100, dIST_ENEMY_CAN_LAY: 15,
|
||||
dIST_ENEMY_CAN_LAY_SQRT: 225, lAY_AIM: 0.6, mIN_CAN_LAY_DIST_SQRT: 121, mIN_CAN_LAY_DIST: 11,
|
||||
mAX_CAN_LAY_DIST_SQRT: 40000, mAX_CAN_LAY_DIST: 200, lAY_CHANCE_DANGER: 40, dAMAGE_TIME_TO_GETUP: 3);
|
||||
}
|
||||
|
||||
public static Core GenerateCore()
|
||||
{
|
||||
return new Core(visibleAngle: 130, visibleDistance: 110, gainSightCoef: 0.2,
|
||||
scatteringPerMeter: 0.12, scatteringClosePerMeter: 0.12, damageCoeff: 1, hearingSense: 1.05,
|
||||
canRun: true, canGrenade: true, aimingType: "normal", pistolFireDistancePref: 35,
|
||||
shotgunFireDistancePref: 50, rifleFireDistancePref: 100, accuratySpeed: 0.3, waitInCoverBetweenShotsSec: 1.5);
|
||||
}
|
||||
|
||||
public static Scattering GenerateScattering()
|
||||
{
|
||||
return new Scattering(minScatter: 0.015, workingScatter: 0.15, maxScatter: 0.3,
|
||||
speedUp: 0.6, speedUpAim: 1.8, speedDown: -0.2, toSlowBotSpeed: 1.8, toLowBotSpeed: 2.8, toUpBotSpeed: 4.3,
|
||||
movingSlowCoef: 1.4, toLowBotAngularSpeed: 140, toStopBotAngularSpeed: 80, fromShot: 0.001, tracerCoef: 1.3,
|
||||
handDamageScatteringMinMax: 0.7, handDamageAccuracySpeed: 1.3, bloodFall: 1.45, caution: 0.03, toCaution: 0.6,
|
||||
recoilControlCoefShootDone: 0.0003, recoilControlCoefShootDoneAuto: 0.00015, aMPLITUDE_FACTOR: 0.015,
|
||||
aMPLITUDE_SPEED: 0.001, dIST_FROM_OLD_POINT_TO_NOT_AIM: 15, dIST_FROM_OLD_POINT_TO_NOT_AIM_SQRT: 225,
|
||||
dIST_NOT_TO_SHOOT: 0.3, poseChnageCoef: 0.1, layFactor: 0.1, recoilYCoef: 0.0005, recoilYCoefSppedDown: -0.52, recoilYMax: 1);
|
||||
}
|
||||
|
||||
public static Boss GenerateBoss()
|
||||
{
|
||||
return new Boss(bOSS_DIST_TO_WARNING: 34, bOSS_DIST_TO_WARNING_SQRT: 1156, bOSS_DIST_TO_WARNING_OUT: 43,
|
||||
bOSS_DIST_TO_WARNING_OUT_SQRT: 1849, bOSS_DIST_TO_SHOOT: 16, bOSS_DIST_TO_SHOOT_SQRT: 256, cHANCE_TO_SEND_GRENADE_100: 100,
|
||||
mAX_DIST_COVER_BOSS: 25, mAX_DIST_COVER_BOSS_SQRT: 625, mAX_DIST_DECIDER_TO_SEND: 35, mAX_DIST_DECIDER_TO_SEND_SQRT: 1225,
|
||||
tIME_AFTER_LOSE: 15, tIME_AFTER_LOSE_DELTA: 60, pERSONS_SEND: 2, dELTA_SEARCH_TIME: 18,
|
||||
cOVER_TO_SEND: true, wAIT_NO_ATTACK_SAVAGE: 10, cHANCE_USE_RESERVE_PATROL_100: 50, kILLA_Y_DELTA_TO_BE_ENEMY_BOSS: 5,
|
||||
kILLA_DITANCE_TO_BE_ENEMY_BOSS: 45, kILLA_START_SEARCH_SEC: 40, kILLA_CONTUTION_TIME: 5, kILLA_CLOSE_ATTACK_DIST: 8,
|
||||
kILLA_MIDDLE_ATTACK_DIST: 22, kILLA_LARGE_ATTACK_DIST: 41, kILLA_SEARCH_METERS: 30, kILLA_DEF_DIST_SQRT: 225,
|
||||
kILLA_SEARCH_SEC_STOP_AFTER_COMING: 25, kILLA_DIST_TO_GO_TO_SUPPRESS: 6, kILLA_AFTER_GRENADE_SUPPRESS_DELAY: 2,
|
||||
kILLA_CLOSEATTACK_TIMES: 3, kILLA_CLOSEATTACK_DELAY: 10, kILLA_HOLD_DELAY: 5, kILLA_BULLET_TO_RELOAD: 15,
|
||||
sHALL_WARN: true, kILLA_ENEMIES_TO_ATTACK: 3, kILLA_ONE_IS_CLOSE: 30, kILLA_TRIGGER_DOWN_DELAY: 1, kILLA_WAIT_IN_COVER_COEF: 1,
|
||||
kOJANIY_DIST_WHEN_READY: 40, kOJANIY_DIST_TO_BE_ENEMY: 200, kOJANIY_MIN_DIST_TO_LOOT: 20, kOJANIY_MIN_DIST_TO_LOOT_SQRT: 400,
|
||||
kOJANIY_DIST_ENEMY_TOO_CLOSE: 17, kOJANIY_MANY_ENEMIES_COEF: 1.5);
|
||||
}
|
||||
|
||||
public static Mind GenerateMind()
|
||||
{
|
||||
return new Mind(hOW_WORK_OVER_DEAD_BODY: 2, mIN_SHOOTS_TIME: 2, mAX_SHOOTS_TIME: 4,
|
||||
tIME_LEAVE_MAP: 23, tIME_TO_RUN_TO_COVER_CAUSE_SHOOT_SEC: 15, dAMAGE_REDUCTION_TIME_SEC: 20, mIN_DAMAGE_SCARE: 20,
|
||||
cHANCE_TO_RUN_CAUSE_DAMAGE_0_100: 35, tIME_TO_FORGOR_ABOUT_ENEMY_SEC: 52, tIME_TO_FIND_ENEMY: 22, mAX_AGGRO_BOT_DIST: 100,
|
||||
hIT_POINT_DETECTION: 4, dANGER_POINT_CHOOSE_COEF: 1, sIMPLE_POINT_CHOOSE_COEF: 0.4, lASTSEEN_POINT_CHOOSE_COEF: 0.2,
|
||||
cOVER_DIST_COEF: 1.5, dIST_TO_FOUND_SQRT: 400, mAX_AGGRO_BOT_DIST_SQR: 10000, dIST_TO_STOP_RUN_ENEMY: 15,
|
||||
eNEMY_LOOK_AT_ME_ANG: 15, mIN_START_AGGRESION_COEF: 1, mAX_START_AGGRESION_COEF: 3, bULLET_FEEL_DIST: 360,
|
||||
bULLET_FEEL_CLOSE_SDIST: 1, aTTACK_IMMEDIATLY_CHANCE_0_100: 40, cHANCE_FUCK_YOU_ON_CONTACT_100: 10, fRIEND_DEAD_AGR_LOW: -0.2,
|
||||
fRIEND_AGR_KILL: 0.2, lAST_ENEMY_LOOK_TO: 40, cAN_RECIVE_PLAYER_REQUESTS: true, cAN_TAKE_ITEMS: true,
|
||||
cAN_USE_MEDS: true, sUSPETION_POINT_CHANCE_ADD100: 0, aMBUSH_WHEN_UNDER_FIRE: true, aMBUSH_WHEN_UNDER_FIRE_TIME_RESIST: 60,
|
||||
aTTACK_ENEMY_IF_PROTECT_DELTA_LAST_TIME_SEEN: 1.5, hOLD_IF_PROTECT_DELTA_LAST_TIME_SEEN: 8.5, fIND_COVER_TO_GET_POSITION_WITH_SHOOT: 2,
|
||||
pROTECT_TIME_REAL: true, cHANCE_SHOOT_WHEN_WARN_PLAYER_100: 25, cAN_PANIC_IS_PROTECT: false, nO_RUN_AWAY_FOR_SAFE: false,
|
||||
pART_PERCENT_TO_HEAL: 0.65, pROTECT_DELTA_HEAL_SEC: 10, cAN_STAND_BY: true, cAN_THROW_REQUESTS: true,
|
||||
gROUP_ANY_PHRASE_DELAY: 4, gROUP_EXACTLY_PHRASE_DELAY: 4, dIST_TO_ENEMY_YO_CAN_HEAL: 30, cHANCE_TO_STAY_WHEN_WARN_PLAYER_100: 80,
|
||||
dOG_FIGHT_OUT: 6, dOG_FIGHT_IN: 3, sHOOT_INSTEAD_DOG_FIGHT: 9, pISTOL_SHOTGUN_AMBUSH_DIST: 60,
|
||||
sTANDART_AMBUSH_DIST: 200, aI_POWER_COEF: 120, cOVER_SECONDS_AFTER_LOSE_VISION: 10, cOVER_SELF_ALWAYS_IF_DAMAGED: false,
|
||||
sEC_TO_MORE_DIST_TO_RUN: 10, hEAL_DELAY_SEC: 5, hIT_DELAY_WHEN_HAVE_SMT: -1, hIT_DELAY_WHEN_PEACE: -1,
|
||||
tALK_WITH_QUERY: true, wILL_PERSUE_AXEMAN: true);
|
||||
}
|
||||
|
||||
internal static Hearing GenerateHearing()
|
||||
{
|
||||
return new Hearing(bOT_CLOSE_PANIC_DIST: 2, cHANCE_TO_HEAR_SIMPLE_SOUND_0_1: 0.45,
|
||||
dISPERSION_COEF: 1.6, cLOSE_DIST: 10, fAR_DIST: 30, sOUND_DIR_DEEFREE: 30, dIST_PLACE_TO_FIND_POINT: 70,
|
||||
dEAD_BODY_SOUND_RAD: 30, lOOK_ONLY_DANGER: false, rESET_TIMER_DIST: 17, hEAR_DELAY_WHEN_PEACE: 0.85,
|
||||
hEAR_DELAY_WHEN_HAVE_SMT: 0.56, lOOK_ONLY_DANGER_DELTA: 9);
|
||||
}
|
||||
|
||||
public static Patrol GeneratePatrol()
|
||||
{
|
||||
return new Patrol(dEAD_BODY_LOOK_PERIOD: 8, lOOK_TIME_BASE: 12, cAN_CHOOSE_RESERV: true,
|
||||
tRY_CHOOSE_RESERV_WAY_ON_START: false, cAN_LOOK_TO_DEADBODIES: true, cAN_FRIENDLY_TILT: true,
|
||||
cAN_HARD_AIM: true, rESERVE_TIME_STAY: 72, fRIEND_SEARCH_SEC: 12, tALK_DELAY: 1.1,
|
||||
mIN_TALK_DELAY: 35, tALK_DELAY_BIG: 15.1, cHANGE_WAY_TIME: 125.1, mIN_DIST_TO_CLOSE_TALK: 5,
|
||||
vISION_DIST_COEF_PEACE: 0.5, mIN_DIST_TO_CLOSE_TALK_SQR: 25, cHANCE_TO_CUT_WAY_0_100: 75, cUT_WAY_MIN_0_1: 0.4,
|
||||
cUT_WAY_MAX_0_1: 0.65, cHANCE_TO_CHANGE_WAY_0_100: 50, cHANCE_TO_SHOOT_DEADBODY: 52, sUSPETION_PLACE_LIFETIME: 7,
|
||||
rESERVE_OUT_TIME: 30, cLOSE_TO_SELECT_RESERV_WAY: 25, mAX_YDIST_TO_START_WARN_REQUEST_TO_REQUESTER: 5);
|
||||
}
|
||||
|
||||
public static Cover GenerateCover()
|
||||
{
|
||||
return new Cover(rETURN_TO_ATTACK_AFTER_AMBUSH_MIN: 20, rETURN_TO_ATTACK_AFTER_AMBUSH_MAX: 50,
|
||||
sOUND_TO_GET_SPOTTED: 2, tIME_TO_MOVE_TO_COVER: 15, mAX_DIST_OF_COVER: 4, cHANGE_RUN_TO_COVER_SEC: 5,
|
||||
cHANGE_RUN_TO_COVER_SEC_GREANDE: 0.6, mIN_DIST_TO_ENEMY: 9, dIST_CANT_CHANGE_WAY: 5, dIST_CHECK_SFETY: 9,
|
||||
tIME_CHECK_SAFE: 2, hIDE_TO_COVER_TIME: 1.5, mAX_DIST_OF_COVER_SQR: 16, dIST_CANT_CHANGE_WAY_SQR: 25,
|
||||
sPOTTED_COVERS_RADIUS: 3, lOOK_LAST_ENEMY_POS_MOVING: 1.5, lOOK_TO_HIT_POINT_IF_LAST_ENEMY: 3, lOOK_LAST_ENEMY_POS_LOOKAROUND: 45,
|
||||
oFFSET_LOOK_ALONG_WALL_ANG: 20, sPOTTED_GRENADE_RADIUS: 16, mAX_SPOTTED_TIME_SEC: 45, wAIT_INT_COVER_FINDING_ENEMY: 2,
|
||||
cLOSE_DIST_POINT_SQRT: 4, dELTA_SEEN_FROM_COVE_LAST_POS: 15, mOVE_TO_COVER_WHEN_TARGET: false, rUN_COVER_IF_CAN_AND_NO_ENEMIES: false,
|
||||
sPOTTED_GRENADE_TIME: 7, dEPENDS_Y_DIST_TO_BOT: false, rUN_IF_FAR: 10, rUN_IF_FAR_SQRT: 225,
|
||||
sTAY_IF_FAR: 25, sTAY_IF_FAR_SQRT: 625, cHECK_COVER_ENEMY_LOOK: true, sHOOT_NEAR_TO_LEAVE: 2,
|
||||
sHOOT_NEAR_SEC_PERIOD: 0.5, hITS_TO_LEAVE_COVER: 1, hITS_TO_LEAVE_COVER_UNKNOWN: 1, dOG_FIGHT_AFTER_LEAVE: 4,
|
||||
nOT_LOOK_AT_WALL_IS_DANGER: true, mIN_DEFENCE_LEVEL: 22, gOOD_DIST_TO_POINT_COEF: 1.8, eNEMY_DIST_TO_GO_OUT: 1,
|
||||
sTATIONARY_WEAPON_NO_ENEMY_GETUP: 20, sTATIONARY_WEAPON_MAX_DIST_TO_USE: 25);
|
||||
}
|
||||
|
||||
public static Change GenerateChange()
|
||||
{
|
||||
return new Change(sMOKE_VISION_DIST: 0.6, sMOKE_GAIN_SIGHT: 1.6, sMOKE_SCATTERING: 1.6,
|
||||
sMOKE_PRECICING: 1.6, sMOKE_HEARING: 1, sMOKE_ACCURATY: 1.6, sMOKE_LAY_CHANCE: 1.6,
|
||||
fLASH_VISION_DIST: 0.05, fLASH_GAIN_SIGHT: 1.8, fLASH_SCATTERING: 1.6, fLASH_PRECICING: 1.6,
|
||||
fLASH_HEARING: 1, fLASH_ACCURATY: 1.6, fLASH_LAY_CHANCE: 1, sTUN_HEARING: 0.01);
|
||||
}
|
||||
|
||||
public static Grenade GenerateGrenade()
|
||||
{
|
||||
return new Grenade(dELTA_NEXT_ATTEMPT_FROM_COVER: 5, dELTA_NEXT_ATTEMPT: 10, mIN_DIST_NOT_TO_THROW: 8,
|
||||
nEAR_DELTA_THROW_TIME_SEC: 2, mIN_THROW_GRENADE_DIST: 12, mIN_THROW_GRENADE_DIST_SQRT: 144, mIN_DIST_NOT_TO_THROW_SQR: 64,
|
||||
rUN_AWAY: 22, rUN_AWAY_SQR: 484, aDD_GRENADE_AS_DANGER: 65, aDD_GRENADE_AS_DANGER_SQR: 4225,
|
||||
cHANCE_TO_NOTIFY_ENEMY_GR_100: 99, grenadePerMeter: 0.2, rEQUEST_DIST_MUST_THROW_SQRT: 4, rEQUEST_DIST_MUST_THROW: 2,
|
||||
bEWARE_TYPE: 2, sHOOT_TO_SMOKE_CHANCE_100: 30, cHANCE_RUN_FLASHED_100: 0, mAX_FLASHED_DIST_TO_SHOOT: 10,
|
||||
mAX_FLASHED_DIST_TO_SHOOT_SQRT: 100, fLASH_GRENADE_TIME_COEF: 0.3, sIZE_SPOTTED_COEF: 2, bE_ATTENTION_COEF: 4,
|
||||
tIME_SHOOT_TO_FLASH: 4, cLOSE_TO_SMOKE_TO_SHOOT: 5, cLOSE_TO_SMOKE_TO_SHOOT_SQRT: 25, cLOSE_TO_SMOKE_TIME_DELTA: 7,
|
||||
sMOKE_CHECK_DELTA: 1, dELTA_GRENADE_START_TIME: 0.7, aMBUSH_IF_SMOKE_IN_ZONE_100: 40, aMBUSH_IF_SMOKE_RETURN_TO_ATTACK_SEC: 30,
|
||||
nO_RUN_FROM_AI_GRENADES: false, mAX_THROW_POWER: 15.7, grenadePrecision: 0.3, sTOP_WHEN_THROW_GRENADE: true,
|
||||
wAIT_TIME_TURN_AWAY: 0.2, sMOKE_SUPPRESS_DELTA: 20, dAMAGE_GRENADE_SUPPRESS_DELTA: 8, sTUN_SUPPRESS_DELTA: 9,
|
||||
cHEAT_START_GRENADE_PLACE: false, cAN_THROW_STRAIGHT_CONTACT: true, sTRAIGHT_CONTACT_DELTA_SEC: -1, aNG_TYPE: 4);
|
||||
}
|
||||
|
||||
public static Move GenerateMove()
|
||||
{
|
||||
return new Move(bASE_ROTATE_SPEED: 270, rEACH_DIST: 0.5, rEACH_DIST_RUN: 0.8, sTART_SLOW_DIST: 1.5,
|
||||
bASESTART_SLOW_DIST: 1.1, sLOW_COEF: 7, dIST_TO_CAN_CHANGE_WAY: 8, dIST_TO_START_RAYCAST: 15, bASE_START_SERACH: 35,
|
||||
uPDATE_TIME_RECAL_WAY: 7, fAR_DIST: 4, fAR_DIST_SQR: 16, dIST_TO_CAN_CHANGE_WAY_SQR: 64, dIST_TO_START_RAYCAST_SQR: 225,
|
||||
bASE_SQRT_START_SERACH: 1225, y_APPROXIMATION: 0.7, dELTA_LAST_SEEN_ENEMY: 20, rEACH_DIST_COVER: 2, rUN_TO_COVER_MIN: 2,
|
||||
cHANCE_TO_RUN_IF_NO_AMMO_0_100: 100, rUN_IF_CANT_SHOOT: false, rUN_IF_GAOL_FAR_THEN: 10, sEC_TO_CHANGE_TO_RUN: 3);
|
||||
}
|
||||
|
||||
public static Shoot GenerateShoot()
|
||||
{
|
||||
return new Shoot(rECOIL_TIME_NORMALIZE: 2, rECOIL_PER_METER: 0.1, mAX_RECOIL_PER_METER: 0.2,
|
||||
hORIZONT_RECOIL_COEF: 0.4, wAIT_NEXT_SINGLE_SHOT: 0.3, wAIT_NEXT_SINGLE_SHOT_LONG_MAX: 3.3, wAIT_NEXT_SINGLE_SHOT_LONG_MIN: 0.8,
|
||||
mARKSMAN_DIST_SEK_COEF: 44, fINGER_HOLD_SINGLE_SHOT: 0.14, bASE_AUTOMATIC_TIME: 0.1, aUTOMATIC_FIRE_SCATTERING_COEF: 1.5,
|
||||
cHANCE_TO_CHANGE_TO_AUTOMATIC_FIRE_100: 76, fAR_DIST_ENEMY: 20, sHOOT_FROM_COVER: 4, fAR_DIST_ENEMY_SQR: 400,
|
||||
mAX_DIST_COEF: 1.35, rECOIL_DELTA_PRESS: 0.15, rUN_DIST_NO_AMMO: 25, rUN_DIST_NO_AMMO_SQRT: 625,
|
||||
cAN_SHOOTS_TIME_TO_AMBUSH: 333, nOT_TO_SEE_ENEMY_TO_WANT_RELOAD_PERCENT: 0.5, nOT_TO_SEE_ENEMY_TO_WANT_RELOAD_SEC: 2,
|
||||
rELOAD_PECNET_NO_ENEMY: 0.6, cHANCE_TO_CHANGE_WEAPON: 0, cHANCE_TO_CHANGE_WEAPON_WITH_HELMET: 0,
|
||||
lOW_DIST_TO_CHANGE_WEAPON: 10, fAR_DIST_TO_CHANGE_WEAPON: 50, sUPPRESS_BY_SHOOT_TIME: 6, sUPPRESS_TRIGGERS_DOWN: 3,
|
||||
wAIT_NEXT_STATIONARY_GRENADE: 1, fINGER_HOLD_STATIONARY_GRENADE: 0.3);
|
||||
}
|
||||
|
||||
public static Look GenerateLook()
|
||||
{
|
||||
return new Look(oLD_TIME_POINT: 11, wAIT_NEW_SENSOR: 2.1,wAIT_NEW__LOOK_SENSOR: 7.8, lOOK_AROUND_DELTA: 1.1,
|
||||
mAX_VISION_GRASS_METERS: 0.4, mAX_VISION_GRASS_METERS_FLARE: 7,mAX_VISION_GRASS_METERS_OPT: 0.9090909,
|
||||
mAX_VISION_GRASS_METERS_FLARE_OPT: 0.125, lightOnVisionDistance: 30,
|
||||
fAR_DISTANCE: 160, farDeltaTimeSec: 3, mIDDLE_DIST: 90, middleDeltaTimeSec: 1, closeDeltaTimeSec: 0.1,
|
||||
pOSIBLE_VISION_SPACE: 1.2, gOAL_TO_FULL_DISSAPEAR: 0.25, gOAL_TO_FULL_DISSAPEAR_SHOOT: 0.0001, bODY_DELTA_TIME_SEARCH_SEC: 1.7,
|
||||
cOME_TO_BODY_DIST: 1.2, mARKSMAN_VISIBLE_DIST_COEF: 1.15, vISIBLE_DISNACE_WITH_LIGHT: 43, eNEMY_LIGHT_ADD: 45,
|
||||
eNEMY_LIGHT_START_DIST: 40, cAN_LOOK_TO_WALL: false, dIST_NOT_TO_IGNORE_WALL: 15, dIST_CHECK_WALL: 20,
|
||||
lOOK_LAST_POSENEMY_IF_NO_DANGER_SEC: 25, mIN_LOOK_AROUD_TIME: 20, oPTIMIZE_TO_ONLY_BODY: true);
|
||||
}
|
||||
|
||||
public static Aiming GenerateAiming()
|
||||
{
|
||||
return new Aiming(mAX_AIM_PRECICING: 4, bETTER_PRECICING_COEF: 0.7, rECALC_DIST: 0.7, rECALC_SQR_DIST: 0.48999998,
|
||||
cOEF_FROM_COVER: 0.8, pANIC_COEF: 1.2, pANIC_ACCURATY_COEF: 1.2, hARD_AIM: 0.75, pANIC_TIME: 2, rECALC_MUST_TIME: 3,
|
||||
dAMAGE_PANIC_TIME: 15, dANGER_UP_POINT: 1.3, mAX_AIMING_UPGRADE_BY_TIME: 0.85, dAMAGE_TO_DISCARD_AIM_0_100: 100,
|
||||
mIN_TIME_DISCARD_AIM_SEC: 2.9, mAX_TIME_DISCARD_AIM_SEC: 3.2, xZ_COEF: 0.75, sHOOT_TO_CHANGE_PRIORITY: 5525,
|
||||
bOTTOM_COEF: 0.3, fIRST_CONTACT_ADD_SEC: 0.1, fIRST_CONTACT_ADD_CHANCE_100: 80, bASE_HIT_AFFECTION_DELAY_SEC: 1.77,
|
||||
bASE_HIT_AFFECTION_MIN_ANG: 14, bASE_HIT_AFFECTION_MAX_ANG: 28, bASE_SHIEF: 1, sCATTERING_HAVE_DAMAGE_COEF: 2,
|
||||
sCATTERING_DIST_MODIF: 0.7, sCATTERING_DIST_MODIF_CLOSE: 0.85, aIMING_TYPE: 5, dIST_TO_SHOOT_TO_CENTER: 3,
|
||||
dIST_TO_SHOOT_NO_OFFSET: 3, sHPERE_FRIENDY_FIRE_SIZE: -1, cOEF_IF_MOVE: 1.9, tIME_COEF_IF_MOVE: 1.5, bOT_MOVE_IF_DELTA: 0.01,
|
||||
nEXT_SHOT_MISS_CHANCE_100: 100, nEXT_SHOT_MISS_Y_OFFSET: 1, aNYTIME_LIGHT_WHEN_AIM_100: -1, aNY_PART_SHOOT_TIME: 30,
|
||||
wEAPON_ROOT_OFFSET: 0.35, mIN_DAMAGE_TO_GET_HIT_AFFETS: 1, mAX_AIM_TIME: 1.5, oFFSET_RECAL_ANYWAY_TIME: 1, y_TOP_OFFSET_COEF: 0.001,
|
||||
y_BOTTOM_OFFSET_COEF: 0.015, bASE_SHIEF_STATIONARY_GRENADE: 1.1, xZ_COEF_STATIONARY_GRENADE: 0.8, dEAD_BODY_LOOK_PERIOD: 8,
|
||||
cAN_HARD_AIM: true);
|
||||
}
|
||||
}
|
||||
}
|
181
Generator/Helpers/ImpossibleHelper.cs
Normal file
181
Generator/Helpers/ImpossibleHelper.cs
Normal file
@ -0,0 +1,181 @@
|
||||
using Generator.Models.Output.Difficulty;
|
||||
|
||||
namespace Generator.Helpers
|
||||
{
|
||||
public static class ImpossibleHelper
|
||||
{
|
||||
public static Lay GenerateLay()
|
||||
{
|
||||
return new Lay(cHECK_SHOOT_WHEN_LAYING: false, dELTA_LAY_CHECK: 2, dELTA_GETUP: 2.7, dELTA_AFTER_GETUP: 10,
|
||||
cLEAR_POINTS_OF_SCARE_SEC: 20, mAX_LAY_TIME: 35, dELTA_WANT_LAY_CHECL_SEC: 5, aTTACK_LAY_CHANCE: 25,
|
||||
dIST_TO_COVER_TO_LAY: 3.5, dIST_TO_COVER_TO_LAY_SQRT: 12.5, dIST_GRASS_TERRAIN_SQRT: 0.160000011, dIST_ENEMY_NULL_DANGER_LAY: 15,
|
||||
dIST_ENEMY_NULL_DANGER_LAY_SQRT: 225, dIST_ENEMY_GETUP_LAY: 10, dIST_ENEMY_GETUP_LAY_SQRT: 100, dIST_ENEMY_CAN_LAY: 15,
|
||||
dIST_ENEMY_CAN_LAY_SQRT: 225, lAY_AIM: 0.6, mIN_CAN_LAY_DIST_SQRT: 121, mIN_CAN_LAY_DIST: 11,
|
||||
mAX_CAN_LAY_DIST_SQRT: 40000, mAX_CAN_LAY_DIST: 200, lAY_CHANCE_DANGER: 40, dAMAGE_TIME_TO_GETUP: 3);
|
||||
}
|
||||
|
||||
public static Core GenerateCore()
|
||||
{
|
||||
return new Core(visibleAngle: 140, visibleDistance: 130, gainSightCoef: 0.1,
|
||||
scatteringPerMeter: 0.1, scatteringClosePerMeter: 0.1, damageCoeff: 1, hearingSense: 2.85,
|
||||
canRun: true, canGrenade: true, aimingType: "normal", pistolFireDistancePref: 35,
|
||||
shotgunFireDistancePref: 50, rifleFireDistancePref: 100, accuratySpeed: 0.3, waitInCoverBetweenShotsSec: 1.5);
|
||||
}
|
||||
|
||||
public static Scattering GenerateScattering()
|
||||
{
|
||||
return new Scattering(minScatter: 0.015, workingScatter: 0.15, maxScatter: 0.3,
|
||||
speedUp: 0.6, speedUpAim: 1.8, speedDown: -0.2, toSlowBotSpeed: 1.8, toLowBotSpeed: 2.8, toUpBotSpeed: 4.3,
|
||||
movingSlowCoef: 1.4, toLowBotAngularSpeed: 140, toStopBotAngularSpeed: 80, fromShot: 0.001, tracerCoef: 1.3,
|
||||
handDamageScatteringMinMax: 0.7, handDamageAccuracySpeed: 1.3, bloodFall: 1.45, caution: 0.03, toCaution: 0.6,
|
||||
recoilControlCoefShootDone: 0.0003, recoilControlCoefShootDoneAuto: 0.00015, aMPLITUDE_FACTOR: 0.015,
|
||||
aMPLITUDE_SPEED: 0.001, dIST_FROM_OLD_POINT_TO_NOT_AIM: 15, dIST_FROM_OLD_POINT_TO_NOT_AIM_SQRT: 225,
|
||||
dIST_NOT_TO_SHOOT: 0.3, poseChnageCoef: 0.1, layFactor: 0.1, recoilYCoef: 0.0005, recoilYCoefSppedDown: -0.52, recoilYMax: 1);
|
||||
}
|
||||
|
||||
public static Boss GenerateBoss()
|
||||
{
|
||||
return new Boss(bOSS_DIST_TO_WARNING: 34, bOSS_DIST_TO_WARNING_SQRT: 1156, bOSS_DIST_TO_WARNING_OUT: 43,
|
||||
bOSS_DIST_TO_WARNING_OUT_SQRT: 1849, bOSS_DIST_TO_SHOOT: 16, bOSS_DIST_TO_SHOOT_SQRT: 256, cHANCE_TO_SEND_GRENADE_100: 100,
|
||||
mAX_DIST_COVER_BOSS: 25, mAX_DIST_COVER_BOSS_SQRT: 625, mAX_DIST_DECIDER_TO_SEND: 35, mAX_DIST_DECIDER_TO_SEND_SQRT: 1225,
|
||||
tIME_AFTER_LOSE: 15, tIME_AFTER_LOSE_DELTA: 60, pERSONS_SEND: 2, dELTA_SEARCH_TIME: 18,
|
||||
cOVER_TO_SEND: true, wAIT_NO_ATTACK_SAVAGE: 10, cHANCE_USE_RESERVE_PATROL_100: 50, kILLA_Y_DELTA_TO_BE_ENEMY_BOSS: 5,
|
||||
kILLA_DITANCE_TO_BE_ENEMY_BOSS: 45, kILLA_START_SEARCH_SEC: 40, kILLA_CONTUTION_TIME: 5, kILLA_CLOSE_ATTACK_DIST: 8,
|
||||
kILLA_MIDDLE_ATTACK_DIST: 22, kILLA_LARGE_ATTACK_DIST: 41, kILLA_SEARCH_METERS: 30, kILLA_DEF_DIST_SQRT: 225,
|
||||
kILLA_SEARCH_SEC_STOP_AFTER_COMING: 25, kILLA_DIST_TO_GO_TO_SUPPRESS: 6, kILLA_AFTER_GRENADE_SUPPRESS_DELAY: 2,
|
||||
kILLA_CLOSEATTACK_TIMES: 3, kILLA_CLOSEATTACK_DELAY: 10, kILLA_HOLD_DELAY: 5, kILLA_BULLET_TO_RELOAD: 15,
|
||||
sHALL_WARN: true, kILLA_ENEMIES_TO_ATTACK: 3, kILLA_ONE_IS_CLOSE: 30, kILLA_TRIGGER_DOWN_DELAY: 1, kILLA_WAIT_IN_COVER_COEF: 1,
|
||||
kOJANIY_DIST_WHEN_READY: 40, kOJANIY_DIST_TO_BE_ENEMY: 200, kOJANIY_MIN_DIST_TO_LOOT: 20, kOJANIY_MIN_DIST_TO_LOOT_SQRT: 400,
|
||||
kOJANIY_DIST_ENEMY_TOO_CLOSE: 17, kOJANIY_MANY_ENEMIES_COEF: 1.5);
|
||||
}
|
||||
|
||||
public static Mind GenerateMind()
|
||||
{
|
||||
return new Mind(hOW_WORK_OVER_DEAD_BODY: 2, mIN_SHOOTS_TIME: 2, mAX_SHOOTS_TIME: 4,
|
||||
tIME_LEAVE_MAP: 23, tIME_TO_RUN_TO_COVER_CAUSE_SHOOT_SEC: 15, dAMAGE_REDUCTION_TIME_SEC: 20, mIN_DAMAGE_SCARE: 20,
|
||||
cHANCE_TO_RUN_CAUSE_DAMAGE_0_100: 35, tIME_TO_FORGOR_ABOUT_ENEMY_SEC: 52, tIME_TO_FIND_ENEMY: 22, mAX_AGGRO_BOT_DIST: 100,
|
||||
hIT_POINT_DETECTION: 4, dANGER_POINT_CHOOSE_COEF: 1, sIMPLE_POINT_CHOOSE_COEF: 0.4, lASTSEEN_POINT_CHOOSE_COEF: 0.2,
|
||||
cOVER_DIST_COEF: 1.5, dIST_TO_FOUND_SQRT: 400, mAX_AGGRO_BOT_DIST_SQR: 10000, dIST_TO_STOP_RUN_ENEMY: 15,
|
||||
eNEMY_LOOK_AT_ME_ANG: 15, mIN_START_AGGRESION_COEF: 1, mAX_START_AGGRESION_COEF: 3, bULLET_FEEL_DIST: 360,
|
||||
bULLET_FEEL_CLOSE_SDIST: 1, aTTACK_IMMEDIATLY_CHANCE_0_100: 40, cHANCE_FUCK_YOU_ON_CONTACT_100: 10, fRIEND_DEAD_AGR_LOW: -0.2,
|
||||
fRIEND_AGR_KILL: 0.2, lAST_ENEMY_LOOK_TO: 40, cAN_RECIVE_PLAYER_REQUESTS: true, cAN_TAKE_ITEMS: true,
|
||||
cAN_USE_MEDS: true, sUSPETION_POINT_CHANCE_ADD100: 0, aMBUSH_WHEN_UNDER_FIRE: true, aMBUSH_WHEN_UNDER_FIRE_TIME_RESIST: 60,
|
||||
aTTACK_ENEMY_IF_PROTECT_DELTA_LAST_TIME_SEEN: 1.5, hOLD_IF_PROTECT_DELTA_LAST_TIME_SEEN: 8.5, fIND_COVER_TO_GET_POSITION_WITH_SHOOT: 2,
|
||||
pROTECT_TIME_REAL: true, cHANCE_SHOOT_WHEN_WARN_PLAYER_100: 25, cAN_PANIC_IS_PROTECT: false, nO_RUN_AWAY_FOR_SAFE: false,
|
||||
pART_PERCENT_TO_HEAL: 0.65, pROTECT_DELTA_HEAL_SEC: 10, cAN_STAND_BY: true, cAN_THROW_REQUESTS: true,
|
||||
gROUP_ANY_PHRASE_DELAY: 4, gROUP_EXACTLY_PHRASE_DELAY: 4, dIST_TO_ENEMY_YO_CAN_HEAL: 30, cHANCE_TO_STAY_WHEN_WARN_PLAYER_100: 80,
|
||||
dOG_FIGHT_OUT: 6, dOG_FIGHT_IN: 3, sHOOT_INSTEAD_DOG_FIGHT: 9, pISTOL_SHOTGUN_AMBUSH_DIST: 60,
|
||||
sTANDART_AMBUSH_DIST: 200, aI_POWER_COEF: 120, cOVER_SECONDS_AFTER_LOSE_VISION: 10, cOVER_SELF_ALWAYS_IF_DAMAGED: false,
|
||||
sEC_TO_MORE_DIST_TO_RUN: 10, hEAL_DELAY_SEC: 5, hIT_DELAY_WHEN_HAVE_SMT: -1, hIT_DELAY_WHEN_PEACE: -1,
|
||||
tALK_WITH_QUERY: true, wILL_PERSUE_AXEMAN: true);
|
||||
}
|
||||
|
||||
internal static Hearing GenerateHearing()
|
||||
{
|
||||
return new Hearing(bOT_CLOSE_PANIC_DIST: 2, cHANCE_TO_HEAR_SIMPLE_SOUND_0_1: 0.45,
|
||||
dISPERSION_COEF: 1.6, cLOSE_DIST: 10, fAR_DIST: 30, sOUND_DIR_DEEFREE: 30, dIST_PLACE_TO_FIND_POINT: 70,
|
||||
dEAD_BODY_SOUND_RAD: 30, lOOK_ONLY_DANGER: false, rESET_TIMER_DIST: 17, hEAR_DELAY_WHEN_PEACE: 0.85,
|
||||
hEAR_DELAY_WHEN_HAVE_SMT: 0.56, lOOK_ONLY_DANGER_DELTA: 9);
|
||||
}
|
||||
|
||||
public static Patrol GeneratePatrol()
|
||||
{
|
||||
return new Patrol(dEAD_BODY_LOOK_PERIOD: 8, lOOK_TIME_BASE: 12, cAN_CHOOSE_RESERV: true,
|
||||
tRY_CHOOSE_RESERV_WAY_ON_START: false, cAN_LOOK_TO_DEADBODIES: true, cAN_FRIENDLY_TILT: true,
|
||||
cAN_HARD_AIM: true, rESERVE_TIME_STAY: 72, fRIEND_SEARCH_SEC: 12, tALK_DELAY: 1.1,
|
||||
mIN_TALK_DELAY: 35, tALK_DELAY_BIG: 15.1, cHANGE_WAY_TIME: 125.1, mIN_DIST_TO_CLOSE_TALK: 5,
|
||||
vISION_DIST_COEF_PEACE: 0.5, mIN_DIST_TO_CLOSE_TALK_SQR: 25, cHANCE_TO_CUT_WAY_0_100: 75, cUT_WAY_MIN_0_1: 0.4,
|
||||
cUT_WAY_MAX_0_1: 0.65, cHANCE_TO_CHANGE_WAY_0_100: 50, cHANCE_TO_SHOOT_DEADBODY: 52, sUSPETION_PLACE_LIFETIME: 7,
|
||||
rESERVE_OUT_TIME: 30, cLOSE_TO_SELECT_RESERV_WAY: 25, mAX_YDIST_TO_START_WARN_REQUEST_TO_REQUESTER: 5);
|
||||
}
|
||||
|
||||
public static Cover GenerateCover()
|
||||
{
|
||||
return new Cover(rETURN_TO_ATTACK_AFTER_AMBUSH_MIN: 20, rETURN_TO_ATTACK_AFTER_AMBUSH_MAX: 50,
|
||||
sOUND_TO_GET_SPOTTED: 2, tIME_TO_MOVE_TO_COVER: 15, mAX_DIST_OF_COVER: 4, cHANGE_RUN_TO_COVER_SEC: 5,
|
||||
cHANGE_RUN_TO_COVER_SEC_GREANDE: 0.6, mIN_DIST_TO_ENEMY: 9, dIST_CANT_CHANGE_WAY: 5, dIST_CHECK_SFETY: 9,
|
||||
tIME_CHECK_SAFE: 2, hIDE_TO_COVER_TIME: 1.5, mAX_DIST_OF_COVER_SQR: 16, dIST_CANT_CHANGE_WAY_SQR: 25,
|
||||
sPOTTED_COVERS_RADIUS: 3, lOOK_LAST_ENEMY_POS_MOVING: 1.5, lOOK_TO_HIT_POINT_IF_LAST_ENEMY: 3, lOOK_LAST_ENEMY_POS_LOOKAROUND: 45,
|
||||
oFFSET_LOOK_ALONG_WALL_ANG: 20, sPOTTED_GRENADE_RADIUS: 16, mAX_SPOTTED_TIME_SEC: 45, wAIT_INT_COVER_FINDING_ENEMY: 2,
|
||||
cLOSE_DIST_POINT_SQRT: 4, dELTA_SEEN_FROM_COVE_LAST_POS: 15, mOVE_TO_COVER_WHEN_TARGET: false, rUN_COVER_IF_CAN_AND_NO_ENEMIES: false,
|
||||
sPOTTED_GRENADE_TIME: 7, dEPENDS_Y_DIST_TO_BOT: false, rUN_IF_FAR: 10, rUN_IF_FAR_SQRT: 225,
|
||||
sTAY_IF_FAR: 25, sTAY_IF_FAR_SQRT: 625, cHECK_COVER_ENEMY_LOOK: true, sHOOT_NEAR_TO_LEAVE: 2,
|
||||
sHOOT_NEAR_SEC_PERIOD: 0.5, hITS_TO_LEAVE_COVER: 1, hITS_TO_LEAVE_COVER_UNKNOWN: 1, dOG_FIGHT_AFTER_LEAVE: 4,
|
||||
nOT_LOOK_AT_WALL_IS_DANGER: true, mIN_DEFENCE_LEVEL: 22, gOOD_DIST_TO_POINT_COEF: 1.8, eNEMY_DIST_TO_GO_OUT: 1,
|
||||
sTATIONARY_WEAPON_NO_ENEMY_GETUP: 20, sTATIONARY_WEAPON_MAX_DIST_TO_USE: 25);
|
||||
}
|
||||
|
||||
public static Change GenerateChange()
|
||||
{
|
||||
return new Change(sMOKE_VISION_DIST: 0.6, sMOKE_GAIN_SIGHT: 1.6, sMOKE_SCATTERING: 1.6,
|
||||
sMOKE_PRECICING: 1.6, sMOKE_HEARING: 1, sMOKE_ACCURATY: 1.6, sMOKE_LAY_CHANCE: 1.6,
|
||||
fLASH_VISION_DIST: 0.05, fLASH_GAIN_SIGHT: 1.8, fLASH_SCATTERING: 1.6, fLASH_PRECICING: 1.6,
|
||||
fLASH_HEARING: 1, fLASH_ACCURATY: 1.6, fLASH_LAY_CHANCE: 1, sTUN_HEARING: 0.01);
|
||||
}
|
||||
|
||||
public static Grenade GenerateGrenade()
|
||||
{
|
||||
return new Grenade(dELTA_NEXT_ATTEMPT_FROM_COVER: 5, dELTA_NEXT_ATTEMPT: 10, mIN_DIST_NOT_TO_THROW: 8,
|
||||
nEAR_DELTA_THROW_TIME_SEC: 2, mIN_THROW_GRENADE_DIST: 12, mIN_THROW_GRENADE_DIST_SQRT: 144, mIN_DIST_NOT_TO_THROW_SQR: 64,
|
||||
rUN_AWAY: 22, rUN_AWAY_SQR: 484, aDD_GRENADE_AS_DANGER: 65, aDD_GRENADE_AS_DANGER_SQR: 4225,
|
||||
cHANCE_TO_NOTIFY_ENEMY_GR_100: 99, grenadePerMeter: 0.2, rEQUEST_DIST_MUST_THROW_SQRT: 4, rEQUEST_DIST_MUST_THROW: 2,
|
||||
bEWARE_TYPE: 2, sHOOT_TO_SMOKE_CHANCE_100: 30, cHANCE_RUN_FLASHED_100: 0, mAX_FLASHED_DIST_TO_SHOOT: 10,
|
||||
mAX_FLASHED_DIST_TO_SHOOT_SQRT: 100, fLASH_GRENADE_TIME_COEF: 0.3, sIZE_SPOTTED_COEF: 2, bE_ATTENTION_COEF: 4,
|
||||
tIME_SHOOT_TO_FLASH: 4, cLOSE_TO_SMOKE_TO_SHOOT: 5, cLOSE_TO_SMOKE_TO_SHOOT_SQRT: 25, cLOSE_TO_SMOKE_TIME_DELTA: 7,
|
||||
sMOKE_CHECK_DELTA: 1, dELTA_GRENADE_START_TIME: 0.7, aMBUSH_IF_SMOKE_IN_ZONE_100: 40, aMBUSH_IF_SMOKE_RETURN_TO_ATTACK_SEC: 30,
|
||||
nO_RUN_FROM_AI_GRENADES: false, mAX_THROW_POWER: 15.7, grenadePrecision: 0.3, sTOP_WHEN_THROW_GRENADE: true,
|
||||
wAIT_TIME_TURN_AWAY: 0.2, sMOKE_SUPPRESS_DELTA: 20, dAMAGE_GRENADE_SUPPRESS_DELTA: 8, sTUN_SUPPRESS_DELTA: 9,
|
||||
cHEAT_START_GRENADE_PLACE: false, cAN_THROW_STRAIGHT_CONTACT: true, sTRAIGHT_CONTACT_DELTA_SEC: -1, aNG_TYPE: 4);
|
||||
}
|
||||
|
||||
public static Move GenerateMove()
|
||||
{
|
||||
return new Move(bASE_ROTATE_SPEED: 270, rEACH_DIST: 0.5, rEACH_DIST_RUN: 0.8, sTART_SLOW_DIST: 1.5,
|
||||
bASESTART_SLOW_DIST: 1.1, sLOW_COEF: 7, dIST_TO_CAN_CHANGE_WAY: 8, dIST_TO_START_RAYCAST: 15, bASE_START_SERACH: 35,
|
||||
uPDATE_TIME_RECAL_WAY: 7, fAR_DIST: 4, fAR_DIST_SQR: 16, dIST_TO_CAN_CHANGE_WAY_SQR: 64, dIST_TO_START_RAYCAST_SQR: 225,
|
||||
bASE_SQRT_START_SERACH: 1225, y_APPROXIMATION: 0.7, dELTA_LAST_SEEN_ENEMY: 20, rEACH_DIST_COVER: 2, rUN_TO_COVER_MIN: 2,
|
||||
cHANCE_TO_RUN_IF_NO_AMMO_0_100: 100, rUN_IF_CANT_SHOOT: false, rUN_IF_GAOL_FAR_THEN: 10, sEC_TO_CHANGE_TO_RUN: 3);
|
||||
}
|
||||
|
||||
public static Shoot GenerateShoot()
|
||||
{
|
||||
return new Shoot(rECOIL_TIME_NORMALIZE: 2, rECOIL_PER_METER: 0.1, mAX_RECOIL_PER_METER: 0.2,
|
||||
hORIZONT_RECOIL_COEF: 0.4, wAIT_NEXT_SINGLE_SHOT: 0.3, wAIT_NEXT_SINGLE_SHOT_LONG_MAX: 3.3, wAIT_NEXT_SINGLE_SHOT_LONG_MIN: 0.8,
|
||||
mARKSMAN_DIST_SEK_COEF: 44, fINGER_HOLD_SINGLE_SHOT: 0.14, bASE_AUTOMATIC_TIME: 0.1, aUTOMATIC_FIRE_SCATTERING_COEF: 1.5,
|
||||
cHANCE_TO_CHANGE_TO_AUTOMATIC_FIRE_100: 76, fAR_DIST_ENEMY: 20, sHOOT_FROM_COVER: 4, fAR_DIST_ENEMY_SQR: 400,
|
||||
mAX_DIST_COEF: 1.35, rECOIL_DELTA_PRESS: 0.15, rUN_DIST_NO_AMMO: 25, rUN_DIST_NO_AMMO_SQRT: 625,
|
||||
cAN_SHOOTS_TIME_TO_AMBUSH: 333, nOT_TO_SEE_ENEMY_TO_WANT_RELOAD_PERCENT: 0.5, nOT_TO_SEE_ENEMY_TO_WANT_RELOAD_SEC: 2,
|
||||
rELOAD_PECNET_NO_ENEMY: 0.6, cHANCE_TO_CHANGE_WEAPON: 0, cHANCE_TO_CHANGE_WEAPON_WITH_HELMET: 0,
|
||||
lOW_DIST_TO_CHANGE_WEAPON: 10, fAR_DIST_TO_CHANGE_WEAPON: 50, sUPPRESS_BY_SHOOT_TIME: 6, sUPPRESS_TRIGGERS_DOWN: 3,
|
||||
wAIT_NEXT_STATIONARY_GRENADE: 1, fINGER_HOLD_STATIONARY_GRENADE: 0.3);
|
||||
}
|
||||
|
||||
public static Look GenerateLook()
|
||||
{
|
||||
return new Look(oLD_TIME_POINT: 11, wAIT_NEW_SENSOR: 2.1,wAIT_NEW__LOOK_SENSOR: 7.8, lOOK_AROUND_DELTA: 1.1,
|
||||
mAX_VISION_GRASS_METERS: 0.4, mAX_VISION_GRASS_METERS_FLARE: 7,mAX_VISION_GRASS_METERS_OPT: 0.9090909,
|
||||
mAX_VISION_GRASS_METERS_FLARE_OPT: 0.125, lightOnVisionDistance: 30,
|
||||
fAR_DISTANCE: 160, farDeltaTimeSec: 3, mIDDLE_DIST: 90, middleDeltaTimeSec: 1, closeDeltaTimeSec: 0.1,
|
||||
pOSIBLE_VISION_SPACE: 1.2, gOAL_TO_FULL_DISSAPEAR: 0.25, gOAL_TO_FULL_DISSAPEAR_SHOOT: 0.0001, bODY_DELTA_TIME_SEARCH_SEC: 1.7,
|
||||
cOME_TO_BODY_DIST: 1.2, mARKSMAN_VISIBLE_DIST_COEF: 1.15, vISIBLE_DISNACE_WITH_LIGHT: 43, eNEMY_LIGHT_ADD: 45,
|
||||
eNEMY_LIGHT_START_DIST: 40, cAN_LOOK_TO_WALL: false, dIST_NOT_TO_IGNORE_WALL: 15, dIST_CHECK_WALL: 20,
|
||||
lOOK_LAST_POSENEMY_IF_NO_DANGER_SEC: 25, mIN_LOOK_AROUD_TIME: 20, oPTIMIZE_TO_ONLY_BODY: true);
|
||||
}
|
||||
|
||||
public static Aiming GenerateAiming()
|
||||
{
|
||||
return new Aiming(mAX_AIM_PRECICING: 4, bETTER_PRECICING_COEF: 0.7, rECALC_DIST: 0.7, rECALC_SQR_DIST: 0.48999998,
|
||||
cOEF_FROM_COVER: 0.8, pANIC_COEF: 1.2, pANIC_ACCURATY_COEF: 1.2, hARD_AIM: 0.75, pANIC_TIME: 2, rECALC_MUST_TIME: 3,
|
||||
dAMAGE_PANIC_TIME: 15, dANGER_UP_POINT: 1.3, mAX_AIMING_UPGRADE_BY_TIME: 0.85, dAMAGE_TO_DISCARD_AIM_0_100: 100,
|
||||
mIN_TIME_DISCARD_AIM_SEC: 2.9, mAX_TIME_DISCARD_AIM_SEC: 3.2, xZ_COEF: 0.75, sHOOT_TO_CHANGE_PRIORITY: 5525,
|
||||
bOTTOM_COEF: 0.3, fIRST_CONTACT_ADD_SEC: 0.1, fIRST_CONTACT_ADD_CHANCE_100: 80, bASE_HIT_AFFECTION_DELAY_SEC: 1.77,
|
||||
bASE_HIT_AFFECTION_MIN_ANG: 14, bASE_HIT_AFFECTION_MAX_ANG: 28, bASE_SHIEF: 1, sCATTERING_HAVE_DAMAGE_COEF: 2,
|
||||
sCATTERING_DIST_MODIF: 0.7, sCATTERING_DIST_MODIF_CLOSE: 0.85, aIMING_TYPE: 5, dIST_TO_SHOOT_TO_CENTER: 3,
|
||||
dIST_TO_SHOOT_NO_OFFSET: 3, sHPERE_FRIENDY_FIRE_SIZE: -1, cOEF_IF_MOVE: 1.9, tIME_COEF_IF_MOVE: 1.5, bOT_MOVE_IF_DELTA: 0.01,
|
||||
nEXT_SHOT_MISS_CHANCE_100: 100, nEXT_SHOT_MISS_Y_OFFSET: 1, aNYTIME_LIGHT_WHEN_AIM_100: -1, aNY_PART_SHOOT_TIME: 30,
|
||||
wEAPON_ROOT_OFFSET: 0.35, mIN_DAMAGE_TO_GET_HIT_AFFETS: 1, mAX_AIM_TIME: 1.5, oFFSET_RECAL_ANYWAY_TIME: 1, y_TOP_OFFSET_COEF: 0.001,
|
||||
y_BOTTOM_OFFSET_COEF: 0.015, bASE_SHIEF_STATIONARY_GRENADE: 1.1, xZ_COEF_STATIONARY_GRENADE: 0.8, dEAD_BODY_LOOK_PERIOD: 8,
|
||||
cAN_HARD_AIM: true);
|
||||
}
|
||||
}
|
||||
}
|
17
Generator/Helpers/LoggingHelpers.cs
Normal file
17
Generator/Helpers/LoggingHelpers.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace Generator.Helpers
|
||||
{
|
||||
public static class LoggingHelpers
|
||||
{
|
||||
internal static string LogTimeTaken(double totalSeconds)
|
||||
{
|
||||
return Math.Round(totalSeconds, 2, MidpointRounding.ToEven).ToString();
|
||||
}
|
||||
|
||||
public static void LogToConsole(string message)
|
||||
{
|
||||
Console.WriteLine(message);
|
||||
}
|
||||
}
|
||||
}
|
182
Generator/Helpers/NormalHelper.cs
Normal file
182
Generator/Helpers/NormalHelper.cs
Normal file
@ -0,0 +1,182 @@
|
||||
using Generator.Models.Output.Difficulty;
|
||||
|
||||
namespace Generator.Helpers
|
||||
{
|
||||
public static class NormalHelper
|
||||
{
|
||||
public static Lay GenerateLay()
|
||||
{
|
||||
return new Lay(cHECK_SHOOT_WHEN_LAYING: false, dELTA_LAY_CHECK: 2, dELTA_GETUP: 2.7, dELTA_AFTER_GETUP: 10,
|
||||
cLEAR_POINTS_OF_SCARE_SEC: 20, mAX_LAY_TIME: 35, dELTA_WANT_LAY_CHECL_SEC: 5, aTTACK_LAY_CHANCE: 25,
|
||||
dIST_TO_COVER_TO_LAY: 3.5, dIST_TO_COVER_TO_LAY_SQRT: 12.25, dIST_GRASS_TERRAIN_SQRT: 0.160000011,
|
||||
dIST_ENEMY_NULL_DANGER_LAY: 15, dIST_ENEMY_NULL_DANGER_LAY_SQRT: 225, dIST_ENEMY_GETUP_LAY: 10,
|
||||
dIST_ENEMY_GETUP_LAY_SQRT: 100, dIST_ENEMY_CAN_LAY: 15, dIST_ENEMY_CAN_LAY_SQRT: 225, lAY_AIM: 0.6,
|
||||
mIN_CAN_LAY_DIST_SQRT: 121, mIN_CAN_LAY_DIST: 11, mAX_CAN_LAY_DIST_SQRT: 40000, mAX_CAN_LAY_DIST: 200,
|
||||
lAY_CHANCE_DANGER: 40, dAMAGE_TIME_TO_GETUP: 3);
|
||||
}
|
||||
|
||||
public static Core GenerateCore()
|
||||
{
|
||||
return new Core(visibleAngle: 140, visibleDistance: 130, gainSightCoef: 0.1,
|
||||
scatteringPerMeter: 0.1, scatteringClosePerMeter: 0.1, damageCoeff: 1, hearingSense: 2.85,
|
||||
canRun: true, canGrenade: true, aimingType: "normal", pistolFireDistancePref: 35,
|
||||
shotgunFireDistancePref: 50, rifleFireDistancePref: 100, accuratySpeed: 0.3, waitInCoverBetweenShotsSec: 1.5);
|
||||
}
|
||||
|
||||
public static Scattering GenerateScattering()
|
||||
{
|
||||
return new Scattering(minScatter: 0.015, workingScatter: 0.15, maxScatter: 0.3,
|
||||
speedUp: 0.6, speedUpAim: 1.8, speedDown: -0.2, toSlowBotSpeed: 1.8, toLowBotSpeed: 2.8, toUpBotSpeed: 4.3,
|
||||
movingSlowCoef: 1.4, toLowBotAngularSpeed: 140, toStopBotAngularSpeed: 80, fromShot: 0.001, tracerCoef: 1.3,
|
||||
handDamageScatteringMinMax: 0.7, handDamageAccuracySpeed: 1.3, bloodFall: 1.45, caution: 0.03, toCaution: 0.6,
|
||||
recoilControlCoefShootDone: 0.0003, recoilControlCoefShootDoneAuto: 0.00015, aMPLITUDE_FACTOR: 0.015,
|
||||
aMPLITUDE_SPEED: 0.001, dIST_FROM_OLD_POINT_TO_NOT_AIM: 15, dIST_FROM_OLD_POINT_TO_NOT_AIM_SQRT: 225,
|
||||
dIST_NOT_TO_SHOOT: 0.3, poseChnageCoef: 0.1, layFactor: 0.1, recoilYCoef: 0.0005, recoilYCoefSppedDown: -0.52, recoilYMax: 1);
|
||||
}
|
||||
|
||||
public static Boss GenerateBoss()
|
||||
{
|
||||
return new Boss(bOSS_DIST_TO_WARNING: 34, bOSS_DIST_TO_WARNING_SQRT: 1156, bOSS_DIST_TO_WARNING_OUT: 43,
|
||||
bOSS_DIST_TO_WARNING_OUT_SQRT: 1849, bOSS_DIST_TO_SHOOT: 16, bOSS_DIST_TO_SHOOT_SQRT: 256, cHANCE_TO_SEND_GRENADE_100: 100,
|
||||
mAX_DIST_COVER_BOSS: 25, mAX_DIST_COVER_BOSS_SQRT: 625, mAX_DIST_DECIDER_TO_SEND: 35, mAX_DIST_DECIDER_TO_SEND_SQRT: 1225,
|
||||
tIME_AFTER_LOSE: 15, tIME_AFTER_LOSE_DELTA: 60, pERSONS_SEND: 2, dELTA_SEARCH_TIME: 18,
|
||||
cOVER_TO_SEND: true, wAIT_NO_ATTACK_SAVAGE: 10, cHANCE_USE_RESERVE_PATROL_100: 50, kILLA_Y_DELTA_TO_BE_ENEMY_BOSS: 5,
|
||||
kILLA_DITANCE_TO_BE_ENEMY_BOSS: 45, kILLA_START_SEARCH_SEC: 40, kILLA_CONTUTION_TIME: 5, kILLA_CLOSE_ATTACK_DIST: 8,
|
||||
kILLA_MIDDLE_ATTACK_DIST: 22, kILLA_LARGE_ATTACK_DIST: 41, kILLA_SEARCH_METERS: 30, kILLA_DEF_DIST_SQRT: 225,
|
||||
kILLA_SEARCH_SEC_STOP_AFTER_COMING: 25, kILLA_DIST_TO_GO_TO_SUPPRESS: 6, kILLA_AFTER_GRENADE_SUPPRESS_DELAY: 2,
|
||||
kILLA_CLOSEATTACK_TIMES: 3, kILLA_CLOSEATTACK_DELAY: 10, kILLA_HOLD_DELAY: 5, kILLA_BULLET_TO_RELOAD: 15,
|
||||
sHALL_WARN: true, kILLA_ENEMIES_TO_ATTACK: 3, kILLA_ONE_IS_CLOSE: 30, kILLA_TRIGGER_DOWN_DELAY: 1, kILLA_WAIT_IN_COVER_COEF: 1,
|
||||
kOJANIY_DIST_WHEN_READY: 40, kOJANIY_DIST_TO_BE_ENEMY: 200, kOJANIY_MIN_DIST_TO_LOOT: 20, kOJANIY_MIN_DIST_TO_LOOT_SQRT: 400,
|
||||
kOJANIY_DIST_ENEMY_TOO_CLOSE: 17, kOJANIY_MANY_ENEMIES_COEF: 1.5);
|
||||
}
|
||||
|
||||
public static Mind GenerateMind()
|
||||
{
|
||||
return new Mind(hOW_WORK_OVER_DEAD_BODY: 2, mIN_SHOOTS_TIME: 2, mAX_SHOOTS_TIME: 4,
|
||||
tIME_LEAVE_MAP: 23, tIME_TO_RUN_TO_COVER_CAUSE_SHOOT_SEC: 15, dAMAGE_REDUCTION_TIME_SEC: 20, mIN_DAMAGE_SCARE: 20,
|
||||
cHANCE_TO_RUN_CAUSE_DAMAGE_0_100: 35, tIME_TO_FORGOR_ABOUT_ENEMY_SEC: 52, tIME_TO_FIND_ENEMY: 22, mAX_AGGRO_BOT_DIST: 100,
|
||||
hIT_POINT_DETECTION: 4, dANGER_POINT_CHOOSE_COEF: 1, sIMPLE_POINT_CHOOSE_COEF: 0.4, lASTSEEN_POINT_CHOOSE_COEF: 0.2,
|
||||
cOVER_DIST_COEF: 1.5, dIST_TO_FOUND_SQRT: 400, mAX_AGGRO_BOT_DIST_SQR: 10000, dIST_TO_STOP_RUN_ENEMY: 15,
|
||||
eNEMY_LOOK_AT_ME_ANG: 15, mIN_START_AGGRESION_COEF: 1, mAX_START_AGGRESION_COEF: 3, bULLET_FEEL_DIST: 360,
|
||||
bULLET_FEEL_CLOSE_SDIST: 1, aTTACK_IMMEDIATLY_CHANCE_0_100: 40, cHANCE_FUCK_YOU_ON_CONTACT_100: 10, fRIEND_DEAD_AGR_LOW: -0.2,
|
||||
fRIEND_AGR_KILL: 0.2, lAST_ENEMY_LOOK_TO: 40, cAN_RECIVE_PLAYER_REQUESTS: true, cAN_TAKE_ITEMS: true,
|
||||
cAN_USE_MEDS: true, sUSPETION_POINT_CHANCE_ADD100: 0, aMBUSH_WHEN_UNDER_FIRE: true, aMBUSH_WHEN_UNDER_FIRE_TIME_RESIST: 60,
|
||||
aTTACK_ENEMY_IF_PROTECT_DELTA_LAST_TIME_SEEN: 1.5, hOLD_IF_PROTECT_DELTA_LAST_TIME_SEEN: 8.5, fIND_COVER_TO_GET_POSITION_WITH_SHOOT: 2,
|
||||
pROTECT_TIME_REAL: true, cHANCE_SHOOT_WHEN_WARN_PLAYER_100: 25, cAN_PANIC_IS_PROTECT: false, nO_RUN_AWAY_FOR_SAFE: false,
|
||||
pART_PERCENT_TO_HEAL: 0.65, pROTECT_DELTA_HEAL_SEC: 10, cAN_STAND_BY: true, cAN_THROW_REQUESTS: true,
|
||||
gROUP_ANY_PHRASE_DELAY: 4, gROUP_EXACTLY_PHRASE_DELAY: 4, dIST_TO_ENEMY_YO_CAN_HEAL: 30, cHANCE_TO_STAY_WHEN_WARN_PLAYER_100: 80,
|
||||
dOG_FIGHT_OUT: 6, dOG_FIGHT_IN: 3, sHOOT_INSTEAD_DOG_FIGHT: 9, pISTOL_SHOTGUN_AMBUSH_DIST: 60,
|
||||
sTANDART_AMBUSH_DIST: 200, aI_POWER_COEF: 120, cOVER_SECONDS_AFTER_LOSE_VISION: 10, cOVER_SELF_ALWAYS_IF_DAMAGED: false,
|
||||
sEC_TO_MORE_DIST_TO_RUN: 10, hEAL_DELAY_SEC: 5, hIT_DELAY_WHEN_HAVE_SMT: -1, hIT_DELAY_WHEN_PEACE: -1,
|
||||
tALK_WITH_QUERY: true, wILL_PERSUE_AXEMAN: true);
|
||||
}
|
||||
|
||||
internal static Hearing GenerateHearing()
|
||||
{
|
||||
return new Hearing(bOT_CLOSE_PANIC_DIST: 2, cHANCE_TO_HEAR_SIMPLE_SOUND_0_1: 0.45,
|
||||
dISPERSION_COEF: 1.6, cLOSE_DIST: 10, fAR_DIST: 30, sOUND_DIR_DEEFREE: 30, dIST_PLACE_TO_FIND_POINT: 70,
|
||||
dEAD_BODY_SOUND_RAD: 30, lOOK_ONLY_DANGER: false, rESET_TIMER_DIST: 17, hEAR_DELAY_WHEN_PEACE: 0.85,
|
||||
hEAR_DELAY_WHEN_HAVE_SMT: 0.56, lOOK_ONLY_DANGER_DELTA: 9);
|
||||
}
|
||||
|
||||
public static Patrol GeneratePatrol()
|
||||
{
|
||||
return new Patrol(dEAD_BODY_LOOK_PERIOD: 8, lOOK_TIME_BASE: 12, cAN_CHOOSE_RESERV: true,
|
||||
tRY_CHOOSE_RESERV_WAY_ON_START: false, cAN_LOOK_TO_DEADBODIES: true, cAN_FRIENDLY_TILT: true,
|
||||
cAN_HARD_AIM: true, rESERVE_TIME_STAY: 72, fRIEND_SEARCH_SEC: 12, tALK_DELAY: 1.1,
|
||||
mIN_TALK_DELAY: 35, tALK_DELAY_BIG: 15.1, cHANGE_WAY_TIME: 125.1, mIN_DIST_TO_CLOSE_TALK: 5,
|
||||
vISION_DIST_COEF_PEACE: 0.5, mIN_DIST_TO_CLOSE_TALK_SQR: 25, cHANCE_TO_CUT_WAY_0_100: 75, cUT_WAY_MIN_0_1: 0.4,
|
||||
cUT_WAY_MAX_0_1: 0.65, cHANCE_TO_CHANGE_WAY_0_100: 50, cHANCE_TO_SHOOT_DEADBODY: 52, sUSPETION_PLACE_LIFETIME: 7,
|
||||
rESERVE_OUT_TIME: 30, cLOSE_TO_SELECT_RESERV_WAY: 25, mAX_YDIST_TO_START_WARN_REQUEST_TO_REQUESTER: 5);
|
||||
}
|
||||
|
||||
public static Cover GenerateCover()
|
||||
{
|
||||
return new Cover(rETURN_TO_ATTACK_AFTER_AMBUSH_MIN: 20, rETURN_TO_ATTACK_AFTER_AMBUSH_MAX: 50,
|
||||
sOUND_TO_GET_SPOTTED: 2, tIME_TO_MOVE_TO_COVER: 15, mAX_DIST_OF_COVER: 4, cHANGE_RUN_TO_COVER_SEC: 5,
|
||||
cHANGE_RUN_TO_COVER_SEC_GREANDE: 0.6, mIN_DIST_TO_ENEMY: 9, dIST_CANT_CHANGE_WAY: 5, dIST_CHECK_SFETY: 9,
|
||||
tIME_CHECK_SAFE: 2, hIDE_TO_COVER_TIME: 1.5, mAX_DIST_OF_COVER_SQR: 16, dIST_CANT_CHANGE_WAY_SQR: 25,
|
||||
sPOTTED_COVERS_RADIUS: 3, lOOK_LAST_ENEMY_POS_MOVING: 1.5, lOOK_TO_HIT_POINT_IF_LAST_ENEMY: 3, lOOK_LAST_ENEMY_POS_LOOKAROUND: 45,
|
||||
oFFSET_LOOK_ALONG_WALL_ANG: 20, sPOTTED_GRENADE_RADIUS: 16, mAX_SPOTTED_TIME_SEC: 45, wAIT_INT_COVER_FINDING_ENEMY: 2,
|
||||
cLOSE_DIST_POINT_SQRT: 4, dELTA_SEEN_FROM_COVE_LAST_POS: 15, mOVE_TO_COVER_WHEN_TARGET: false, rUN_COVER_IF_CAN_AND_NO_ENEMIES: false,
|
||||
sPOTTED_GRENADE_TIME: 7, dEPENDS_Y_DIST_TO_BOT: false, rUN_IF_FAR: 10, rUN_IF_FAR_SQRT: 225,
|
||||
sTAY_IF_FAR: 25, sTAY_IF_FAR_SQRT: 625, cHECK_COVER_ENEMY_LOOK: true, sHOOT_NEAR_TO_LEAVE: 2,
|
||||
sHOOT_NEAR_SEC_PERIOD: 0.5, hITS_TO_LEAVE_COVER: 1, hITS_TO_LEAVE_COVER_UNKNOWN: 1, dOG_FIGHT_AFTER_LEAVE: 4,
|
||||
nOT_LOOK_AT_WALL_IS_DANGER: true, mIN_DEFENCE_LEVEL: 22, gOOD_DIST_TO_POINT_COEF: 1.8, eNEMY_DIST_TO_GO_OUT: 1,
|
||||
sTATIONARY_WEAPON_NO_ENEMY_GETUP: 20, sTATIONARY_WEAPON_MAX_DIST_TO_USE: 25);
|
||||
}
|
||||
|
||||
public static Change GenerateChange()
|
||||
{
|
||||
return new Change(sMOKE_VISION_DIST: 0.6, sMOKE_GAIN_SIGHT: 1.6, sMOKE_SCATTERING: 1.6,
|
||||
sMOKE_PRECICING: 1.6, sMOKE_HEARING: 1, sMOKE_ACCURATY: 1.6, sMOKE_LAY_CHANCE: 1.6,
|
||||
fLASH_VISION_DIST: 0.05, fLASH_GAIN_SIGHT: 1.8, fLASH_SCATTERING: 1.6, fLASH_PRECICING: 1.6,
|
||||
fLASH_HEARING: 1, fLASH_ACCURATY: 1.6, fLASH_LAY_CHANCE: 1, sTUN_HEARING: 0.01);
|
||||
}
|
||||
|
||||
public static Grenade GenerateGrenade()
|
||||
{
|
||||
return new Grenade(dELTA_NEXT_ATTEMPT_FROM_COVER: 5, dELTA_NEXT_ATTEMPT: 10, mIN_DIST_NOT_TO_THROW: 8,
|
||||
nEAR_DELTA_THROW_TIME_SEC: 2, mIN_THROW_GRENADE_DIST: 12, mIN_THROW_GRENADE_DIST_SQRT: 144, mIN_DIST_NOT_TO_THROW_SQR: 64,
|
||||
rUN_AWAY: 22, rUN_AWAY_SQR: 484, aDD_GRENADE_AS_DANGER: 65, aDD_GRENADE_AS_DANGER_SQR: 4225,
|
||||
cHANCE_TO_NOTIFY_ENEMY_GR_100: 99, grenadePerMeter: 0.2, rEQUEST_DIST_MUST_THROW_SQRT: 4, rEQUEST_DIST_MUST_THROW: 2,
|
||||
bEWARE_TYPE: 2, sHOOT_TO_SMOKE_CHANCE_100: 30, cHANCE_RUN_FLASHED_100: 0, mAX_FLASHED_DIST_TO_SHOOT: 10,
|
||||
mAX_FLASHED_DIST_TO_SHOOT_SQRT: 100, fLASH_GRENADE_TIME_COEF: 0.3, sIZE_SPOTTED_COEF: 2, bE_ATTENTION_COEF: 4,
|
||||
tIME_SHOOT_TO_FLASH: 4, cLOSE_TO_SMOKE_TO_SHOOT: 5, cLOSE_TO_SMOKE_TO_SHOOT_SQRT: 25, cLOSE_TO_SMOKE_TIME_DELTA: 7,
|
||||
sMOKE_CHECK_DELTA: 1, dELTA_GRENADE_START_TIME: 0.7, aMBUSH_IF_SMOKE_IN_ZONE_100: 40, aMBUSH_IF_SMOKE_RETURN_TO_ATTACK_SEC: 30,
|
||||
nO_RUN_FROM_AI_GRENADES: false, mAX_THROW_POWER: 15.7, grenadePrecision: 0.3, sTOP_WHEN_THROW_GRENADE: true,
|
||||
wAIT_TIME_TURN_AWAY: 0.2, sMOKE_SUPPRESS_DELTA: 20, dAMAGE_GRENADE_SUPPRESS_DELTA: 8, sTUN_SUPPRESS_DELTA: 9,
|
||||
cHEAT_START_GRENADE_PLACE: false, cAN_THROW_STRAIGHT_CONTACT: true, sTRAIGHT_CONTACT_DELTA_SEC: -1, aNG_TYPE: 4);
|
||||
}
|
||||
|
||||
public static Move GenerateMove()
|
||||
{
|
||||
return new Move(bASE_ROTATE_SPEED: 270, rEACH_DIST: 0.5, rEACH_DIST_RUN: 0.8, sTART_SLOW_DIST: 1.5,
|
||||
bASESTART_SLOW_DIST: 1.1, sLOW_COEF: 7, dIST_TO_CAN_CHANGE_WAY: 8, dIST_TO_START_RAYCAST: 15, bASE_START_SERACH: 35,
|
||||
uPDATE_TIME_RECAL_WAY: 7, fAR_DIST: 4, fAR_DIST_SQR: 16, dIST_TO_CAN_CHANGE_WAY_SQR: 64, dIST_TO_START_RAYCAST_SQR: 225,
|
||||
bASE_SQRT_START_SERACH: 1225, y_APPROXIMATION: 0.7, dELTA_LAST_SEEN_ENEMY: 20, rEACH_DIST_COVER: 2, rUN_TO_COVER_MIN: 2,
|
||||
cHANCE_TO_RUN_IF_NO_AMMO_0_100: 100, rUN_IF_CANT_SHOOT: false, rUN_IF_GAOL_FAR_THEN: 10, sEC_TO_CHANGE_TO_RUN: 3);
|
||||
}
|
||||
|
||||
public static Shoot GenerateShoot()
|
||||
{
|
||||
return new Shoot(rECOIL_TIME_NORMALIZE: 2, rECOIL_PER_METER: 0.1, mAX_RECOIL_PER_METER: 0.2,
|
||||
hORIZONT_RECOIL_COEF: 0.4, wAIT_NEXT_SINGLE_SHOT: 0.3, wAIT_NEXT_SINGLE_SHOT_LONG_MAX: 3.3, wAIT_NEXT_SINGLE_SHOT_LONG_MIN: 0.8,
|
||||
mARKSMAN_DIST_SEK_COEF: 44, fINGER_HOLD_SINGLE_SHOT: 0.14, bASE_AUTOMATIC_TIME: 0.1, aUTOMATIC_FIRE_SCATTERING_COEF: 1.5,
|
||||
cHANCE_TO_CHANGE_TO_AUTOMATIC_FIRE_100: 76, fAR_DIST_ENEMY: 20, sHOOT_FROM_COVER: 4, fAR_DIST_ENEMY_SQR: 400,
|
||||
mAX_DIST_COEF: 1.35, rECOIL_DELTA_PRESS: 0.15, rUN_DIST_NO_AMMO: 25, rUN_DIST_NO_AMMO_SQRT: 625,
|
||||
cAN_SHOOTS_TIME_TO_AMBUSH: 333, nOT_TO_SEE_ENEMY_TO_WANT_RELOAD_PERCENT: 0.5, nOT_TO_SEE_ENEMY_TO_WANT_RELOAD_SEC: 2,
|
||||
rELOAD_PECNET_NO_ENEMY: 0.6, cHANCE_TO_CHANGE_WEAPON: 0, cHANCE_TO_CHANGE_WEAPON_WITH_HELMET: 0,
|
||||
lOW_DIST_TO_CHANGE_WEAPON: 10, fAR_DIST_TO_CHANGE_WEAPON: 50, sUPPRESS_BY_SHOOT_TIME: 6, sUPPRESS_TRIGGERS_DOWN: 3,
|
||||
wAIT_NEXT_STATIONARY_GRENADE: 1, fINGER_HOLD_STATIONARY_GRENADE: 0.3);
|
||||
}
|
||||
|
||||
public static Look GenerateLook()
|
||||
{
|
||||
return new Look(oLD_TIME_POINT: 11, wAIT_NEW_SENSOR: 2.1,wAIT_NEW__LOOK_SENSOR: 7.8, lOOK_AROUND_DELTA: 1.1,
|
||||
mAX_VISION_GRASS_METERS: 0.4, mAX_VISION_GRASS_METERS_FLARE: 7,mAX_VISION_GRASS_METERS_OPT: 0.9090909,
|
||||
mAX_VISION_GRASS_METERS_FLARE_OPT: 0.125, lightOnVisionDistance: 30,
|
||||
fAR_DISTANCE: 160, farDeltaTimeSec: 3, mIDDLE_DIST: 90, middleDeltaTimeSec: 1, closeDeltaTimeSec: 0.1,
|
||||
pOSIBLE_VISION_SPACE: 1.2, gOAL_TO_FULL_DISSAPEAR: 0.25, gOAL_TO_FULL_DISSAPEAR_SHOOT: 0.0001, bODY_DELTA_TIME_SEARCH_SEC: 1.7,
|
||||
cOME_TO_BODY_DIST: 1.2, mARKSMAN_VISIBLE_DIST_COEF: 1.15, vISIBLE_DISNACE_WITH_LIGHT: 43, eNEMY_LIGHT_ADD: 45,
|
||||
eNEMY_LIGHT_START_DIST: 40, cAN_LOOK_TO_WALL: false, dIST_NOT_TO_IGNORE_WALL: 15, dIST_CHECK_WALL: 20,
|
||||
lOOK_LAST_POSENEMY_IF_NO_DANGER_SEC: 25, mIN_LOOK_AROUD_TIME: 20, oPTIMIZE_TO_ONLY_BODY: true);
|
||||
}
|
||||
|
||||
public static Aiming GenerateAiming()
|
||||
{
|
||||
return new Aiming(mAX_AIM_PRECICING: 4, bETTER_PRECICING_COEF: 0.7, rECALC_DIST: 0.7, rECALC_SQR_DIST: 0.48999998,
|
||||
cOEF_FROM_COVER: 0.8, pANIC_COEF: 1.2, pANIC_ACCURATY_COEF: 1.2, hARD_AIM: 0.75, pANIC_TIME: 2, rECALC_MUST_TIME: 3,
|
||||
dAMAGE_PANIC_TIME: 15, dANGER_UP_POINT: 1.3, mAX_AIMING_UPGRADE_BY_TIME: 0.85, dAMAGE_TO_DISCARD_AIM_0_100: 100,
|
||||
mIN_TIME_DISCARD_AIM_SEC: 2.9, mAX_TIME_DISCARD_AIM_SEC: 3.2, xZ_COEF: 0.75, sHOOT_TO_CHANGE_PRIORITY: 5525,
|
||||
bOTTOM_COEF: 0.3, fIRST_CONTACT_ADD_SEC: 0.1, fIRST_CONTACT_ADD_CHANCE_100: 80, bASE_HIT_AFFECTION_DELAY_SEC: 1.77,
|
||||
bASE_HIT_AFFECTION_MIN_ANG: 14, bASE_HIT_AFFECTION_MAX_ANG: 28, bASE_SHIEF: 1, sCATTERING_HAVE_DAMAGE_COEF: 2,
|
||||
sCATTERING_DIST_MODIF: 0.7, sCATTERING_DIST_MODIF_CLOSE: 0.85, aIMING_TYPE: 5, dIST_TO_SHOOT_TO_CENTER: 3,
|
||||
dIST_TO_SHOOT_NO_OFFSET: 3, sHPERE_FRIENDY_FIRE_SIZE: -1, cOEF_IF_MOVE: 1.9, tIME_COEF_IF_MOVE: 1.5, bOT_MOVE_IF_DELTA: 0.01,
|
||||
nEXT_SHOT_MISS_CHANCE_100: 100, nEXT_SHOT_MISS_Y_OFFSET: 1, aNYTIME_LIGHT_WHEN_AIM_100: -1, aNY_PART_SHOOT_TIME: 30,
|
||||
wEAPON_ROOT_OFFSET: 0.35, mIN_DAMAGE_TO_GET_HIT_AFFETS: 1, mAX_AIM_TIME: 1.5, oFFSET_RECAL_ANYWAY_TIME: 1, y_TOP_OFFSET_COEF: 0.001,
|
||||
y_BOTTOM_OFFSET_COEF: 0.015, bASE_SHIEF_STATIONARY_GRENADE: 1.1, xZ_COEF_STATIONARY_GRENADE: 0.8, dEAD_BODY_LOOK_PERIOD: 8,
|
||||
cAN_HARD_AIM: true);
|
||||
}
|
||||
}
|
||||
}
|
44
Generator/JsonWriter.cs
Normal file
44
Generator/JsonWriter.cs
Normal file
@ -0,0 +1,44 @@
|
||||
using Generator.Models.Output;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Generator
|
||||
{
|
||||
public class JsonWriter
|
||||
{
|
||||
private readonly string _workingPath;
|
||||
private readonly string _outputFolderName;
|
||||
|
||||
public JsonWriter(string workingPath, string outputFolderName)
|
||||
{
|
||||
_workingPath = workingPath;
|
||||
_outputFolderName = outputFolderName;
|
||||
}
|
||||
|
||||
public void WriteJson(List<Bot> bots)
|
||||
{
|
||||
var outputPath = $"{_workingPath}\\{_outputFolderName}";
|
||||
CreateDirIfDoesntExist(outputPath);
|
||||
|
||||
foreach (var bot in bots)
|
||||
{
|
||||
var output = JsonConvert.SerializeObject(bot, Formatting.Indented);
|
||||
Console.WriteLine($"Writing json file {bot.botType} to {outputPath}");
|
||||
File.WriteAllText($"{outputPath}\\{bot.botType}.json", output);
|
||||
Console.WriteLine($"file {bot.botType} written to {outputPath}");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void CreateDirIfDoesntExist(string path)
|
||||
{
|
||||
if (!Directory.Exists($"{path}"))
|
||||
{
|
||||
//create dump dir
|
||||
Directory.CreateDirectory($"{path}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
13
Generator/Models/Enums.cs
Normal file
13
Generator/Models/Enums.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Generator.Models
|
||||
{
|
||||
public enum BotType
|
||||
{
|
||||
assault = 1,
|
||||
pmcBot = 2,
|
||||
marksman = 3
|
||||
}
|
||||
}
|
282
Generator/Models/Input/Settings.cs
Normal file
282
Generator/Models/Input/Settings.cs
Normal file
@ -0,0 +1,282 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
|
||||
namespace Generator.Models.Input
|
||||
{
|
||||
public class Settings
|
||||
{
|
||||
public string Role { get; set; }
|
||||
public string BotDifficulty { get; set; }
|
||||
public int Experience { get; set; }
|
||||
public double StandingForKill { get; set; }
|
||||
public double AggressorBonus { get; set; }
|
||||
}
|
||||
|
||||
public class Info
|
||||
{
|
||||
public string Nickname { get; set; }
|
||||
public string LowerNickname { get; set; }
|
||||
public string Side { get; set; }
|
||||
public string Voice { get; set; }
|
||||
public int Level { get; set; }
|
||||
public int Experience { get; set; }
|
||||
public int RegistrationDate { get; set; }
|
||||
public string GameVersion { get; set; }
|
||||
public int AccountType { get; set; }
|
||||
public int MemberCategory { get; set; }
|
||||
public bool lockedMoveCommands { get; set; }
|
||||
public int SavageLockTime { get; set; }
|
||||
public int LastTimePlayedAsSavage { get; set; }
|
||||
public Settings Settings { get; set; }
|
||||
public int NicknameChangeDate { get; set; }
|
||||
public List<object> NeedWipeOptions { get; set; }
|
||||
public object lastCompletedWipe { get; set; }
|
||||
public bool BannedState { get; set; }
|
||||
public int BannedUntil { get; set; }
|
||||
public bool IsStreamerModeAvailable { get; set; }
|
||||
}
|
||||
|
||||
public class Customization
|
||||
{
|
||||
public string Head { get; set; }
|
||||
public string Body { get; set; }
|
||||
public string Feet { get; set; }
|
||||
public string Hands { get; set; }
|
||||
}
|
||||
|
||||
public class Hydration
|
||||
{
|
||||
public int Current { get; set; }
|
||||
public int Maximum { get; set; }
|
||||
}
|
||||
|
||||
public class Energy
|
||||
{
|
||||
public int Current { get; set; }
|
||||
public int Maximum { get; set; }
|
||||
}
|
||||
|
||||
public class Temperature
|
||||
{
|
||||
public double Current { get; set; }
|
||||
public int Maximum { get; set; }
|
||||
}
|
||||
|
||||
public class Health
|
||||
{
|
||||
public int Current { get; set; }
|
||||
public int Maximum { get; set; }
|
||||
public Hydration Hydration { get; set; }
|
||||
public Energy Energy { get; set; }
|
||||
public Temperature Temperature { get; set; }
|
||||
public BodyParts BodyParts { get; set; }
|
||||
public int UpdateTime { get; set; }
|
||||
}
|
||||
|
||||
public class Head
|
||||
{
|
||||
public BodyPartHealth Health { get; set; }
|
||||
}
|
||||
|
||||
public class Chest
|
||||
{
|
||||
public BodyPartHealth Health { get; set; }
|
||||
}
|
||||
|
||||
public class Stomach
|
||||
{
|
||||
public BodyPartHealth Health { get; set; }
|
||||
}
|
||||
|
||||
public class LeftArm
|
||||
{
|
||||
public BodyPartHealth Health { get; set; }
|
||||
}
|
||||
|
||||
public class RightArm
|
||||
{
|
||||
public BodyPartHealth Health { get; set; }
|
||||
}
|
||||
|
||||
public class LeftLeg
|
||||
{
|
||||
public BodyPartHealth Health { get; set; }
|
||||
}
|
||||
|
||||
public class RightLeg
|
||||
{
|
||||
public BodyPartHealth Health { get; set; }
|
||||
}
|
||||
|
||||
[DataContract(Name = "Health")]
|
||||
public class BodyPartHealth
|
||||
{
|
||||
[DataMember]
|
||||
public int Current { get; set; }
|
||||
[DataMember]
|
||||
public int Maximum { get; set; }
|
||||
}
|
||||
|
||||
public class BodyParts
|
||||
{
|
||||
public Head Head { get; set; }
|
||||
public Chest Chest { get; set; }
|
||||
public Stomach Stomach { get; set; }
|
||||
public LeftArm LeftArm { get; set; }
|
||||
public RightArm RightArm { get; set; }
|
||||
public LeftLeg LeftLeg { get; set; }
|
||||
public RightLeg RightLeg { get; set; }
|
||||
}
|
||||
|
||||
public class Repairable
|
||||
{
|
||||
public int Durability { get; set; }
|
||||
public int MaxDurability { get; set; }
|
||||
}
|
||||
|
||||
public class FoodDrink
|
||||
{
|
||||
public int HpPercent { get; set; }
|
||||
}
|
||||
|
||||
public class FireMode
|
||||
{
|
||||
[JsonProperty("FireMode")]
|
||||
public string WeaponFireMode { get; set; }
|
||||
}
|
||||
|
||||
public class Foldable
|
||||
{
|
||||
public bool Folded { get; set; }
|
||||
}
|
||||
|
||||
public class MedKit
|
||||
{
|
||||
public int HpResource { get; set; }
|
||||
}
|
||||
|
||||
public class Upd
|
||||
{
|
||||
public Repairable Repairable { get; set; }
|
||||
public int? StackObjectsCount { get; set; }
|
||||
public FoodDrink FoodDrink { get; set; }
|
||||
public FireMode FireMode { get; set; }
|
||||
public Foldable Foldable { get; set; }
|
||||
public MedKit MedKit { get; set; }
|
||||
}
|
||||
|
||||
public class Location
|
||||
{
|
||||
public int x { get; set; }
|
||||
public int y { get; set; }
|
||||
public int r { get; set; }
|
||||
}
|
||||
|
||||
public class Item
|
||||
{
|
||||
public string _id { get; set; }
|
||||
public string _tpl { get; set; }
|
||||
public string parentId { get; set; }
|
||||
public string slotId { get; set; }
|
||||
public Upd upd { get; set; }
|
||||
public Location location { get; set; }
|
||||
}
|
||||
|
||||
public class FastPanel
|
||||
{
|
||||
}
|
||||
|
||||
public class Inventory
|
||||
{
|
||||
public List<Item> items { get; set; }
|
||||
public string equipment { get; set; }
|
||||
public string stash { get; set; }
|
||||
public string sortingTable { get; set; }
|
||||
public string questRaidItems { get; set; }
|
||||
public string questStashItems { get; set; }
|
||||
public FastPanel fastPanel { get; set; }
|
||||
}
|
||||
|
||||
public class Skills
|
||||
{
|
||||
public List<object> Common { get; set; }
|
||||
public List<object> Mastering { get; set; }
|
||||
public int Points { get; set; }
|
||||
}
|
||||
|
||||
public class SessionCounters
|
||||
{
|
||||
public List<object> Items { get; set; }
|
||||
}
|
||||
|
||||
public class OverallCounters
|
||||
{
|
||||
public List<object> Items { get; set; }
|
||||
}
|
||||
|
||||
public class Stats
|
||||
{
|
||||
public SessionCounters SessionCounters { get; set; }
|
||||
public OverallCounters OverallCounters { get; set; }
|
||||
}
|
||||
|
||||
public class ConditionCounters
|
||||
{
|
||||
public List<object> Counters { get; set; }
|
||||
}
|
||||
|
||||
public class BackendCounters
|
||||
{
|
||||
}
|
||||
|
||||
public class Production
|
||||
{
|
||||
}
|
||||
|
||||
public class Area
|
||||
{
|
||||
public int type { get; set; }
|
||||
public int level { get; set; }
|
||||
public bool active { get; set; }
|
||||
public bool passiveBonusesEnabled { get; set; }
|
||||
public int completeTime { get; set; }
|
||||
public bool constructing { get; set; }
|
||||
public List<object> slots { get; set; }
|
||||
public object lastRecipe { get; set; }
|
||||
}
|
||||
|
||||
public class Hideout
|
||||
{
|
||||
public Production Production { get; set; }
|
||||
public List<Area> Areas { get; set; }
|
||||
}
|
||||
|
||||
public class Datum
|
||||
{
|
||||
public string _id { get; set; }
|
||||
public int aid { get; set; }
|
||||
public object savage { get; set; }
|
||||
public Info Info { get; set; }
|
||||
public Customization Customization { get; set; }
|
||||
public Health Health { get; set; }
|
||||
public Inventory Inventory { get; set; }
|
||||
public Skills Skills { get; set; }
|
||||
public Stats Stats { get; set; }
|
||||
public object Encyclopedia { get; set; }
|
||||
public ConditionCounters ConditionCounters { get; set; }
|
||||
public BackendCounters BackendCounters { get; set; }
|
||||
public List<object> InsuredItems { get; set; }
|
||||
public Hideout Hideout { get; set; }
|
||||
public List<object> Bonuses { get; set; }
|
||||
}
|
||||
|
||||
public class Root
|
||||
{
|
||||
public int err { get; set; }
|
||||
public object errmsg { get; set; }
|
||||
public List<Datum> data { get; set; }
|
||||
}
|
||||
|
||||
|
||||
}
|
1082
Generator/Models/Output/Difficulty/Difficulty.cs
Normal file
1082
Generator/Models/Output/Difficulty/Difficulty.cs
Normal file
File diff suppressed because it is too large
Load Diff
70
Generator/Models/Output/Equipment.cs
Normal file
70
Generator/Models/Output/Equipment.cs
Normal file
@ -0,0 +1,70 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Generator.Models.Output
|
||||
{
|
||||
public class Equipment
|
||||
{
|
||||
public Equipment()
|
||||
{
|
||||
Headwear = new List<string>();
|
||||
Earpiece = new List<string>();
|
||||
FaceCover = new List<string>();
|
||||
ArmorVest = new List<string>();
|
||||
Eyewear = new List<string>();
|
||||
ArmBand = new List<string>();
|
||||
TacticalVest = new List<string>();
|
||||
Backpack = new List<string>();
|
||||
FirstPrimaryWeapon = new List<string>();
|
||||
SecondPrimaryWeapon = new List<string>();
|
||||
Holster = new List<string>();
|
||||
Scabbard = new List<string>();
|
||||
Pockets = new List<string>();
|
||||
SecuredContainer = new List<string>();
|
||||
}
|
||||
|
||||
public List<string> Headwear { get; set; }
|
||||
public List<string> Earpiece { get; set; }
|
||||
public List<string> FaceCover { get; set; }
|
||||
public List<string> ArmorVest { get; set; }
|
||||
public List<string> Eyewear { get; set; }
|
||||
public List<string> ArmBand { get; set; }
|
||||
public List<string> TacticalVest { get; set; }
|
||||
public List<string> Backpack { get; set; }
|
||||
public List<string> FirstPrimaryWeapon { get; set; }
|
||||
public List<string> SecondPrimaryWeapon { get; set; }
|
||||
public List<string> Holster { get; set; }
|
||||
public List<string> Scabbard { get; set; }
|
||||
public List<string> Pockets { get; set; }
|
||||
public List<string> SecuredContainer { get; set; }
|
||||
}
|
||||
|
||||
public class Inventory
|
||||
{
|
||||
public Inventory()
|
||||
{
|
||||
equipment = new Equipment();
|
||||
items = new Items();
|
||||
mods = new Dictionary<string, Dictionary<string, List<string>>>();
|
||||
}
|
||||
|
||||
public Equipment equipment { get; set; }
|
||||
public Dictionary<string, Dictionary<string, List<string>>> mods { get; set; }
|
||||
public Items items { get; set; }
|
||||
}
|
||||
|
||||
public class Items
|
||||
{
|
||||
public Items()
|
||||
{
|
||||
TacticalVest = new List<string>();
|
||||
Pockets = new List<string>();
|
||||
Backpack = new List<string>();
|
||||
SecuredContainer = new List<string>();
|
||||
}
|
||||
|
||||
public List<string> TacticalVest { get; set; }
|
||||
public List<string> Pockets { get; set; }
|
||||
public List<string> Backpack { get; set; }
|
||||
public List<string> SecuredContainer { get; set; }
|
||||
}
|
||||
}
|
309
Generator/Models/Output/Output.cs
Normal file
309
Generator/Models/Output/Output.cs
Normal file
@ -0,0 +1,309 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Generator.Models.Output
|
||||
{
|
||||
public class Bot
|
||||
{
|
||||
public Bot(BotType botType)
|
||||
{
|
||||
this.botType = botType;
|
||||
appearance = new Appearance();
|
||||
experience = new Experience();
|
||||
health = new Health();
|
||||
skills = new Skills();
|
||||
firstName = new List<string>();
|
||||
lastName = new List<string>();
|
||||
difficulty = new Difficulty.Difficulty();
|
||||
chances = new Chances();
|
||||
generation = new GenerationChances();
|
||||
inventory = new Inventory();
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public BotType botType { get;set;}
|
||||
public Appearance appearance { get; set; }
|
||||
public Experience experience { get; set; }
|
||||
public Health health { get; set; }
|
||||
public Skills skills { get; set; }
|
||||
public List<string> firstName { get; set; }
|
||||
public List<string> lastName { get; set; }
|
||||
public Difficulty.Difficulty difficulty { get; set;}
|
||||
public Chances chances { get; set; }
|
||||
public GenerationChances generation { get; set; }
|
||||
public Inventory inventory { get; set; }
|
||||
}
|
||||
public class Appearance
|
||||
{
|
||||
public Appearance()
|
||||
{
|
||||
body = new List<string>();
|
||||
feet = new List<string>();
|
||||
hands = new List<string>();
|
||||
head = new List<string>();
|
||||
voice = new List<string>();
|
||||
}
|
||||
|
||||
public List<string> body { get; set; }
|
||||
public List<string> feet { get; set; }
|
||||
public List<string> hands { get; set; }
|
||||
public List<string> head { get; set; }
|
||||
public List<string> voice { get; set; }
|
||||
}
|
||||
|
||||
public class Experience
|
||||
{
|
||||
public Experience()
|
||||
{
|
||||
level = new MinMax(0, 1);
|
||||
reward = new MinMax(-1, -1);
|
||||
standingForKill = -0.02;
|
||||
aggressorBonus = 0.01;
|
||||
}
|
||||
|
||||
public MinMax level { get; set; }
|
||||
public MinMax reward { get; set; }
|
||||
public double standingForKill { get; set; }
|
||||
public double aggressorBonus { get; set; }
|
||||
}
|
||||
|
||||
public class BodyParts
|
||||
{
|
||||
public BodyParts()
|
||||
{
|
||||
Head = new MinMax(35, 35);
|
||||
Chest = new MinMax(85, 85);
|
||||
Stomach = new MinMax(70, 70);
|
||||
LeftArm = new MinMax(60, 60);
|
||||
RightArm = new MinMax(60, 60);
|
||||
LeftLeg = new MinMax(65, 65);
|
||||
RightLeg = new MinMax(65, 65);
|
||||
}
|
||||
|
||||
public MinMax Head { get; set; }
|
||||
public MinMax Chest { get; set; }
|
||||
public MinMax Stomach { get; set; }
|
||||
public MinMax LeftArm { get; set; }
|
||||
public MinMax RightArm { get; set; }
|
||||
public MinMax LeftLeg { get; set; }
|
||||
public MinMax RightLeg { get; set; }
|
||||
}
|
||||
|
||||
public class Health
|
||||
{
|
||||
public Health()
|
||||
{
|
||||
Hydration = new MinMax(100, 100);
|
||||
Energy = new MinMax(100, 100);
|
||||
Temperature = new MinMax(36, 40);
|
||||
BodyParts = new BodyParts();
|
||||
}
|
||||
|
||||
public MinMax Hydration { get; set; }
|
||||
public MinMax Energy { get; set; }
|
||||
public MinMax Temperature { get; set; }
|
||||
public BodyParts BodyParts { get; set; }
|
||||
}
|
||||
|
||||
public class Skills
|
||||
{
|
||||
public Skills()
|
||||
{
|
||||
Common = new Common();
|
||||
}
|
||||
|
||||
public Common Common { get; set; }
|
||||
}
|
||||
public class Common
|
||||
{
|
||||
}
|
||||
|
||||
public class Chances
|
||||
{
|
||||
public Chances()
|
||||
{
|
||||
equipment = new EquipmentChances();
|
||||
}
|
||||
|
||||
public EquipmentChances equipment { get; set; }
|
||||
public Mods mods { get; set; }
|
||||
}
|
||||
|
||||
public class EquipmentChances
|
||||
{
|
||||
public EquipmentChances()
|
||||
{
|
||||
}
|
||||
|
||||
public EquipmentChances(int head, int ear, int faceCover,
|
||||
int vest, int eyewear, int armband, int tacVest,
|
||||
int backpack, int firstPrimary, int secondPrimary,
|
||||
int holster, int scabbard, int pockets, int securedContainer)
|
||||
{
|
||||
Headwear = head;
|
||||
Earpiece = ear;
|
||||
FaceCover = faceCover;
|
||||
ArmorVest = vest;
|
||||
ArmBand = armband;
|
||||
Eyewear = eyewear;
|
||||
TacticalVest = tacVest;
|
||||
Backpack = backpack;
|
||||
FirstPrimaryWeapon = firstPrimary;
|
||||
SecondPrimaryWeapon = secondPrimary;
|
||||
Holster = holster;
|
||||
Scabbard = scabbard;
|
||||
Pockets = pockets;
|
||||
SecuredContainer = securedContainer;
|
||||
}
|
||||
|
||||
public int Headwear { get; set; }
|
||||
public int Earpiece { get; set; }
|
||||
public int FaceCover { get; set; }
|
||||
public int ArmorVest { get; set; }
|
||||
public int Eyewear { get; set; }
|
||||
public int ArmBand { get; set; }
|
||||
public int TacticalVest { get; set; }
|
||||
public int Backpack { get; set; }
|
||||
public int FirstPrimaryWeapon { get; set; }
|
||||
public int SecondPrimaryWeapon { get; set; }
|
||||
public int Holster { get; set; }
|
||||
public int Scabbard { get; set; }
|
||||
public int Pockets { get; set; }
|
||||
public int SecuredContainer { get; set; }
|
||||
}
|
||||
|
||||
public class Mods
|
||||
{
|
||||
public Mods(int muzzle, int barrel, int handguard, int stock,
|
||||
int magazine, int mount, int flashlight, int tactical_001,
|
||||
int tactical_002, int tactical_003, int mount_000, int pistol_grip,
|
||||
int tactical, int scope, int reciever, int sight_rear,
|
||||
int charge, int mount_001, int equipment, int gas_block,
|
||||
int launcher, int sight_front, int stock_000, int foregrip,
|
||||
int tactical_000, int nvg, int pistol_grip_akms, int stock_akms,
|
||||
int equipment_000, int equipment_001, int equipment_002, int bipod)
|
||||
{
|
||||
mod_muzzle = muzzle;
|
||||
mod_barrel = barrel;
|
||||
mod_handguard = handguard;
|
||||
mod_stock = stock;
|
||||
mod_magazine = magazine;
|
||||
mod_mount = mount;
|
||||
mod_flashlight = flashlight;
|
||||
mod_tactical_001 = tactical_001;
|
||||
mod_tactical_002 = tactical_002;
|
||||
mod_tactical_003 = tactical_003;
|
||||
mod_mount_000 = mount_000;
|
||||
mod_pistol_grip = pistol_grip;
|
||||
mod_tactical = tactical;
|
||||
mod_scope = scope;
|
||||
mod_reciever = reciever;
|
||||
mod_sight_rear = sight_rear;
|
||||
mod_charge = charge;
|
||||
mod_mount_001 = mount_001;
|
||||
mod_equipment = equipment;
|
||||
mod_gas_block = gas_block;
|
||||
mod_launcher = launcher;
|
||||
mod_sight_front = sight_front;
|
||||
mod_stock_000 = stock_000;
|
||||
mod_foregrip = foregrip;
|
||||
mod_tactical_000 = tactical_000;
|
||||
mod_nvg = nvg;
|
||||
mod_pistol_grip_akms = pistol_grip_akms;
|
||||
mod_stock_akms = stock_akms;
|
||||
mod_equipment_000 = equipment_000;
|
||||
mod_equipment_001 = equipment_001;
|
||||
mod_equipment_002 = equipment_002;
|
||||
mod_bipod = bipod;
|
||||
}
|
||||
|
||||
public int mod_muzzle { get; set; }
|
||||
public int mod_barrel { get; set; }
|
||||
public int mod_handguard { get; set; }
|
||||
public int mod_stock { get; set; }
|
||||
public int mod_magazine { get; set; }
|
||||
public int mod_mount { get; set; }
|
||||
public int mod_flashlight { get; set; }
|
||||
public int mod_tactical_001 { get; set; }
|
||||
public int mod_tactical_002 { get; set; }
|
||||
public int mod_tactical_003 { get; set; }
|
||||
public int mod_mount_000 { get; set; }
|
||||
public int mod_pistol_grip { get; set; }
|
||||
public int mod_tactical { get; set; }
|
||||
public int mod_scope { get; set; }
|
||||
public int mod_reciever { get; set; }
|
||||
public int mod_sight_rear { get; set; }
|
||||
public int mod_charge { get; set; }
|
||||
public int mod_mount_001 { get; set; }
|
||||
public int mod_equipment { get; set; }
|
||||
public int mod_gas_block { get; set; }
|
||||
public int mod_launcher { get; set; }
|
||||
public int mod_sight_front { get; set; }
|
||||
public int mod_stock_000 { get; set; }
|
||||
public int mod_foregrip { get; set; }
|
||||
public int mod_tactical_000 { get; set; }
|
||||
public int mod_nvg { get; set; }
|
||||
public int mod_pistol_grip_akms { get; set; }
|
||||
public int mod_stock_akms { get; set; }
|
||||
public int mod_equipment_000 { get; set; }
|
||||
public int mod_equipment_001 { get; set; }
|
||||
public int mod_equipment_002 { get; set; }
|
||||
public int mod_bipod { get; set; }
|
||||
}
|
||||
|
||||
public class GenerationChances
|
||||
{
|
||||
public GenerationChances(int specialMin, int SpecialMax,
|
||||
int healingMin, int healingMax,
|
||||
int looseLootMin, int looseLootMax,
|
||||
int magazinesMin, int MagazineMax,
|
||||
int grenandesMin, int grenadesMax)
|
||||
{
|
||||
items = new ItemChances
|
||||
{
|
||||
specialItems = new MinMax(specialMin, SpecialMax),
|
||||
healing = new MinMax(healingMin, healingMax),
|
||||
looseLoot = new MinMax(looseLootMin, looseLootMax),
|
||||
magazines = new MinMax(magazinesMin, MagazineMax),
|
||||
grenades = new MinMax(grenandesMin, grenadesMax)
|
||||
};
|
||||
}
|
||||
|
||||
public GenerationChances()
|
||||
{
|
||||
items = new ItemChances();
|
||||
}
|
||||
|
||||
public ItemChances items { get; set; }
|
||||
}
|
||||
|
||||
public class ItemChances
|
||||
{
|
||||
public ItemChances()
|
||||
{
|
||||
specialItems = new MinMax(0, 1);
|
||||
healing = new MinMax(1, 2);
|
||||
looseLoot = new MinMax(0, 3);
|
||||
magazines = new MinMax(2, 4);
|
||||
grenades = new MinMax(0, 5);
|
||||
}
|
||||
|
||||
public MinMax specialItems { get; set; }
|
||||
public MinMax healing { get; set; }
|
||||
public MinMax looseLoot { get; set; }
|
||||
public MinMax magazines { get; set; }
|
||||
public MinMax grenades { get; set; }
|
||||
}
|
||||
|
||||
public class MinMax
|
||||
{
|
||||
public MinMax(int min, int max)
|
||||
{
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public int min { get; set; }
|
||||
public int max { get; set; }
|
||||
}
|
||||
}
|
34
Generator/Program.cs
Normal file
34
Generator/Program.cs
Normal file
@ -0,0 +1,34 @@
|
||||
using System.IO;
|
||||
|
||||
namespace Generator
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
string[] botTypes = {"assault", "marksman", "pmcbot", "bossbully", "bosskilla" };
|
||||
|
||||
// Read raw bot dumps from live and turn into c# objects
|
||||
var workingPath = Directory.GetCurrentDirectory();
|
||||
var dumpPath = $"{workingPath}//dumps";
|
||||
var botParser = new BotParser(workingPath, dumpPath, botTypes);
|
||||
var parsedBots = botParser.Parse();
|
||||
|
||||
// Generate the base bot class and add basic details (health/body part hp etc)
|
||||
var baseBotGenerator = new BaseBotGenerator(parsedBots);
|
||||
var baseBots = baseBotGenerator.AddBaseDetails();
|
||||
|
||||
// Add weapons/armor to bot
|
||||
var botGearGenerator = new BotGearGenerator(baseBots, parsedBots);
|
||||
var botsWithGear = botGearGenerator.AddGear();
|
||||
|
||||
// Add loot to bot
|
||||
var botLootGenerator = new BotLootGenerator(botsWithGear, parsedBots);
|
||||
var botsWithGearAndLoot = botLootGenerator.AddLoot();
|
||||
|
||||
// Output bot to json file
|
||||
var jsonWriter = new JsonWriter(workingPath, "output");
|
||||
jsonWriter.WriteJson(botsWithGearAndLoot);
|
||||
}
|
||||
}
|
||||
}
|
14
Generator/StringToolsExtensions.cs
Normal file
14
Generator/StringToolsExtensions.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Generator
|
||||
{
|
||||
public static class StringToolsExtensions
|
||||
{
|
||||
public static void AddUnique(this IList<string> self, string item)
|
||||
{
|
||||
if (!self.Contains(item))
|
||||
self.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user