TurretsPhysicsPatch

版本 v0.2.0·更新於 2024-06-03

Changes the bullet physics related to motion. More specificaly changes drag to be quadratic and forces a fixed update rate to make bullet motion independent of framerate. Works post update, but is bui

模組介紹 作者原文

Turret's Physics Patch

This patch changes the update method in MoveTransform to a more accurate equation of motion, and changes the drag to be quadratic instead of constant. Also locks the rate at which the bullets update their position at 70 hz.

This results in the bullet's motion being independant of framerate.

Bullet motion without drag remains largely unaffected.

This mod can exhibit strange behavior when a player has a high bullet velocity and drag.

This is a result of the numerical integration used, RK4 does somewhat aleviate this.

If you notice any issues, please post in the rounds modding discord.

I will look at the bug reports channel from time to time.

Small note:

I haven't been able to test the added functions since the update, they worked before and the patch seems to work now.

Changes

EOM: at^2 + v0t + s0 --> a = F, v = da/dt, x = dv/dt.

Drag: a = D --> a = DV^2 3/ 400.

Update rate: per frame --> 70 hz.

Adds some functions that impact the acceleration.

Added functions (These are added to MoveTransform)

add_variate_acceleration (2 overloads)

  • Adds a function to the acceleration equation
  • this function must be of type Func or list>
  • the order of parameters of the function is time then velocity
  • if list is used index 0 indicates x and index 1 indicates y
  • if the equation only holds in one direction the direction parameter can be used instead of the list
  • 'x' for x
  • 'y' for y
  • the equation is activated at t (time since shot for the bullet), the input value should be in the future for all players as to keep the trajectory the same for each player.

add_constant_acceleration

  • Adds a constant acceleration
  • Requires a Vector3 but only x an y are used
  • the acceleration is added at t (time since shot for the bullet), the input value should be in the future for all players as to keep the trajectory the same for each player.

rungekutta4 (2 overloads)

  • Performs RK4 integration scheme
  • dir vector consists of position (x) then velocity (y)
  • t is used as input to func
  • dtt is used as input to RK4

安裝與使用 安裝:BepInEx 外掛

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

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

前置依賴

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

BepInEx-BepInExPack_ROUNDS

檔案與校驗

檔案名稱
TurretsPhysicsPatch-0.2.0.zip
檔案大小
21.8 KiB