aim: fix: ensure pathfinder succeeded when predicting

bot: support for x64 xash fwgs builds
This commit is contained in:
jeefo 2023-05-25 05:20:30 +03:00
commit b816cd39aa
No known key found for this signature in database
GPG key ID: 927BCA0779BEA8ED
7 changed files with 238 additions and 6 deletions

1
.gitignore vendored
View file

@ -3,6 +3,7 @@
*.user
*.json
vc/x64
vc/release
vc/debug
vc/.vs

@ -1 +1 @@
Subproject commit c1031171d42c1d9489928ef1b4ce6e52ef5a1bb7
Subproject commit 2fec50bc189ad16e83855b74840fcd27394a18b7

View file

@ -1576,7 +1576,7 @@ void Bot::syncUpdatePredictedIndex () {
}
int pathLength = 0;
planner.find (destIndex, currentNodeIndex, [&] (int index) {
auto result = planner.find (destIndex, currentNodeIndex, [&] (int index) {
++pathLength;
if (vistab.visible (currentNodeIndex, index) && botOrigin.distanceSq (graph[index].origin) > cr::sqrf (256.0f)) {
@ -1586,7 +1586,7 @@ void Bot::syncUpdatePredictedIndex () {
return true;
});
if (bestIndex != kInvalidNodeIndex) {
if (result && bestIndex != kInvalidNodeIndex) {
m_lastPredictIndex = bestIndex;
m_lastPredictLength = pathLength;

View file

@ -765,6 +765,11 @@ bool Game::loadCSBinary () {
}
StringArray libs { "mp", "cs", "cs_i386" };
// lookup for x64 binaries first
if (plat.x64) {
libs.insert (0, { "mp_amd64", "cs_amd64" });
}
auto libCheck = [&] (StringRef mod, StringRef dll) {
// try to load gamedll
if (!m_gameLib) {

View file

@ -1473,7 +1473,7 @@ int Bot::findAimingNode (const Vector &to, int &pathLength) {
return kInvalidNodeIndex;
}
planner.find (destIndex, m_currentNodeIndex, [&] (int index) {
auto result = planner.find (destIndex, m_currentNodeIndex, [&] (int index) {
++pathLength;
if (vistab.visible (m_currentNodeIndex, index)) {
@ -1483,7 +1483,7 @@ int Bot::findAimingNode (const Vector &to, int &pathLength) {
return true;
});
if (bestIndex == m_currentNodeIndex) {
if (result && bestIndex == m_currentNodeIndex) {
return kInvalidNodeIndex;
}
return bestIndex;

View file

@ -8,13 +8,19 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C232645A-3B99-48F4-A1F3-F20CF0A9568B}.Debug|Win32.ActiveCfg = Debug|Win32
{C232645A-3B99-48F4-A1F3-F20CF0A9568B}.Debug|Win32.Build.0 = Debug|Win32
{C232645A-3B99-48F4-A1F3-F20CF0A9568B}.Debug|x64.ActiveCfg = Debug|x64
{C232645A-3B99-48F4-A1F3-F20CF0A9568B}.Debug|x64.Build.0 = Debug|x64
{C232645A-3B99-48F4-A1F3-F20CF0A9568B}.Release|Win32.ActiveCfg = Release|Win32
{C232645A-3B99-48F4-A1F3-F20CF0A9568B}.Release|Win32.Build.0 = Release|Win32
{C232645A-3B99-48F4-A1F3-F20CF0A9568B}.Release|x64.ActiveCfg = Release|x64
{C232645A-3B99-48F4-A1F3-F20CF0A9568B}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -5,10 +5,18 @@
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\ext\crlib\crlib\array.h" />
@ -64,7 +72,9 @@
<ClCompile Include="..\src\analyze.cpp" />
<ClCompile Include="..\src\entities.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\src\botlib.cpp" />
<ClCompile Include="..\src\chatlib.cpp" />
@ -90,7 +100,9 @@
<ItemGroup>
<ResourceCompile Include="yapb.rc">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ResourceCompile>
</ItemGroup>
<ItemGroup>
@ -110,6 +122,13 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<EnableASAN>false</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
<WholeProgramOptimization>true</WholeProgramOptimization>
<EnableASAN>false</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
@ -117,15 +136,28 @@
<UseDebugLibraries>false</UseDebugLibraries>
<EnableASAN>false</EnableASAN>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>ClangCL</PlatformToolset>
<UseDebugLibraries>false</UseDebugLibraries>
<EnableASAN>false</EnableASAN>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>12.0.21005.1</_ProjectFileVersion>
@ -140,6 +172,16 @@
<RunCodeAnalysis>false</RunCodeAnalysis>
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>.\x64\debug\</OutDir>
<IntDir>.\x64\debug\inf\</IntDir>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
<LinkIncremental>true</LinkIncremental>
<EmbedManifest>false</EmbedManifest>
<CodeAnalysisRuleSet>NativeRecommendedRules.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>false</RunCodeAnalysis>
<EnableMicrosoftCodeAnalysis>false</EnableMicrosoftCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>.\release\</OutDir>
<IntDir>.\release\inf\</IntDir>
@ -148,6 +190,14 @@
<GenerateManifest>false</GenerateManifest>
<EmbedManifest>false</EmbedManifest>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>.\x64\release\</OutDir>
<IntDir>.\x64\release\inf\</IntDir>
<IgnoreImportLibrary>false</IgnoreImportLibrary>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<EmbedManifest>false</EmbedManifest>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
<Command>
@ -218,6 +268,82 @@
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\x64\debug\yapb.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\vc;..\inc;..\ext;..\ext\crlib;..\ext\linkage;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;CR_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<PrecompiledHeaderFile>yapb.h</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>.\x64\debug\inf\yapb.pch</PrecompiledHeaderOutputFile>
<ExpandAttributedSource>false</ExpandAttributedSource>
<AssemblerOutput>NoListing</AssemblerOutput>
<AssemblerListingLocation>.\x64\debug\asm\</AssemblerListingLocation>
<ObjectFileName>.\x64\debug\obj\</ObjectFileName>
<ProgramDataBaseFileName>.\x64\debug\inf</ProgramDataBaseFileName>
<BrowseInformation>
</BrowseInformation>
<BrowseInformationFile>
</BrowseInformationFile>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<CompileAs>Default</CompileAs>
<BufferSecurityCheck>false</BufferSecurityCheck>
<StringPooling>false</StringPooling>
<InlineFunctionExpansion>Default</InlineFunctionExpansion>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableLanguageExtensions>false</DisableLanguageExtensions>
<LanguageStandard>stdcpp17</LanguageStandard>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
</ResourceCompile>
<PreLinkEvent>
<Command>
</Command>
</PreLinkEvent>
<Link>
<OutputFile>.\x64\debug\yapb.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<GenerateDebugInformation>DebugFull</GenerateDebugInformation>
<ProgramDatabaseFile>.\x64\debug\inf\yapb.pdb</ProgramDatabaseFile>
<GenerateMapFile>true</GenerateMapFile>
<MapFileName>.\x64\debug\inf\yapb.map</MapFileName>
<MapExports>true</MapExports>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>false</OptimizeReferences>
<EnableCOMDATFolding>false</EnableCOMDATFolding>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ImportLibrary>.\x64\debug\inf\yapb.lib</ImportLibrary>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
</Link>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Command>
@ -231,7 +357,7 @@
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TargetEnvironment>Win32</TargetEnvironment>
<TypeLibraryName>.\Release/yapb.tlb</TypeLibraryName>
<TypeLibraryName>.\release\yapb.tlb</TypeLibraryName>
<HeaderFileName />
</Midl>
<ClCompile>
@ -308,6 +434,100 @@
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
<Midl>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MkTypLibCompatible>true</MkTypLibCompatible>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TypeLibraryName>.\release\yapb.tlb</TypeLibraryName>
<HeaderFileName>
</HeaderFileName>
</Midl>
<ClCompile>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<EnableFiberSafeOptimizations>false</EnableFiberSafeOptimizations>
<AdditionalIncludeDirectories>..\vc;..\inc;..\ext;..\ext\crlib;..\ext\linkage;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>false</ExceptionHandling>
<EnableEnhancedInstructionSet>AdvancedVectorExtensions</EnableEnhancedInstructionSet>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<PrecompiledHeaderOutputFile>.\x64\release\inf\yapb.pch</PrecompiledHeaderOutputFile>
<AssemblerListingLocation>.\x64\release\asm\</AssemblerListingLocation>
<ProgramDataBaseFileName>.\x64\release\inf\</ProgramDataBaseFileName>
<WarningLevel>Level4</WarningLevel>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsCpp</CompileAs>
<InterproceduralOptimization>MultiFile</InterproceduralOptimization>
<FlushDenormalResultsToZero>true</FlushDenormalResultsToZero>
<Parallelization>false</Parallelization>
<FloatingPointModel>Precise</FloatingPointModel>
<Optimization>Full</Optimization>
<GenerateAlternateCodePaths>AVXI</GenerateAlternateCodePaths>
<UseProcessorExtensions>AVXI</UseProcessorExtensions>
<MinimalRebuild>false</MinimalRebuild>
<PrecompiledHeaderOutputFileDirectory>
</PrecompiledHeaderOutputFileDirectory>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<OmitFramePointers>true</OmitFramePointers>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<WholeProgramOptimization>true</WholeProgramOptimization>
<StringPooling>true</StringPooling>
<BufferSecurityCheck>false</BufferSecurityCheck>
<FunctionLevelLinking>true</FunctionLevelLinking>
<LanguageStandard>stdcpp17</LanguageStandard>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<Culture>0x0409</Culture>
<ResourceOutputFileName>$(IntDir)%(Filename).res</ResourceOutputFileName>
</ResourceCompile>
<PreLinkEvent>
<Command>
</Command>
</PreLinkEvent>
<ProjectReference>
<LinkLibraryDependencies>true</LinkLibraryDependencies>
</ProjectReference>
<Link>
<OutputFile>.\x64\release\yapb.dll</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<DelayLoadDLLs>user32.dll;ws2_32.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>false</GenerateMapFile>
<SubSystem>Windows</SubSystem>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<SetChecksum>false</SetChecksum>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ImportLibrary>.\x64\release\inf\yapb.lib</ImportLibrary>
<MinimumRequiredVersion>
</MinimumRequiredVersion>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
<ImageHasSafeExceptionHandlers>
</ImageHasSafeExceptionHandlers>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<FullProgramDatabaseFile>true</FullProgramDatabaseFile>
<ShowProgress>NotSet</ShowProgress>
</Link>
<PostBuildEvent>
<Command>
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>