如题,游戏中,拨动虚拟操作杆来控制角色移动的时候,如果虚拟操作杆只朝向一个方向移动一点点距离的话,角色的移动速度就会变的很慢。这和原生游戏的操作感差距很大。
希望 角色的移动速度 是固定的,而不是跟虚拟操作杆的位移距离 线性相关。 或者,在设置中增加一个 checkbox 来区分是否开启这种 线性移动速度的选项。
Activity
3@Diablo-chia619, in #256 you mentioned your fork already has a joystick change for this: b0c46fe on android/turnip-and-stick. Full speed comes within 30 points of travel instead of 60, the response is a square-root curve so a small push already moves the character, and DM_TOUCH_STICK_TRAVEL adjusts it. That matches what this issue asks for, so rather than write a second fix we'd prefer yours. Could you open it as its own small PR (the joystick part only, without the Turnip driver)?
Since it changes the shared touch code (dm/ios/Sources/dm_touch_controls.c), it also affects iOS and HarmonyOS. Please mention that in the PR so @jhaizhou-ops and @biglawine can try it on their devices.
@Diablo-chia619,你在 #256 里提到你的 fork 已经为这个问题改过摇杆:android/turnip-and-stick 分支的 b0c46fe。满速行程从 60 点缩到 30 点,再走开方曲线,轻推一点人物就会走,DM_TOUCH_STICK_TRAVEL 可以调。这正是本 issue 要的,所以我们不想再写一个重复的修复,更希望用你的。能否把它单独开一个小 PR(只含摇杆部分,不含 Turnip 驱动)?
它改的是共享的触控代码(dm/ios/Sources/dm_touch_controls.c),iOS 与鸿蒙也会受影响。请在 PR 里注明,方便 @jhaizhou-ops 和 @biglawine 在各自设备上试。
拆出来了:PR #273 — https://github.com/jhaizhou-ops/d2r-mobile/pull/273
只含摇杆这一件事:dm/ios/Sources/dm_touch_controls.c / .h、dm/android/touch_android.c 的两行 override,加两个测试。没有驱动代码、没有存档导入、没有并排打包。
@heshanu3d 想先摸手感的话,我 fork 的 release 里有带这个改动的包(own-2.3.0-t30-1,含内置 Turnip;游戏文件自备,不含任何游戏内容)。嫌太灵敏或不够快,不用重编:files/dm/env 写 DM_TOUCH_STICK_TRAVEL=40(或 20)重启 App;想完全回到原来的 60 点线性手感就写 60。
English: Split out as PR #273 as asked — stick only (shared touch code, the 2-line Android override, and the two tests; no driver code, no save-import, no side-by-side packaging). A build with it is in my fork's releases for trying the feel. DM_TOUCH_STICK_TRAVEL in files/dm/env (12..60, restart, no rebuild) covers the range from 20 (quicker) to 60 (the old travel); the curve stays square-root unless the default itself is changed.
确认这个问题,而且原因就在触屏摇杆的映射上,不在游戏里。
机制:
dm/ios/Sources/dm_touch_controls.c里,摇杆送值是按手指位移线性缩放的:所以推 15 点只有约 17% 速度(人物播跑步动作但像慢镜头),要推到 60 点才是全速;反向时手指还要从 +60 跨到 −60,等于 120 点,这就是“必须抬手重按”的来源。
我这边改成(Android 实测有效):
改完之后:轻推即走、反向只需横跨 60 点不用抬手。代价是极轻推时的精细度略降;这个可以用一个运行时开关调,不必重新编译:
验证过的东西:只在 OnePlus Ace 5 Pro(Adreno 830 / Android 16)上真机试过,主观手感由日常玩的人确认(“嘎嘎跟手”)。改的是 1 个 .c 文件加 2 个测试,没有动引擎和其他平台逻辑。
放包的地方:我把自己在用的 Android 自编包放在了自己的 fork 上(不含任何游戏内容,游戏文件要自备,见 NOTICE):
如果上游愿意收这个改动,我可以把它整理成一个只碰
dm_touch_controls.c+ 两个测试的最小 PR(默认行为要不要变由作者定,比如默认保留 60 点、用开关打开 30 点)。English: confirmed — the touch stick maps finger travel to speed linearly with a 60-point full-deflection radius, so a small push gives slow-motion movement and reversing needs a 120-point sweep (hence lifting the finger). In my Android build I changed the full deflection to 30 points with a square-root curve and draw the thumb from the real finger position; the travel is tunable at runtime via
DM_TOUCH_STICK_TRAVEL(12–60). Verified on a OnePlus Ace 5 Pro only. I published the pack I use myself on my fork — no game content is included, the game files are the user's own; the same release carries NOTICE and the third-party licences, and the application id differs so it installs next to the official app. Happy to turn this into a minimal PR touching one file plus two tests if the maintainer wants it.