Skip to content

Improvements to stationary unit logic - #2094

Merged
Coronia merged 6 commits into
Phobos-developers:developfrom
Starkku:feature/stationary-units-improvements
Oct 20, 2026
Merged

Coronia merged 6 commits into
Phobos-developers:developfrom
Starkku:feature/stationary-units-improvements

Conversation

@Starkku

@Starkku Starkku commented Feb 8, 2026

Copy link
Copy Markdown
Contributor
  • Extended logic e.g Speed=0 to work on InfantryTypes.
  • Speed lowered to 0 by multipliers will now prevent some of the logic from being executed (cursor, assigning destination etc. works but not actual movement).

Stationary units

  • Infantry & vehicles with Speed=0 or those that are prevented from moving on their cell by MovementRestrictedTo are now truly stationary will not attempt to move if issued movement commands. Should not be used on trainable/buildable units as they become stuck in factory. Following behaviours apply:
    • Cannot retaliate if target is beyond their weapon range.
    • Cannot acquire units outside their weapon range on Area Guard mission.
    • Hunt mission is reassigned to Guard.
    • Units rendered stationary by speed multipliers instead of intrinsic properties of TechnoType will respond to cursor actions e.g assigning destination but will not move while the multiplier is in effect.

@github-actions

github-actions Bot commented Feb 8, 2026 •

Copy link
Copy Markdown

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@Starkku
Starkku force-pushed the feature/stationary-units-improvements branch 3 times, most recently from 6c9e854 to c32138f Compare February 8, 2026 19:52
Comment thread src/Ext/Techno/Hooks.DisallowMoving.cpp Outdated
@Coronia

Coronia commented Feb 9, 2026

Copy link
Copy Markdown
Contributor

object info dump showed that these stationary units will sometime enter 'Move' mission for a short moment, then switch back to 'Guard' quickly without actually moving. Not sure if it's a desired behavior

@Refailure

Copy link
Copy Markdown

1214
After applying an AttachEffect with SpeedMultiplier=0 to the target unit, the target unit can still rotate its hull once before it stops rotating the hull and only rotates the turret. Hover units can always rotate their hull.
1215
And units that have performed the single rotation cannot load passengers.

@Starkku
Starkku force-pushed the feature/stationary-units-improvements branch from c32138f to 7edb6a9 Compare February 24, 2026 18:23
@Starkku
Starkku force-pushed the feature/stationary-units-improvements branch from 6d8ae09 to 083274f Compare April 10, 2026 18:58
@Starkku
Starkku force-pushed the feature/stationary-units-improvements branch from 083274f to 6239360 Compare May 8, 2026 13:10
@Starkku
Starkku force-pushed the feature/stationary-units-improvements branch from 6239360 to d9f2179 Compare May 16, 2026 16:51
@Starkku
Starkku force-pushed the feature/stationary-units-improvements branch 2 times, most recently from 8f8159d to d0d3b54 Compare July 30, 2026 11:54
@fagonghaiwo

Copy link
Copy Markdown
ee455ddb8d29529fb5544790238c3a48 turret still rotating

@Starkku

Starkku commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

This isn't supposed to prevent turret from rotating.

Comment thread src/Ext/Techno/Hooks.cpp Outdated
@fagonghaiwo

Copy link
Copy Markdown
8cc24f424c2aa58491df17e2001b6ef8

aircraft can fly

76c099b471c91b7fb5c23860d33212e7

rotat when attack

@Starkku

Starkku commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor Author

aircraft can fly

Had you read the documentation you would realize this isn't supposed to work for AircraftTypes to begin with.

rotat when attack

This does not currently prevent rotation at all, actually. Maybe it should on turretless vehicles but the documentation so far only mentions no movement, nothing about rotating on place. Although if you ask me modifiers to rotation or its speed should perhaps be its own feature.

@Starkku
Starkku force-pushed the feature/stationary-units-improvements branch from d0d3b54 to 31f734f Compare September 2, 2026 14:08
@Starkku

Starkku commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author
  • Moved the temporary immobilization checks to after locomotor processing - there wasn't noticeable impact on functionality and presumably there is a minor performance benefit in edge cases where processing ceases early.
  • Fixed an oversight that caused already moving infantry to not be fully immobilized by temporary speed multipliers. It is possible that there may be edge case issues stemming from this, however unlikely. I already checked the most obvious ones like amphibious infantry functioning correctly.

Comment thread src/Ext/Foot/Body.cpp
@Starkku
Starkku force-pushed the feature/stationary-units-improvements branch from 31f734f to 2942c75 Compare October 15, 2026 10:13
@Coronia
Coronia merged commit 154a38f into Phobos-developers:develop Oct 20, 2026
7 checks passed
@Starkku
Starkku deleted the feature/stationary-units-improvements branch October 21, 2026 11:05
DeathFishAtEase added a commit to DeathFishAtEase/Phobos that referenced this pull request Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants