Repo ↗ · 原始 README ↗ · 文件包(Markdown/授權)

封面參考(原作): Dishonored · 原作宣傳圖,由 IGDB 提供。圖片版權屬原權利人,供辨識原作使用,不代表此重寫/模組專案的實際畫面。

來源維護者: Nacholmo · 版本: baf903eb45c1 · 整理日期: 2026-10-12

文件授權: MIT · LICENSE-APACHE · LICENSE-MIT · 本文形式: README 翻譯

下文為來源 README 的繁中翻譯,由 Kirikirin 使用 AI 輔助整理;功能、完成度與測試結果均為原作者描述,本站未逐項實機驗證。圖片改為來源連結,指令與技術識別保留原文。


sinhonor

《冤罪殺機》的第一人稱移動與瞬移,以 Rust 實作,並附上 Bevy 測試關卡供你試用。

這不是遊戲的改寫。它是一套可攜式的移動工具組:行走、衝刺、蹲下、跳躍、墜落、沿桿滑行、攀爬、側傾、游泳、爬梯、瞬移、敏捷、劍術與暗殺,建構方式如同 2010-rust-rewrite-mashup 將《Skate 3》帶進 MW2。移動邏輯位於自己的 crate crates/dis_motion 中,僅依賴 glam。它對 Bevy 一無所知,因此同一個控制器可以放進任何能回應盒狀掃掠的遊戲中。

本儲存庫不隨附任何遊戲檔案。 每個數值、音效、效果、材質、網格與動畫都在啟動時**從你自己安裝的《冤罪殺機》**讀取。

執行方式

