Commit Graph

64 Commits

Author SHA1 Message Date
Paul Chote
2080c72ab9 Define plumbing to pass initial target positions to inner move activities. 2019-01-26 22:53:46 +00:00
Paul Chote
b2d960ec19 Pass target line color to inner move activities. 2019-01-26 22:53:46 +00:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
Andre Mohren
b1a44086a0 Removed unused using directives. 2018-11-17 17:23:22 +00:00
Chris Forbes
dcf93203ea Get rid of unit pathing delay completely 2018-07-26 13:19:31 +01:00
reaperrr
6984c0ec10 Add AlwaysConsiderTurnAsMove plumbing to Mobile
Can be used to make walker units like the TS mechs display move animations while turning on the spot.
2018-07-19 22:09:43 +02:00
reaperrr
4c239d4ebc Set Mobile.IsMoving to "true" if queueing a turn that takes only a single tick
At the end of L-turns, actors often end up with an internal facing not 100% matching the direction of the next cell on their path.
As a result, if they haven't reached their destination yet, Move queues a quick Turn as ChildActivity, which previously was not considered as IsMoving.
However, we don't want those mini-turns to interrupt move animations, so we now consider them a move as well. Additionally, to avoid any issues, we make these mini-turns non-interruptible, just like the MovePart activities already are.
2018-07-01 15:33:30 +01:00
reaperrr
96377a99c4 Fix losing a tick when next Move.ChildActivity is Turn
While the first tick of the MoveFirstHalf child would run at the parent Move tick (see 2nd-to-last line in Move.Tick), this was not the case for Turn.
As a result, this Move tick would get wasted if a Turn was necessary, which at least contibuted to that visible jerk at the end of each L-turn (actors usually don't have the exact facing needed for the next move at the end of an L-turn).
2018-07-01 15:33:30 +01:00
reaperrr
5364515004 Don't pass movement class via IsPassable directly
Let IsPassable get that info from the locomotor instead.
2018-05-03 10:49:21 +02:00
reaperrr
81343926b6 Split Locomotor trait from Mobile
Add GrantConditionOn*Layer traits

This allows to
- drop some booleans from Locomotor
- drop a good part of the subterranean- and jumpjet-specific code/hacks from Mobile
- grant more than 1 condition per layer type (via multiple traits)
- easily add more traits of this kind for other layers
2018-05-03 10:49:21 +02:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Forcecore
d49c98ce18 Move activity implementation now uses ChildActivity 2017-11-12 19:46:05 +01:00
Paul Chote
1376ad674e Remove Player.CanViewActor and .CanTargetActor. 2017-11-03 09:56:00 +01:00
Paul Chote
e3212d1e64 Move the IMove interface to Mods.Common. 2017-09-10 18:36:39 +02:00
Paul Chote
4e493f265f Revert TicksBeforePathing move from Mobile to Move.
This partially reverts commit 11c8cda0c38ad0ac71c58557d34480925307cebd.
2017-08-13 13:31:58 +02:00
reaperrr
86ab6e7ed3 Fix MoveWithinRange subcell consideration 2017-07-15 17:31:25 +02:00
Paul Chote
4040863707 Fix queued move activities. 2017-06-18 20:55:50 +02:00
rob-v
fb1d8d780f Fix Service Depot Rally point path finding (+rename ignoredActor) 2017-05-06 19:49:40 +02:00
Oliver Brakmann
f9951f76ca Allow cancelling an activity without aborting the entire queue 2017-04-30 19:07:50 +01:00
Paul Chote
0b0f8bc51e Require cancelled move orders to exit tunnels before completion. 2017-04-17 22:34:21 +01:00
Paul Chote
22fad046a0 Fix units warping to 0,0 when doing a 180 degree turn. 2017-01-29 18:58:35 +00:00
Paul Chote
572c1cb89f Implement subterranean units. 2017-01-29 18:58:33 +00:00
Paul Chote
2bd5a392d1 Add plumbing for custom movement layers. 2017-01-29 18:58:33 +00:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
Oliver Brakmann
2c66ee8c13 Add native support for uninterruptible activities
This pattern occurs a few times throughout the code, so it makes sense to bake it into the Activity class itself.
2016-10-31 18:46:27 +01:00
Paul Chote
7ffdd53abb Disable smooth turning for 180 degree turns. 2016-08-26 20:15:55 +01:00
Matthias Mailänder
f5d57e361a Merge pull request #11788 from pchote/fix-smooth-moves
Make turning-while-moving actors follow curved paths.
2016-08-19 22:11:28 +02:00
Paul Chote
03e2fa5d55 Lerp turning-while-moving mobile actors along an arc. 2016-08-07 19:53:38 +01:00
Paul Chote
bb0fda41d2 Check terrain cost when testing pathable cells. 2016-08-06 19:01:04 +01:00
Paul Chote
30dcbeb873 Remove legacy Move constructor. 2016-06-25 16:29:47 +01:00
reaperrr
099c44f6f9 Remove ActorExtensionsForMove
And use IMove.IsMoving instead.
2016-06-04 16:34:47 +02:00
Paul Chote
e79fbe1bb9 Reference SubCells directly from MapGrid. 2016-03-16 18:57:07 +00:00
Paul Chote
602acabe47 Remove World.TileSet. 2016-03-12 19:47:07 +00:00
Paul Chote
e71225496b Clarify GPL version. 2016-02-21 16:30:48 +00:00
Paul Chote
b396965fd9 Update licence header year. 2016-02-21 16:27:31 +00:00
teees
65e1e301f4 Added Gates
FIXUP: account for full gate footprint when updating neighbours.

FIXUP: gate-wall connection adjacency yaml.
2016-01-25 09:14:00 +01:00
Paul Chote
0039a2bdbf Split out an ActivityUtils class. 2016-01-19 23:34:13 +00:00
RoosterDragon
8e89a6a696 Simplify names, remove unused usings, remove redundant casts. 2016-01-17 21:35:36 +00:00
Oliver Brakmann
8c8e29e2fa Merge pull request #9802 from RoosterDragon/move-min-range
Fix MoveWithinRange not moving far enough for min range checks
2015-12-06 17:11:22 +01:00
atlimit8
c827dbe183 Replace IDisableMove with upgradability 2015-12-04 19:26:49 -06:00
atlimit8
0fc04b7a4a Make Mobile upgradable 2015-12-04 19:22:23 -06:00
RoosterDragon
26d7d59c1a Fix MoveWithinRange not moving far enough for min range checks.
MoveWithinRange was only moving the unit far enough away so the center of the target was above the minimum distance. However, the min range checks in the attack code require all positions on the target to be above the minimum distance. For large targets (e.g. buildings) this means some of the target was still too close, and the unit would get stuck in a loop.

Now MoveWithinRange uses the same range checks in order to ensure units are moved the correct distances.
2015-10-29 22:59:20 +00:00
Matija Hustić
d94c645046 First step in the attack mechanism's refactor.
Enabled firing multiple armaments at a target simultaneously.
Each armament defines own cursor for targeting.
The force attack modifier influences armament choice for target.
Autotargeting modified to handle firing multiple armaments simultaneously.
As a consequence, healers (medics) no longer require separate Heal
activity and AttackMedic and AutoHeal traits.
2015-10-06 01:46:55 +02:00
atlimit8
8162fa27ab Add ActorInfo.HasTraitInfo<T>() requiring ITraitInfo types 2015-09-19 09:49:24 -05:00
atlimit8
85fab45451 Remove Actor.HasTrait<T>() 2015-09-19 09:49:23 -05:00
RoosterDragon
519be4374c Fixed pooling of layers used for pathfinding.
The previous implementation:
- Was failing to dispose of pooled layers.
- Was using a finalizer to allow undisposed layers to be reused.

This means all pooled layers are kept alive indefinitely until the map changes. If the finalizer is slow for any reason then the pathfiinder will allocate new layers when the pool runs out. Since these new layers are eventually stuffed back into the pool when the finalizer does run, this can theoretically leak unbounded memory until the pool goes out of scope. In practice it would leak tens of megabytes.

The new implementation ensures layers are disposed and pooled correctly to allow proper memory reuse. It also introduces some safeguards against memory leaks:
- A cap is set on the number of pooled layers. If more concurrent layers are needed than this, then the excess layers will not be pooled but instead be allowed to be garbage collected.
- No finalizer. An implementation that fails to call dispose simply allows the layer to be garbage collected instead.
2015-09-16 21:25:46 +01:00
Pavel Penev
cdedfe6931 Don't get stuck in deployed mode because of an impossible move order 2015-09-01 20:19:29 +03:00
Matthias Mailänder
56e9bcd96e rename RangeSquard to LengthSquared 2015-07-09 21:16:01 +02:00
Matthias Mailänder
413baf9d8b rename WDist.Range to WDist.Length 2015-07-09 10:55:38 +02:00
Matthias Mailänder
7447e0bf93 rename WRange to WDist 2015-07-09 10:55:38 +02:00