feat(arena): BotArena for linux-x64 and win-x64 on the library

The shims go; ArenaHost implements BotHost (stderr log, Microsoft.Data.Sqlite read-only, locale, the
expansions' .cdb, bot.conf). EngineLibrary finds ygol-engine.dll / libygol-engine.so (env, the root's plugin
folder, a built player, next to the exe) for both hosts. Same options and report. --host server is refused off
Windows: on Linux the engine's server reads ./expansions and ./script, finds no cards, and every duel ends at
turn 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
donnyandClaude Opus 5.5 committed 2026-10-19 18:19:14 -07:00
1 parent 0818987cea
commit 3bbfe08ab1
12 files changed
+187 -304

No files matched your search

+16 -79
View File
@@ -1,101 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<!--
Standalone, parallel Bot Arena (TICKET-035). Compiles the in-tree WindBot
and the fork's brain by LINKING the sources (no copies), so the tool always
plays with exactly the code the game ships. See README.md.
-->
<!-- Headless, parallel Bot Arena: N bot-vs-bot duels of the YGOLegacy.Bots library on the engine release
engine.json pins, from a game root (Deck/, Data/, Expansions/). linux-x64 and win-x64. See README.md. -->
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<RuntimeIdentifiers>linux-x64;win-x64</RuntimeIdentifiers>
<AssemblyName>BotArena</AssemblyName>
<RootNamespace>YGOLegacy.Tools.BotArena</RootNamespace>
<StartupObject>YGOLegacy.Tools.BotArena.Program</StartupObject>
<!-- Linked Unity sources are not nullable-annotated and rely on explicit usings. -->
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<LangVersion>latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<InvariantGlobalization>true</InvariantGlobalization>
<!-- Compiles out the UniTask surface of CharacterRegistry (see that file). -->
<DefineConstants>$(DefineConstants);YGOL_STANDALONE</DefineConstants>
<!-- Upstream code is noisy; keep the build output readable. -->
<NoWarn>$(NoWarn);CS0108;CS0114;CS0162;CS0164;CS0168;CS0169;CS0219;CS0414;CS0618;CS0649;CS0659;CS0661;CS1522;CS1570;CS1572;CS1573;CS1587;CS1591;CS8981;SYSLIB0011;CA1416</NoWarn>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
<InformationalVersion>$(BotsVersion)</InformationalVersion>
<NoWarn>$(NoWarn);CS0618;CA1416</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../YGOLegacy.Bots/YGOLegacy.Bots.csproj" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<!-- Mono.Data.Sqlite shim (Shims/MonoDataSqlite.cs) sits on top of this. -->
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.8" />
</ItemGroup>
<!-- The engine release's C# binding (TICKET-400): EngineApi externs, MessageScan,
the wire protocol. Fetched by Tools/YGOLegacy/fetch-engine.ps1 with the engine. -->
<ItemGroup>
<!-- The engine release's C# binding, shipped next to the exe; and the platform's native engine library,
which EngineLibrary.Locate finds there. -->
<Reference Include="YGOLegacy.Engine">
<HintPath>..\..\Assets\Plugins\Managed\YGOLegacy.Engine.dll</HintPath>
<HintPath>$(EngineDir)YGOLegacy.Engine.dll</HintPath>
</Reference>
</ItemGroup>
<!-- ===================== WindBot (upstream, in-tree) ===================== -->
<ItemGroup>
<Compile Include="../../Assets/Scripts/Windbot/**/*.cs" Link="Linked/Windbot/%(RecursiveDir)%(Filename)%(Extension)" />
<!-- Excluded: BotWrapper.cs is an unused upstream launcher stub with a second
Main() and no callers; nothing else in WindBot references it. -->
<Compile Remove="../../Assets/Scripts/Windbot/BotWrapper.cs" />
</ItemGroup>
<!-- ============== YGOSharp: only what WindBot itself needs ============== -->
<ItemGroup>
<Compile Include="../../Assets/Scripts/YGOSharp/YGOSharp.OCGWrapper.Enums/*.cs" Link="Linked/YGOSharp/OCGWrapper.Enums/%(Filename)%(Extension)" />
<Compile Include="../../Assets/Scripts/YGOSharp/YGOSharp.OCGWrapper/Card.cs" Link="Linked/YGOSharp/OCGWrapper/Card.cs" />
<Compile Include="../../Assets/Scripts/YGOSharp/YGOSharp.OCGWrapper/NamedCard.cs" Link="Linked/YGOSharp/OCGWrapper/NamedCard.cs" />
<Compile Include="../../Assets/Scripts/YGOSharp/YGOSharp.OCGWrapper/NamedCardsManager.cs" Link="Linked/YGOSharp/OCGWrapper/NamedCardsManager.cs" />
<Compile Include="../../Assets/Scripts/YGOSharp/YGOSharp.OCGWrapper/CardsManager.cs" Link="Linked/YGOSharp/OCGWrapper/CardsManager.cs" />
<!-- Not linked: Api.cs/Duel.cs/MtRandom.cs (ocgcore P/Invoke — the game's
in-process core; the arena talks to ygoserver over TCP). -->
<Compile Include="../../Assets/Scripts/YGOSharp/YGOSharp.Network/BinaryClient.cs" Link="Linked/YGOSharp/Network/BinaryClient.cs" />
<Compile Include="../../Assets/Scripts/YGOSharp/YGOSharp.Network/NetworkClient.cs" Link="Linked/YGOSharp/Network/NetworkClient.cs" />
<Compile Include="../../Assets/Scripts/YGOSharp/YGOSharp.Network/YGOClient.cs" Link="Linked/YGOSharp/Network/YGOClient.cs" />
<Compile Include="../../Assets/Scripts/YGOSharp/YGOSharp.Network/Enums/*.cs" Link="Linked/YGOSharp/Network/Enums/%(Filename)%(Extension)" />
<Compile Include="../../Assets/Scripts/YGOSharp/YGOSharp.Network/Utils/BinaryExtensions.cs" Link="Linked/YGOSharp/Network/Utils/BinaryExtensions.cs" />
<!-- Not linked: the Async*/NetworkServer/YGOSharp (server) files — unused by WindBot. -->
</ItemGroup>
<!-- ==================== YGOLegacy: brain + characters ==================== -->
<ItemGroup>
<Compile Include="../../Assets/YGOLegacy/Scripts/Core/Bot/SmartExecutor.cs" Link="Linked/YGOLegacy/Bot/SmartExecutor.cs" />
<Compile Include="../../Assets/YGOLegacy/Scripts/Core/Bot/BoardEvaluator.cs" Link="Linked/YGOLegacy/Bot/BoardEvaluator.cs" />
<Compile Include="../../Assets/YGOLegacy/Scripts/Core/Bot/BattlePredictor.cs" Link="Linked/YGOLegacy/Bot/BattlePredictor.cs" />
<Compile Include="../../Assets/YGOLegacy/Scripts/Core/Bot/BrainRules.cs" Link="Linked/YGOLegacy/Bot/BrainRules.cs" />
<Compile Include="../../Assets/YGOLegacy/Scripts/Core/Bot/EffectSimulator.cs" Link="Linked/YGOLegacy/Bot/EffectSimulator.cs" />
<!-- Duel state bus + Insight (TICKET-042): Unity-free, so both bots of an
arena duel mirror each other exactly as they do in the game. -->
<Compile Include="../../Assets/YGOLegacy/Scripts/Core/Bot/DuelStateBus.cs" Link="Linked/YGOLegacy/Bot/DuelStateBus.cs" />
<!-- In-process duel host (TICKET-045): ocgcore driven straight from this
process, with two WindBot clients on a loopback seam. Unity-free. -->
<Compile Include="../../Assets/YGOLegacy/Scripts/Core/Bot/LocalDuelHost.cs" Link="Linked/YGOLegacy/Bot/LocalDuelHost.cs" />
<Compile Include="../../Assets/YGOLegacy/Scripts/Core/Bot/LoopbackBotSeat.cs" Link="Linked/YGOLegacy/Bot/LoopbackBotSeat.cs" />
<!-- TICKET-050: the lookahead interfaces. The oracle that implements
ILookaheadOracle is arena-only (ReplayOracle.cs) — the game installs
none, which is what keeps SmartExecutor's planner inert there. -->
<Compile Include="../../Assets/YGOLegacy/Scripts/Core/Bot/Lookahead.cs" Link="Linked/YGOLegacy/Bot/Lookahead.cs" />
<!-- The report model + pure helpers shared with the in-editor arena (same JSON). -->
<Compile Include="../../Assets/YGOLegacy/Scripts/Core/Bot/ArenaReport.cs" Link="Linked/YGOLegacy/Bot/ArenaReport.cs" />
<!-- Not linked: BotArena.cs (the in-editor runner: UniTask, OcgCore, TcpHelper). -->
<!-- Path constants: WindBot's own Program.cs reads Expansions/ through them. -->
<Compile Include="../../Assets/YGOLegacy/Scripts/Core/GamePaths.cs" Link="Linked/YGOLegacy/GamePaths.cs" />
<Compile Include="../../Assets/YGOLegacy/Scripts/Core/Identity/Characters/*.cs" Link="Linked/YGOLegacy/Characters/%(Filename)%(Extension)" />
<!-- Excluded: VoiceLineStore.cs is playback (UnityEngine.Random, Language) and
nothing in the arena speaks. -->
<Compile Remove="../../Assets/YGOLegacy/Scripts/Core/Identity/Characters/VoiceLineStore.cs" />
<!-- The deck size caps WindBot's own Deck.cs reads (TICKET-059: extra deck is 99 here). -->
<Compile Include="../../Assets/YGOLegacy/Scripts/Features/DeckEditor/DeckLimits.cs" Link="Linked/YGOLegacy/Services/DeckLimits.cs" />
<Compile Include="../../Assets/YGOLegacy/Scripts/Features/Solo/BotRoster.cs" Link="Linked/YGOLegacy/Services/BotRoster.cs" />
<None Include="$(EngineDir)linux-x64/libygol-engine.so" Condition="'$(RuntimeIdentifier)' == 'linux-x64'"
CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" Link="libygol-engine.so" Visible="false" />
<None Include="$(EngineDir)win-x64/ygol-engine.dll" Condition="'$(RuntimeIdentifier)' == 'win-x64'"
CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" Link="ygol-engine.dll" Visible="false" />
<None Include="$(RepoRoot)engine.json" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest"
Link="engine.json" Visible="false" />
</ItemGroup>
</Project>