DSPCraftingSpeed-MultiDroneLaunch icon

MultiDroneLaunch

建设无人机多发: the mecha sends out several construction drones per tick instead of one; optional building while flying fast and full-speed drones in a slow game.

Last updated a day ago
Total downloads 61
Total rating 0 
Categories Mecha Quality of Life
Dependency string DSPCraftingSpeed-MultiDroneLaunch-1.1.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

xiaoye97-BepInEx-5.4.17 icon
xiaoye97-BepInEx

BepInEx5.4.17 mod plugin framework, Mod框架

Preferred version: 5.4.17

README

Multi Drone Launch(建设无人机多发)

The mecha sends out more than one construction drone per logic tick, so idle drones no longer wait in the mecha while ready-to-build buildings are in range. 机甲每个逻辑帧可以派出多架建设无人机,范围内已经领到料的待建建筑不再等着, 机甲里不再一直闲着一批无人机。

Nothing is saved; remove the mod and the game is vanilla again.

What limits the game

Every logic tick the mecha marks only the first group of its build list (up to four nearby buildings that already have their item) and sends one drone for it. So the mecha launches at most one drone a tick. When trips are short (buildings close by) a drone is back before the mecha gets round to it again, and a part of a large drone fleet never leaves the mecha. Measured in a running game with 117 drones: never more than one launch a tick, on average 0.69, and 30–40 drones idle while more than 1 000 buildings in range were ready to be built.

What the mod does

After the game's own launch, the mod walks the later groups of the same list (already sorted by the game) and sends one more drone for each group that is still free — up to ExtraPerTick more a tick, while idle drones are left. Each drone gets its group's four targets, exactly as the game would hand them out a tick later. The game's rules stay:

  • no launch while the mecha flies faster than the build speed limit (MaxBuildSpeed, 20 m/s as in the game) or is sailing;
  • no launch with construction drones switched off, or for buildings whose item has not been handed out yet;
  • with drone priority "repair first" and something to repair, the extra launches stand aside.

Battlefield-base drones are not changed.

Building while flying fast, and in a slow game (1.1.0) 边飞边建、游戏卡时无人机照常飞

Three things stop the mecha's drones while it moves, all in the game's own code:

  • 20 m/s limit. Above 20 m/s the mecha's drones neither look for buildings nor take off nor repair. The mecha flies at up to walk speed × 2.5 (40 m/s at walk speed 16), so building stops at half speed. MaxBuildSpeed raises the limit. 机甲速度超过 20 米/秒时无人机停工,而机甲最快能飞步行速度的 2.5 倍;MaxBuildSpeed 放宽这个限制。
  • Drones slow down with the game. When the game runs below 60 logic ticks a second, every tick is longer in real time. The mecha moves by real time, but drones move a fixed 1/60 s a tick. At 22 ticks a second, drones set to 75 m/s really fly 28 m/s and fall behind the mecha. RealTimeDrones lets the mecha's drones fly by real time, up to MaxRealTimeScale times. Their speed upgrade value is not changed, so the game's abnormality check is not triggered. 游戏每秒逻辑帧不足 60 时,机甲按真实时间移动,无人机却每帧只飞 1/60 秒,于是变慢、追不上机甲;RealTimeDrones 让机甲无人机按真实时间飞,不改无人机速度数值,不会触发异常检测。
  • Drones cannot land on a moving mecha. A returning drone lands only within 0.5 m of the mecha's launch point. When the mecha moves more than that in one tick, the drone reaches the point where the mecha was a tick earlier, never closes the gap, and hovers beside it. Then every drone is out and nothing gets built. While either option above is in use, a returning drone that is within one tick of mecha movement lands. Standing still, this is the game's 0.5 m. 返航的无人机要离机甲放飞点 0.5 米以内才能收回,机甲每帧移动超过这个距离时,无人机会一直悬在旁边落不下来; 上面任一选项开着时,收回距离会随机甲速度放宽。

Measured in a running game at about 22–33 logic ticks a second, circling over a fresh paste at 36–38 m/s:

  • Before: with the limit raised and no return catch, all 132 drones hovered 3 m from the mecha, and nothing was built.
  • After: with both options and the return catch, drones flew at 75 m/s in real time and the paste was built while flying.
  • Cost: a mecha target search took 0.06 ms on average (0.27 ms at most), so searching more often while flying fast costs next to nothing.

Measured (running game, 117 drones, large paste)

vanilla with the mod
idle drones, average 8.6 (0–32) 0.1 (0–3)
launches a tick at most 1 up to 3
logic ticks a second 20.0 19.8 (no measurable cost)

How much faster building gets depends on how many drones vanilla leaves idle: with long trips almost all are out anyway (+5 % launches in this run), with short trips the gain is larger (up to +30 % when 30–40 sat idle). Once all drones are in the air, the drone count and trip time are the limit.

Config (BepInEx/config/com.github.jiesiluo.multidronelaunch.cfg)

key default
Enabled true master switch, takes effect at once
ExtraPerTick 10 how many drones on top of the game's one may leave per tick; 0 = vanilla
MaxBuildSpeed 20 (section Speed) mecha drones keep working up to this mecha speed, m/s; 20 = vanilla, 45 covers full flight speed at walk speed 16
RealTimeDrones false (section Speed) mecha drones fly by real time when the game runs below 60 logic ticks a second
MaxRealTimeScale 4 (section Speed) at most this many times faster (4 = down to 15 logic ticks a second)