BurstsOfRain

版本 v0.1.0·更新於 2024-10-27

ALPHA RELEASE: Burst Assembly Loader and Redistribution of specific Unity.DOTS libraries.

截圖 共 3 張

模組介紹 作者原文

Bursts of Rain

Bursts of Rain is a lightweight assembly loader that's used to load Burst compiled unity assemblies, allowwing for the usage of Burst-Compiled Jobs within mods for Risk of Rain 2.

To allow for the full utilization of the Data Oriented Technology Stack (DOTS)'s systems, this Package redistributes the following unity assemblies, which are not found within the base game:

| Assembly | Unity Package Version |

|--|--|

| System.Runtime| Not Applicable |

| Unity.Burst | 1.8.18 |

| Unity.Collections | 1.5.1 |

| Unity.Mathematics | 1.2.6 |

These assemblies should not cause issues on existing profiles.

For Developers

Bursts of Rain is used mainly as a front-end and ease of loading for Bust Assemblies utilizing `BurstRuntime.LoadAdditionalLibrary's method, BurstsOfRainMain contains a method that can be used to simplify this process, by giving it your PluginInfo, which serves as the start location, and a string`, which should be the name of the bursted assembly.

//Example

public class MyModWithBurstedAssemblies: BaseUnityPlugin

{

private void Awake()

{

//Load the assembly named "MyMod_Burst.dll" onto the Burst Runtime

BurstsOfRainMain.AddBurstAssembly(Info, "MyMod_Burst.dll");

}

}

Below are the main entries for each of the unity packages this package redistributes, alongside a brief description:

| Package | Description |

|--|--|

| Burst | Burst is a compiler that translates from IL.NET bytecode to highly optimized native code using LLVM. |

| Collections | A C# collections library providing data structures that can be used in jobs, and optimized by Burst compiler. |

| Mathematics | Unity’s C# SIMD math library providing vector types and math functions with a shader like syntax. Methods within are Job Safe |

While not redistributed by the mod since its part of the Core module, an understanding of the Jobs System is also required.

Development of Mods using Burst

Development of mods utilizing burst follows very similar procedures as regular Burst-centered job development, utilization of Data oriented programming is recommended over Object oriented programming to allow for the full utilization of the Jobs and Burst system, an example on how to "Burstify" a complex behaviour can be found in this Github Repository, courtesy of Nebby.

Utilizing ThunderKit as your main mod development environment is recommended, as there you can utilize the direct packages of Burst, Collections and Mathematics.

Burstifying an Assembly

Burstifying an existing assembly is done utilizing the `BCL.exe file found within the Burst package, specifically in Burst.Runtime`

For more information on how to utilize the `BCL.exe` file directly, look below at the "Non ThunderKit" section.

ThunderKit:

For burstifying your assembly utilizing the ThunderKit development environment, it is recommended to utilize the RoR2ThunderBurster package, which contains the following utilities for deploying your bursted assemblies

  • Import Extension: for ensuring the installation of Burst, Collections and Mathematics.
  • `BurstAssemblyDefinitionsDatum: A subclass of ThunderKit's AssemblyDefinitions` manifest datum, which is used to mark that the Assembly Definitions within should be passed thru the Burst Compiler if possible.
  • `BurstStagedAssemblies: A custom PipelineJob that requires a BurstAssemblyDefinitionsDatum`, it utilizes reflection to enqueue and compile the selected assemblies with BCL, mimicking as close as possible the actual compilation of Bursted Assemblies when a Player is Built.

Replacing your `Manifest's AssemblyDefinitions datum with a BurstAssemblyDefinitionsDatum, and running a BurstStagedAssemblies job after a StageAssemblies` is enough to burst-compile your assembly.

Non ThunderKit:

To burstify an assembly without ThunderKit you'll need to get access to the internal Burst compiler (BCL.exe), a download of the package can be found in this website: ` altern

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

bbepis-BepInExPack

檔案與校驗

檔案名稱
BurstsOfRain-0.1.0.zip
檔案大小
1.6 MiB