你需要 Rust(https://rustup.rs))以及已安裝的《冤罪殺機》。在此資料夾中:

cargo run --release -p sinhonor_demo

首次建置需要幾分鐘(Bevy 很大);之後就很快了。

尋找安裝位置。 它會先使用你提供的 --game "",接著是 DISHONORED_DIR 環境變數,然後是常見的 Steam 媒體庫路徑,包括 Steam 的 libraryfolders.vdf 中列出的額外媒體庫。--difficulty easy|normal|hard|veryhard 選擇使用 Corvo 哪一組屬性(預設為 Normal),而 --agility 1 或 2 則以敏捷的第一級或第二級開始。

在 Linux 上,示範程式以原生方式在 Wayland 上執行,並具備真正的指標鎖定。在 X11 下,游標則會被限制並重新置中。

控制方式

動作 鍵盤 / 滑鼠
移動 / 環顧 WASD / 滑鼠
跳躍,或在可及範圍內有邊緣時攀爬(在跳躍過程中按住可施展敏捷的力量跳躍) Space
蹲下(切換,如同遊戲的預設綁定) Ctrl 或 C
沿桿滑行 衝刺時蹲下
衝刺 / 慢走 Shift / Alt
向左 / 向右側傾 Q / E
瞬移:按住瞄準,放開傳送 滑鼠右鍵或 F
瞬移第一級 / 第二級 1 / 2
敏捷:無、第一級、第二級(循環) 3
劍攻擊、暗殺未察覺的守衛,或在墜落時對其施展落下暗殺 滑鼠左鍵
讓守衛注意到你(劍鬥)或失去你(暗殺) T
靜音遊戲音效 M
瞬移除錯輔助線(目標足跡與地面線) G
顯示或隱藏 Corvo 的手臂與劍 H
重置至出生點 R
切換說明 F1
釋放游標(再按一次結束) Esc

動作

距離以公尺為單位;遊戲以 Unreal 單位運作,其中 1 uu = 1 公分。

  • 行走、奔跑、衝刺、潛行:遊戲本身的步態規則(NOTES.md §5h)。速度為 Corvo 發行調整(Twk_Pawn_Corvo_Release)中的 m_GroundSpeed* 屬性,依難度而定:他奔跑為 4 m/s、衝刺為 6 m/s、潛行為 2.75 m/s,手持劍時全部乘以 0.9(m_SwordUnsheathedSpeedFactor),因此實際上為 3.6、5.4 與約 2.5 m/s。搖桿輕推為行走,更輕則為慢走(DisTweaks_PlayerInput 閾值)。推至與側向相差 20° 內(向後移動時為 50°)為側移,而與正後方相差 40° 內為後退:兩者各有奔跑與衝刺的係數(m_GroundStrafeMultiplier*、m_GroundBackwardMultiplier*),因此向前斜向移動會以全速奔跑。衝刺需要用力推,但可朝任何方向運作,且結束時會轉為潛行。加速度為 20 m/s²(m_AccelerationRate),並以相同係數縮放,加上 UE3 的地面摩擦力 8 及其煞車。當最高速度下降時(放開衝刺、蹲下),會以 m_fSpeedBlendDownSpeed 漸變下降,而非立即改變。
  • 跳躍:以 8 m/s 垂直向上起跳(m_JumpZ,與遊戲 StatePlayerMasterJump 讀取的是同一屬性),重力為 15 m/s²(DefaultGame.ini)。最高點為 2.1 m。你所站立表面的垂直速度會加上去,如同遊戲所為。空中控制為引擎的,Corvo 為 20%(m_fAirControl):推力為地面加速度的五分之一,當會將你推入物體時會關閉一幀,而從奔跑速度以上可以轉向但不能加速(NOTES.md §5h)。
  • 墜落:以超過 22.5 m/s 的速度觸地會回報墜落傷害(m_MaxSpeedBeforeFallingDamage;沒有生命值,因此 HUD 會記錄)。落地下沉與鏡頭震動會依撞擊力道縮放。
  • 蹲下(潛行):碰撞從 1.75 m 高縮小至 1.3 m(Corvo 調整中的 m_fSneakHeight),雙腳保持原位。只有在有空間時才會站起。
  • 爬行:走到太低而無法站立或潛行通過的縫隙時,Corvo 會自行蹲得更低,至 66 公分(m_fCrouchHeight,引擎的蹲下高度),然後在前方淨空後起身(m_fAutoCrouchTestDistance 1 m)。
  • 沿桿滑行:衝刺時蹲下。你的速度會從起始處在遊戲的 1.1 秒內漸變下降至潛行速度(m_fSlideTime),兩端皆平緩。前半段無法取消(m_fSlidePercentNotCancelable 0.5);之後,蹲下會讓你站起,跳躍會讓你跳出,向後拉則會停止。滑入會使你轉向超過 25° 的物體(m_fSlideVelocityDeactivateAngle)時,你會立即停止並伴隨鏡頭震動。
  • 攀爬:對著邊緣跳躍,或在墜落經過邊緣時按住前進或跳躍。邊緣尋找器是遊戲本身的(NOTES.md §5f),高度來自 m_pMantleTweaks:
    • 它先測量你上方的空間,然後以你的尺寸向前掃掠一個盒子 50 公分(m_MantleEdgeSearchDist),高度每次上升 12 公分(m_LineCheckStepSize)。它遇到的第一面牆必須近乎垂直且面向你(在 20° 與 45° 內)。從那時起,盒子會持續貼著它並深入 20 公分(m_fMantleForwardMoveAmount)。該深入範圍暢通的第一個高度即為邊緣頂部;
    • 頂部坡度不得超過 45°,且站立盒子必須能通過其上;否則你會以蹲姿攀爬;
    • 低於 44 公分時你只需踏上(MaxStepHeight)。低邊緣,55 公分–1.2 m,為踏階攀爬:三個快速動作(至牆邊、向上、前進 20 公分),視角在 0.2 秒內跟上(m_fLowMantleStepUpBlendTime)。中(1.2–1.7 m)與高(1.7–2.3 m)邊緣會讓你轉向面對邊緣,並沿著動畫本身的根運動攀爬,其上升會拉伸至邊緣高度,直到動畫的退出點(Empty_MantleMedium、…High,或蹲姿版本)。超過 2.3 m 則太高,請用瞬移上去;
    • 以超過 10 m/s 的速度墜落時,你只能抓住至少高於雙腳 1.55 m 的邊緣(m_fFallSpeedForLedgeGrab、m_fLedgeGrabMantleMinEdgeHeight),超過 20 m/s 則完全無法(m_fMaxFallSpeedForMantle)。瞬移之後,瞬移尋找器(m_pMantleBlinkTweaks)沒有最低高度限制。
  • 側傾:Q 與 E 在站立不動時側傾。如同遊戲中(NOTES.md §5g),你的頭部是槓桿上的一點,支點位於其下方兩個身體高度處(m_fLeanHeightPct):側傾以 10 m/s 將其推出(m_fLeanSpeed),它會擺出並稍微下降,直到槓桿傾斜 15°(m_fMaxLeanAngle,若持續推則最多再增加 5°),而彈簧(彈性 80、阻尼 12)會將其帶回。鏡頭會傾斜一半角度,視角只能從側傾開始處轉動 60°、俯仰 35°,且頭部絕不會穿牆。
  • 游泳:走進深水,你會以最高 6 m/s 游泳(m_WaterSpeed),朝你注視的方向,並收起劍。這是引擎的游泳:加速度與轉向如同地面,但水的摩擦力(FluidFriction 的一半)會持續減速而非煞車。工具組會將你的視線保持在水面。游到邊緣並跳躍以爬出。
  • 爬梯:走進梯子即可抓住。你以 2.54 m/s 朝你注視的方向攀爬(LadderSpeed),並在頂端踏上平台。跳躍會以 5.25 m/s 朝你注視的方向躍離(m_fJumpImpulse),在低矮天花板下為兩倍。
  • 鏡頭:頭部晃動與滾轉會依速度縮放(晃動與滾轉量來自 DefaultCamera.ini),落地會以彈簧使視角下沉,而 FOV 為遊戲的 75°。

瞬移

瞬移重現遊戲 DishonoredActivePowerComponent_Blink 的行為,並在 NOTES.md §5 中以我們自己的文字說明。其數值來自 Twk_Blink 的逐關卡陣列。

  • 範圍:壓扁的球體。 平視或向下看時,可達 11 m(第一級)或 16 m(第二級)。向上看時,瞄準會被縮放直到其高度達到 5 m,因此你可以橫向瞬移很遠,但只能向上 5 m。
  • 瞄準會在你按住按鈕時每幀執行。一個 20 公分的盒子會沿你的瞄準方向掃掠。若它撞上你正前方近處的牆(3 m 內),射線會先向上、再向側邊以每次 30 公分推移,因此你可以瞬移過轉角。從撞擊點起,它會以半徑半步拉回,直到你的整個身體能容納,但絕不會退到鏡頭後方。這就是為什麼對著牆瞬移會將你置於牆前。接著它會放下一次掃掠以尋找地面,並抬高目標讓你能在其上方容納。
  • 標記是遊戲本身的粒子系統。Blink_Ground_01 位於目標下方的地面上,依遊戲放置方式向下俯仰 90°。Blink_Fall_01 在目標高於地面時漂浮於目標處。Blink_Mantle_01 在目標為邊緣時顯示。垂直光束是系統的遠 LOD,僅在超過 2.56 m 時生成,如同遊戲中。
  • 移動:放開時,物理切換為飛行,且若你站立,Corvo 會蹲下以容納低矮縫隙(目標保持同一點,因此蹲下的身體會以較高的雙腳抵達,這就是瞬移能到達你上方邊緣的方式)。接著他每 10 ms 移動 1 m(約 100 m/s),以最多 50 公分的子移動進行,沒有碰撞:瞄準掃掠已使路徑安全。移動會在目標處停止、若會超過目標時停止,或碰到 pawn 時停止。
  • 抵達:你瞬移前的速度會恢復,因此瞬移跳躍能保持動量。接著是遊戲的瞬移後邊緣檢查(踏階或完整攀爬,使用 m_pMantleBlinkTweaks)以及嘗試站起。
  • 冷卻:1 秒,伴隨遊戲的冷卻鏡頭效果(Twk_Blink_Cooldown,白色條紋向後掠過鏡頭)與衰減的晃動。
  • 螢幕效果:遊戲的暖機晃動、移動扭曲與模糊曲線(m_fMoveBlurMaxStrength 及其相關)驅動專用的鏡頭 pass,具備徑向模糊、暗色隧道暈影、動態周邊扭曲與細微色彩分離,並伴隨 FOV 衝擊。瞄準點保持銳利,且該 pass 會隨遊戲的冷卻曲線淡出。HDR 泛光會柔化瞄準光暈;手臂與 HUD 保持清晰。

敏捷

敏捷是遊戲的被動能力 Celerity。它遵循遊戲的行為,並在 NOTES.md §5e 中說明。其兩個等級從 DefaultPlayer.ini 的能力列表讀取,且每個等級的屬性修飾會以遊戲套用的方式套用至 Corvo 的屬性:一個等級會取代前一個,而非累加。

  • 力量跳躍:跳躍並持續按住 Space。在跳躍頂點,Corvo 會再次以 13 m/s 被踢起(Attribute_JumpZ_PowerJump,若無敏捷則毫無作用)。總計約 7.8 m,而非 2.1 m。在頂點前放開則為普通跳躍。每次跳躍僅有一次踢起。遊戲程式碼中還有另外兩種跳躍風格(一種較高的跳躍,放開即中斷;以及一種按住期間持續的推力);安裝版本選擇這一種(DefaultPlayerState.ini 中的 m_JumpStyle),而工具組支援全部三種。
  • 落地:兩個等級都會提高墜落傷害與墜落死亡速度(22.5 至 25.5 m/s,以及 29 至 35 m/s)。
  • 第二級也會使 Corvo 衝刺快 30%、游泳快 10%,落地與攀爬播放快 50%,並改變側向與向後衝刺的乘數。

劍

滑鼠左鍵揮動 Corvo 的劍。它遵循遊戲的行為,並在 NOTES.md §5c 中說明,數值來自他劍的調整(DisTweaks_MeleeAttackPlayer)。

  • 連鎖:第一次揮擊是正手。在 1 秒內再次按下(m_fMaxChainAttackTime),下一次就是反手,然後再回到正手。在揮擊的連鎖窗口期間按下會被保留,並在當前揮擊允許時立即開始下一次揮擊。每次揮擊的時機(刀刃何時能命中、連鎖窗口、下一次何時可以開始、何時結束)都來自其動畫的 notifies。
  • 可及距離:2.1 公尺(m_fMaxContextRange),當你向前移動速度超過 4 公尺/秒時會更長:衝刺時為 3.15 公尺(玩家 pawn 的 m_fRaySpeedScale 設定)。刀刃是一個 1.2 公尺寬的盒體,在揮擊的攻擊區間內沿著你的視角從攝影機掃出。
  • 傷害:每擊 10 點(劍的 m_MeleeDamage),對已注意到你的守衛有效(按 T);未察覺的守衛則會被刺殺。守衛有 25 點生命值,這是遊戲中角色的預設值,所以第三擊會致命。當某一擊將致命時,Corvo 會改為播放終結揮擊(Sword_Ready_Fatality_Generic_*)。
  • 潛行攻擊:蹲下時,Corvo 會揮出他的潛行攻擊(Sword_Sneak_Attack_Small)。
  • 牆壁:如果刀刃在碰到角色之前先碰到世界,揮擊會產生後座力(..._Big,或連鎖中為 ..._BigChain),且攝影機會震動(m_fCamShake_OnHitEnv)。
  • HUD 會顯示目標守衛的生命值。揮擊會播放各自的音效。

刺殺

攻擊尚未注意到你的守衛,Corvo 會直接殺死它。此行為遵循遊戲的行為,於 NOTES.md §5d 中指定,數值來自他劍的 DisTweaks_Assassinate tweak。

  • 對象:位於你準星下方 2.75 公尺內(m_fMaxContextRange)的守衛,前提是其警覺狀態允許:未察覺、驚訝、懷疑或求饒(m_AssassinateOnAwareness),且未奔跑。遊戲沒有角度測試:從背後是常見方式,但未察覺的守衛也可以從正面殺死。HUD 會顯示提示。
  • 你所在的一側會決定擊殺方式,與落下刺殺相同。
  • 慢或快:第一次擊殺是緩慢、從容的那一種。接著是 4 到 8 次快速擊殺,並且至少經過 90 到 120 秒,才會再有下一次慢速擊殺(m_NumFinishersBeforeSlow_*、m_fTimeBeforeSlow_*)。
  • 被移動的是守衛,不是 Corvo:守衛會被轉向並設置在他面前,位置由成對動畫中守衛的那一半決定(1 到 1.2 公尺),而 Corvo 播放他的那一半(Sword_Ready_Assassination_[Fast]<Side>_Master),包含其音效與攝影機運動,並保持到他被釋放為止。
  • 沒有空間(一個 m_Assassination_Generic_ProbeExtents 的盒體掃向守衛軀幹時碰到世界)或正在墜落:使用普通刺擊(Sword_Ready_Assassination_Generic),且守衛留在原地。

落下刺殺

落到守衛身上並攻擊,Corvo 會從上方殺死他們。搭配 Blink 時,這就是經典的潛行擊殺:blink 到守衛旁邊或上方,然後落下。此行為遵循遊戲的行為,於 NOTES.md §5b 中指定。數值來自 Corvo 的劍 tweak(DisTweaks_DropAssassinate)。

  • 尋找目標:當你墜落時,Corvo 的碰撞盒會沿著接下來 4 秒(m_fHitWindowInSeconds)墜落將帶他前往的位置掃描,假設至少以 1 公尺/秒向下(m_fMinDropDownVel)。如果該路徑沒有碰到任何東西,則改為筆直向下掃描。若碰到守衛,且你正在墜落而非上升、你的腳高於其軀幹、且你們之間沒有東西阻擋,則該守衛算作有效。HUD 會顯示提示。
  • 在可及範圍內(你的腳在其軀幹 3.5 公尺內,m_fMaxDropDistToTarget):攻擊會立即擊殺。
  • 更上方:攻擊會鎖定。Corvo 停止漂移,他的墜落速度加倍,轉向與能力被停用,並且一進入可及範圍就開始擊殺。如果守衛在下墜途中不再是有效目標,墜落會照常繼續。
  • 側面是你位於守衛正面、背面、左側或右側的哪一側。每一側都有自己的擊殺。遊戲成對動畫中守衛的那一半會把 Corvo 放在其前方 50 公分、側方 80 公分或後方 60 公分處,並面向它。這些位置是從任務包中 City Watch 的動畫讀取。
  • 擊殺:Corvo 播放該側的 Sword_Ready_Assassination_Drop*_Master 動畫及其音效。視角會沿著動畫的攝影機骨骼向下越過身體再返回。當動畫釋放你時(約 1.6 到 1.8 秒後)你會取回控制權。守衛不需要處於未察覺狀態。

Corvo 的手臂、音效與效果(來自你的 Dishonored 副本)

啟動時,demo 會從你的安裝載入 Corvo 的第一人稱手臂、他的劍、其貼圖與動畫、動作音效與粒子效果。本專案不包含任何來自 Dishonored 的內容;每次執行都會從下列檔案讀取這些內容。

檔案(位於 DishonoredGame/CookedPCConsole 下) 提供的內容
Startup.upk Corvo 的 tweak 樹(速度、跳躍、攀越、滑行、攝影機)、他劍的攻擊、刺殺與落下刺殺 tweak 與傷害、預設角色生命值(Twk_Pawn_DefaultNPC)、劍(Wpn_PlySwords.Wpn_PlySword01)、全部 385 個第一人稱動畫(Ply_*)及其效果 notifies、游泳與鏡頭水滴效果
Engine.upk 手臂(Ply_Player.Skm_Player)及其貼圖、引擎預設值(地板角度、摩擦力)
DishonoredGame.upk Pawn 碰撞與眼睛高度、Twk_Blink、Blink 標記與鏡頭效果、腳步、滑行、落地與水花效果,以及測試場地佈置所用的鵝卵石、岩石與木板貼圖
Textures.tfc 與其他 .tfc 快取 貼圖 mips,依位元組範圍讀取
Bank_Footsteps.pck、Bank_Player.pck、Bank_Power_Player.pck、Bank_UI_Ingame_Water.pck 各表面與步態的腳步聲、滑行、落地、攀越、蹲下與站起、墜落風聲、衝刺呼吸、游泳划水,以及 Blink 的暖機、施放與失效
Bank_Weapon.pck、Bank_Impact.pck 落下刺殺與劍動畫所發出的劍與撞擊音效
L_Streets1_P.upk(或另一個含 City Watch 動畫的任務包) 每一側的落下與地面刺殺把 Corvo 放在何處(受害者的 anchor_jnt)
../Config/DefaultGame.ini、DefaultPlayerState.ini、DefaultCamera.ini 重力、傾身、游泳、FOV、晃動與滾轉

移動只需要 tuning。其他所有內容都是選用的,若缺少會略過並顯示警告。

手臂如何運作。

  • 動畫:Dishonored 將其動畫以 Sony 的 Edge 格式烹調(為 PS3 的 SPU 打造),這就是為什麼其他 UE3 檢視器無法播放它們。crates/edge_anim 會解碼它們。
  • 圖層:基礎圖層播放持劍手與身體(Sword_Ready_Idle/Walk/Run/Sprint、Sword_Sneak_*、Sword_SlideLoop、Empty_Swim*、攀越、Sword_Ready_JumpLandSmall、劍揮擊與刺殺)。左臂圖層播放能力手(Powers_Idle/Walk/Sprint/Jump,然後在 blink 前後為 Powers_Cast_Blink_In、…_Loop 與 …_Out)。變更會以 0.18 秒交叉淡入淡出。
  • 攝影機骨骼:視角是骨架的 camera_jnt 骨骼,因此手臂會正好位於遊戲在其 75° FOV 下放置的位置。
  • 劍:握在 RightHandWpn socket 上。在非武裝(Empty_*)游泳動畫中會收起。
  • 繪製:手臂與劍在 CPU 上蒙皮,並由第二台攝影機在各自圖層上繪製,因此它們永遠不會穿入牆壁。
  • 來自動畫的效果:當 Blink 被施放時,手背上的金色光暈與煙霧來自動畫本身。Powers_Cast_Blink_In 與 _Loop 會在 0 秒時於手的 Tattoo socket 上觸發 Ps_Tattoo_Glow_02(因此當你瞄準時,它會在每个 0.33 秒循環重新觸發),而 _Out 會觸發 Ps_Tattoo_Glow_04。游泳划水也會以相同方式在手指上產生水花。demo 會讀取每一個這類 notify,因此效果會保持遊戲的時序。
  • 發光刺青:在執行階段從已安裝手臂貼圖衍生的遮罩會跟隨皮膚的 UV,並使用材質的金色能力手顏色。其亮度在瞄準時上升,並在傳送後淡出。深度淡化會柔化煙霧與光暈卡片與手相接處。

音效。 Wwise 音效包會被解析,其 Vorbis 音訊會在記憶體中轉換為 Ogg。腳步聲會跟隨你的步態與你下方的表面(石頭、木頭、礫石、水、屋瓦、金屬)。設定 SINHONOR_LOG_SFX=1 可在每個 cue 播放時印出。

效果。 遊戲的 Cascade 粒子系統會被模擬並繪製為 sprite 與 mesh 粒子,使用遊戲的距離 LOD。它們包括 Blink 標記的原始漩渦 mesh 與抵達條紋、滑行塵土、落地塵土、礫石與水上的腳步揚塵、水花、游泳尾流,以及你從水中爬出後鏡頭上的水滴。方形 sprites 會保持其方形形狀,包括軸向鎖定的光暈卡片。重落地也會震動攝影機。

仍屬近似的部分:

  • 尚未精確:傾身的牆壁碰撞與游泳者的水面保持是套件自身的,而梯子是簡單模型。
  • 攝影機:頭部晃動是程序式的。遊戲是由攝影機動畫(Ply_Nav_LocoCamera_at)驅動,Edge 解碼器現在可以讀取,但尚未有任何東西播放它。
  • 效果:SubUV flipbooks 與原始材質的捲動/扭曲圖尚未完成。Mesh 粒子使用已烹調的 LOD 0 幾何、UV、頂點顏色與旋轉曲線。粒子材質、刺青亮度與 Blink 鏡頭 shader 近似其外觀;它們並未重建原始 shaders。世界攝影機使用 HDR bloom。
  • 煙霧:手部煙霧是相對於攝影機模擬,因此不會像遊戲中那樣在你身後拖曳。
  • 劍:尚無撞擊音效、火花或血(它們來自遊戲的接觸系統)。一次揮擊中有多名守衛時,套件會命中最近的,而遊戲會依揮擊方向排序它們。守衛不會反擊,因此沒有格擋、招架或劍鎖。
  • 刺殺:守衛是會倒下的盒體(在地面刺殺中被移動到位後)。沒有守衛模型播放其擊殺的那一半,且彎身時間、故事角色與搬運屍體變體尚未加入。
  • 落下刺殺:守衛是會倒下的盒體。尚無守衛模型播放其擊殺的那一半,且擊殺動畫的血鏡頭效果未顯示。

NOTES.md §6 有每個部分的保真度表。

測試場地

一個以遊戲貼圖佈置的 blockout 場地(crates/sinhonor_demo/src/level.rs)。你開始時面向其方向。

  1. 攀越牆,前方 8 公尺:五個高度遞增的方塊,30 公分(踏上台階)、90 公分(低)、1.5 公尺(中)、2.2 公尺(高)與 3.2 公尺(太高,因此 Blink 上去,或用 Agility 強力跳躍)。

  2. 右側的樓梯,20 公分階高,通往 3 公尺陽台。

  3. 左側的礫石地與右側的水窪,用於腳步聲及其塵土與水花。

  4. 你左後方的水池:4 公尺深,用於游泳與爬出。

  5. 滑行通道:一根離地 1 公尺的爬行樑,只有爬行時能通過。

  6. 傾身柱可用來窺視轉角。

  7. 梯塔,高 6 公尺,然後是間隙為 8 公尺、10 公尺與 14 公尺的屋頂。Tier I 能跨越第一個,最後一個需要 tier II。

  8. 高處棲點:一根 11 公尺的柱子,只能從屋頂向上 blink 到達。

  9. 四個假人守衛(紅色盒體;深色帶是其正面)有 25 點生命值。它們一開始未察覺,因此攻擊其中一個會刺殺它;按 T 它們會注意到你,因此劍會改為與它們戰鬥。Blink 會停在它們處,且你可以對其中任何一個進行落下刺殺:

    • 兩個在空曠處:blink 到其中一個旁邊並落到它身上;
    • 一個背對陽台:從邊緣走下去落到它身上;
    • 一個在第一個屋頂下方:從屋頂走下去,鎖定並俯衝。

    R 會讓它們重新站起。

在其他遊戲中使用動作套件

dis_motion 只需要宿主遊戲提供兩件事:

  • 一個 World 實作。只需要一個方法:
    • sweep(start, end, half):沿著路徑移動一個盒體,並回報第一個阻擋命中(點、法線,以及它是否從某物內部開始)。half 為零時是線跡。

其他的都有預設值:overlaps、water(某一點的水體積)、ladder、blink_blocked(遊戲中阻擋瞬移的體積)以及 pawn(角色的中心、地板、軀幹高度、朝向、生命值、警覺狀態,以及是否正在奔跑,供劍與暗殺使用)。每個動作都建立於這些之上,因此任何宿主有的碰撞都可行。BoxWorld(軸對齊盒)也包含在內。

  • 每幀一個 Input:移動軸、視角變化量,以及跳躍、蹲下、衝刺、行走、側傾、瞬移和攻擊按鈕。

然後:

let data = dis_data::load(&install, dis_data::Difficulty::Normal)?;
// Agility's levels are 1 and 2; leave this out for none.
let data = data.with_power(dis_data::powers::AGILITY, 1);
let mut motion = Motion::new(MotionTuning::from_game(&data), spawn, yaw);
// every frame
let events = motion.update(&world, &input, dt);

讀回 motion.camera.eye、motion.yaw、motion.pitch、motion.camera.roll 和 motion.camera.fov_deg 以供攝影機使用,motion.state 和 events(包括 power_jumped,以及帶有 mantled 的 mantle_impact 用於硬接住)以供動畫和音效使用,motion.blink(模式、目標和 fx 螢幕參數)以供瞬移的視覺效果使用,以及 motion.takedown(提示、鎖定和進行中的擊殺)加上 events.drop_assassination 和 events.assassination(後者也說明要把受害者放在哪裡)以擊殺你身邊的目標,還有 motion.melee(正在播放的揮擊和目標)加上 events.melee(揮擊、帶有傷害的命中、撞牆)以供劍使用。座標是 Unreal 風格:Z 向上,公分。在你的邊界進行轉換。

測試

cargo test --workspace

crates/dis_motion/tests/motion.rs 以腳本化輸入驅動控制器。它檢查:

  • 在地板上安定下來並以奔跑速度奔跑;
  • 步態:直線前進和前方對角線時的全速,側向和後方對角線時的平移係數,正後退時的前進係數,輕推時的行走和慢速行走,衝刺的後退係數,以及劍的減速;
  • 衝刺後最高速度的混合下降,以及煞車至完全停止;
  • 空中控制轉向而不將速度加到超過地面速度,以及終端速度;
  • 跳躍頂點與彈道學的對比;
  • 敏捷的力量跳躍:僅在跳躍被按住到頂端時、僅一次,且沒有該能力時不會發生;以及其他兩種跳躍風格;
  • 踏上小台階和攀上高台;邊緣尋找器對低邊緣的踏升和對高邊緣的動畫驅動攀爬(面向邊緣),在掠過角度時拒絕牆壁,在低屋頂下蹲下,以及在快速下落時僅在遠超過邊緣後才抓住邊緣;
  • 滑行減速至蹲下速度,僅在其第一部分之後取消,並在牆壁使其轉向時完全停止;
  • 側傾以槓桿將頭部擺出至角度限制,保持視角,並彈回;
  • 在低矮間隙下自動蹲下,以及在太低而無法潛行通過的間隙下爬行;
  • 瞬移到達牆壁並保持動量,在蹲下施放時留在地板上,以及其壓扁球體範圍;
  • 在水面游泳,以水中速度並收起劍,放開時滑行,爬梯子,以及沿視角從梯子跳下;
  • 劍:正手和反手連段,擊中範圍內的守衛並以致命一擊終結,從牆壁反彈後座力,在範圍外落空,範圍隨前進速度增長,以及蹲下時的偷襲;
  • 地面暗殺:從背後殺死未察覺的守衛,受害者被放置在前面,拒絕處於戰鬥中或奔跑中的守衛,慢速然後快速的擊殺,以及當世界擋路時的普通擊殺;
  • 落下暗殺:範圍內的擊殺,從更高處的鎖定俯衝,從目標的朝向選擇側面,落地位置,掃描 Corvo 的碰撞盒,以及當有東西擋路、上升中或在地面上時沒有目標。

一個測試在你的安裝能找到其實際調校值時會在其上執行,否則跳過。

數字從何而來

所有調校值在執行階段由 crates/dis_data 讀取,而 cargo run --release -p dis_data --example dump_tuning 會印出它找到的一切。

  • Corvo 的調整樹(Startup.upk):根是 Twk_Pawn_Corvo.Twk_Pawn_Corvo_Release。它為每個難度指向一個屬性集(每個 DisAttribute 持有四個值,從 Easy 到 VeryHard)、攀爬調整值、一個在瞬移後使用的獨立攀爬調整值,以及攝影機調整值。
  • Pawn 預設值(DishonoredGame.upk、Engine.upk):碰撞大小、蹲下大小、台階高度、眼睛高度、梯子速度、可行走地板角度和摩擦力,來自類別預設物件。
  • INI 檔案:重力、側傾彈簧、游泳划水、FOV、晃動和滾動、跳躍風格,以及能力的升級等級及其屬性修飾符。
  • 動畫(Startup.upk):滑行和落地的持續時間與播放它們的動畫一樣長,而攀爬跟隨其動畫的根運動直到其退出通知。
  • 行為:瞬移的目標選擇、行進、結束和螢幕效果,以及跳躍,遵循 NOTES.md §5 中指定的行為;落下暗殺遵循 §5b,劍遵循 §5c,地面暗殺遵循 §5d,敏捷遵循 §5e,攀爬遵循 §5f,滑行和側傾遵循 §5g,行走遵循 §5h。此儲存庫中沒有任何遊戲程式碼,無論是反編譯的還是其他的。

版面配置

crates/dis_motion/     the motion kit: engine-agnostic, depends only on glam
  src/controller.rs    the state machine: walk, crouch, jump, fall, slide, mantle, swim, ladder, Blink travel
  src/blink.rs         Blink targeting, range, pull-back, stepping, cooldown and screen parameters
  src/melee.rs         the sword: swing choice and chaining, reach, target, blade sweep, wall recoil
  src/takedown.rs      drop and ground assassinations: targets, lock-on dive, sides, pacing and placement
  src/camera.rs        eye height, bob, roll, landing dip, lean spring, FOV
  src/collide.rs       collide-and-slide on top of World::sweep
  src/boxworld.rs      a World made of axis-aligned boxes, water, ladders and pawns
  src/tuning.rs        MotionTuning, built from the game's values
  tests/motion.rs      one test per move, by scripted input
crates/dis_data/       finds the install and loads tuning, sounds, effects, arms, textures and sword and drop-assassination data from it
crates/upk/            UE3 package reader: LZO, names, imports, exports, tagged properties, textures, skeletal/static meshes
crates/edge_anim/      Sony Edge animation decoder
crates/wwise/          Wwise sound packages (AKPK, bank v65) to Ogg
crates/cascade/        UE3 Cascade particle systems: loading, materials and simulation
crates/sinhonor_demo/  the Bevy test course
  src/main.rs          app, input, camera, sounds, effect triggers, HUD, autopilot
  src/hands.rs         Corvo's arms and sword: animation layers, CPU skinning, viewmodel camera
  src/blink_post.rs     Blink radial blur and lens distortion render pass (embedded WGSL)
  src/fx.rs            particle rendering, in the world, on the lens and in the viewmodel
  src/level.rs         the test course, as data
NOTES.md               research notes: formats, the game's motion and Blink, credits

upk、cascade、edge_anim、wwise 和 dis_data 的 examples/ 是用來釐清這一切所用的開發工具:套件傾印、粒子模擬、材質和動畫探測器,以及一個參考尋找器。

螢幕擷取模式

cargo run --release -p sinhonor_demo -- --autopilot shots 播放一條腳本化路線,不需要滑鼠:一次攀爬、一次瞬移、梯子、屋頂瞬移、一次滑行、瞬移標記的特寫和到達鏡頭效果。它會在每個檢查點印出運動狀態,將每個檢查點的 PNG 儲存到 shots/,然後結束。改加 --route fx 以使用效果路線:瞬移標記的近處和遠處、行進中、礫石、水坑、掉入水池、游泳和爬出。--route drop 播放三次落下暗殺:從陽台、從屋頂俯衝,以及瞬移上去到守衛旁邊。--route sword 將三次揮擊連段到一個守衛身上,朝牆壁揮擊並進行一次偷襲。--route assassinate 從背後暗殺一個守衛(慢速),從側面暗殺另一個(快速)。--route lean 從柱子後面向兩側側傾,並滑行撞牆。--route agility 在沒有敏捷的情況下在 3.2 公尺方塊處按住跳躍,然後在有敏捷的情況下(力量跳躍,然後跳上方塊),並以敏捷 II 衝刺。這在變更後檢查沒有東西壞掉時很方便。

目的與範圍

sinhonor 是一個獨立、非商業的研究和互通性專案。其目標是理解 Dishonored 的玩家移動、瞬移、劍和暗殺感覺如何,並透過原創程式碼使那種感覺能在其他遊戲中使用。

  • 你需要自己的副本。 它僅適用於合法購買的安裝。示範程式在你的機器上、在執行階段讀取該安裝。
  • 遊戲中的任何東西都不會被散布。 此儲存庫不包含任何遊戲資產、資料、設定、可執行程式碼或反編譯程式碼,也不會生成任何到其中。.gitignore 是一個白名單,因此不會有任何東西被意外提交。
  • 遊戲保持原封不動。 這裡沒有任何東西修改、修補或注入已安裝的遊戲或其檔案。它不會與遊戲並行執行,不會連線到任何線上服務,也不會繞過任何複製保護或存取控制。
  • 程式碼是原創的。 檔案格式讀取器是根據公開格式文件(於下方和 NOTES.md 中致謝)以及檢查檔案格式以便讀取資料而撰寫的。移動、瞬移、劍和暗殺程式碼實作了一份以我們自己的文字撰寫的行為規格。沒有使用來自遊戲或來自其他專案反編譯的任何程式碼。

Dishonored 及其內容屬於 ZeniMax Media 和 Arkane Studios。如果你持有該內容的權利並對這裡的任何東西有疑慮,請開啟一個 issue,它將會被迅速處理。

致謝與授權

在 UE Viewer、UELib、ue3-tools、dishonoredrecompiled 的格式筆記、CodeRed-Generator、ww2ogg 和 lewton 的幫助下,以及基於 Bevy 和 glam 建構。結構參考:iw4L、gang-beasts-rust、benilla 和 2010-rust-rewrite-mashup;dishonored-bevy 僅為查證事實而參考。NOTES.md §8 有含授權的完整清單。

此專案以 MIT 或 Apache-2.0 雙重授權。Dishonored 是 ZeniMax Media 的商標;此專案與 Arkane Studios 或 Bethesda 無關。


授權與來源聲明

原始 README 與翻譯沿用 MIT 授權;本次修改為繁中翻譯、連結與排版調整。可修改的 Markdown、原始 README、LICENSE 與 NOTICE 收錄於頂部文件包。原作遊戲內容與商標不因此獲得授權。

LICENSE-APACHE

Apache License
                        Version 2.0, January 2004
                     http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

   "License" shall mean the terms and conditions for use, reproduction,
   and distribution as defined by Sections 1 through 9 of this document.

   "Licensor" shall mean the copyright owner or entity authorized by
   the copyright owner that is granting the License.

   "Legal Entity" shall mean the union of the acting entity and all
   other entities that control, are controlled by, or are under common
   control with that entity. For the purposes of this definition,
   "control" means (i) the power, direct or indirect, to cause the
   direction or management of such entity, whether by contract or
   otherwise, or (ii) ownership of fifty percent (50%) or more of the
   outstanding shares, or (iii) beneficial ownership of such entity.

   "You" (or "Your") shall mean an individual or Legal Entity
   exercising permissions granted by this License.

   "Source" form shall mean the preferred form for making modifications,
   including but not limited to software source code, documentation
   source, and configuration files.

   "Object" form shall mean any form resulting from mechanical
   transformation or translation of a Source form, including but
   not limited to compiled object code, generated documentation,
   and conversions to other media types.

   "Work" shall mean the work of authorship, whether in Source or
   Object form, made available under the License, as indicated by a
   copyright notice that is included in or attached to the work
   (an example is provided in the Appendix below).

   "Derivative Works" shall mean any work, whether in Source or Object
   form, that is based on (or derived from) the Work and for which the
   editorial revisions, annotations, elaborations, or other modifications
   represent, as a whole, an original work of authorship. For the purposes
   of this License, Derivative Works shall not include works that remain
   separable from, or merely link (or bind by name) to the interfaces of,
   the Work and Derivative Works thereof.

   "Contribution" shall mean any work of authorship, including
   the original version of the Work and any modifications or additions
   to that Work or Derivative Works thereof, that is intentionally
   submitted to Licensor for inclusion in the Work by the copyright owner
   or by an individual or Legal Entity authorized to submit on behalf of
   the copyright owner. For the purposes of this definition, "submitted"
   means any form of electronic, verbal, or written communication sent
   to the Licensor or its representatives, including but not limited to
   communication on electronic mailing lists, source code control systems,
   and issue tracking systems that are managed by, or on behalf of, the
   Licensor for the purpose of discussing and improving the Work, but
   excluding communication that is conspicuously marked or otherwise
   designated in writing by the copyright owner as "Not a Contribution."

   "Contributor" shall mean Licensor and any individual or Legal Entity
   on behalf of whom a Contribution has been received by Licensor and
   subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
   this License, each Contributor hereby grants to You a perpetual,
   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
   copyright license to reproduce, prepare Derivative Works of,
   publicly display, publicly perform, sublicense, and distribute the
   Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
   this License, each Contributor hereby grants to You a perpetual,
   worldwide, non-exclusive, no-charge, royalty-free, irrevocable
   (except as stated in this section) patent license to make, have made,
   use, offer to sell, sell, import, and otherwise transfer the Work,
   where such license applies only to those patent claims licensable
   by such Contributor that are necessarily infringed by their
   Contribution(s) alone or by combination of their Contribution(s)
   with the Work to which such Contribution(s) was submitted. If You
   institute patent litigation against any entity (including a
   cross-claim or counterclaim in a lawsuit) alleging that the Work
   or a Contribution incorporated within the Work constitutes direct
   or contributory patent infringement, then any patent licenses
   granted to You under this License for that Work shall terminate
   as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
   Work or Derivative Works thereof in any medium, with or without
   modifications, and in Source or Object form, provided that You
   meet the following conditions:

   (a) You must give any other recipients of the Work or
       Derivative Works a copy of this License; and

   (b) You must cause any modified files to carry prominent notices
       stating that You changed the files; and

   (c) You must retain, in the Source form of any Derivative Works
       that You distribute, all copyright, patent, trademark, and
       attribution notices from the Source form of the Work,
       excluding those notices that do not pertain to any part of
       the Derivative Works; and

   (d) If the Work includes a "NOTICE" text file as part of its
       distribution, then any Derivative Works that You distribute must
       include a readable copy of the attribution notices contained
       within such NOTICE file, excluding those notices that do not
       pertain to any part of the Derivative Works, in at least one
       of the following places: within a NOTICE text file distributed
       as part of the Derivative Works; within the Source form or
       documentation, if provided along with the Derivative Works; or,
       within a display generated by the Derivative Works, if and
       wherever such third-party notices normally appear. The contents
       of the NOTICE file are for informational purposes only and
       do not modify the License. You may add Your own attribution
       notices within Derivative Works that You distribute, alongside
       or as an addendum to the NOTICE text from the Work, provided
       that such additional attribution notices cannot be construed
       as modifying the License.

   You may add Your own copyright statement to Your modifications and
   may provide additional or different license terms and conditions
   for use, reproduction, or distribution of Your modifications, or
   for any such Derivative Works as a whole, provided Your use,
   reproduction, and distribution of the Work otherwise complies with
   the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
   any Contribution intentionally submitted for inclusion in the Work
   by You to the Licensor shall be under the terms and conditions of
   this License, without any additional terms or conditions.
   Notwithstanding the above, nothing herein shall supersede or modify
   the terms of any separate license agreement you may have executed
   with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
   names, trademarks, service marks, or product names of the Licensor,
   except as required for reasonable and customary use in describing the
   origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
   agreed to in writing, Licensor provides the Work (and each
   Contributor provides its Contributions) on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
   implied, including, without limitation, any warranties or conditions
   of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
   PARTICULAR PURPOSE. You are solely responsible for determining the
   appropriateness of using or redistributing the Work and assume any
   risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
   whether in tort (including negligence), contract, or otherwise,
   unless required by applicable law (such as deliberate and grossly
   negligent acts) or agreed to in writing, shall any Contributor be
   liable to You for damages, including any direct, indirect, special,
   incidental, or consequential damages of any character arising as a
   result of this License or out of the use or inability to use the
   Work (including but not limited to damages for loss of goodwill,
   work stoppage, computer failure or malfunction, or any and all
   other commercial damages or losses), even if such Contributor
   has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
   the Work or Derivative Works thereof, You may choose to offer,
   and charge a fee for, acceptance of support, warranty, indemnity,
   or other liability obligations and/or rights consistent with this
   License. However, in accepting such obligations, You may act only
   on Your own behalf and on Your sole responsibility, not on behalf
   of any other Contributor, and only if You agree to indemnify,
   defend, and hold each Contributor harmless for any liability
   incurred by, or claims asserted against, such Contributor by reason
   of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

   To apply the Apache License to your work, attach the following
   boilerplate notice, with the fields enclosed by brackets "[]"
   replaced with your own identifying information. (Don't include
   the brackets!)  The text should be enclosed in the appropriate
   comment syntax for the file format. We also recommend that a
   file or class name and description of purpose be included on the
   same "printed page" as the copyright notice for easier
   identification within third-party archives.

Copyright 2020 Cameron Hart

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

LICENSE-MIT

MIT License

Copyright (c) 2026 sinhonor contributors

Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.