Ticket #619 (closed enhancement: fixed)

Opened 3 years ago

Last modified 10 months ago

Improve Gate and Wall System

Reported by: k776 Owned by:
Priority: Must Have Milestone: Alpha 11
Component: Core engine Keywords: gate animation sound
Cc:

Description (last modified by historic_bruno) (diff)

  • Gates that have animation to open and close, along with sounds to accompany it
  • Gates that have obstruction zones over the towers only, not the gate part
  • Gates that can be locked, so nothing gets in or out
  • Allow Walls, Gates, and Towers to overlap, so that complex wall systems, that link together, are able to be built.

Attachments

gate-multiselect.patch (5.5 KB) - added by Deiz 10 months ago.

Change History

comment:1 Changed 3 years ago by k776

  • Description modified (diff)
  • Summary changed from Improve Gate System to Improve Gate and Wall System

comment:2 Changed 3 years ago by k776

  • Milestone changed from Alpha 3 to Alpha 4

comment:3 Changed 2 years ago by k776

  • Owner Philip deleted

comment:4 Changed 2 years ago by k776

  • Milestone changed from Alpha 4 to Alpha 5

comment:5 Changed 2 years ago by k776

  • Milestone changed from Alpha 5 to Alpha 6

comment:6 Changed 2 years ago by k776

  • Milestone changed from Alpha 6 to Alpha 7

comment:7 Changed 23 months ago by k776

  • Milestone changed from Alpha 7 to Backlog

comment:8 Changed 14 months ago by FeXoR

Plz see Ticket #1288 that includes (for example) overlapping point to point wall placement for random maps.

comment:9 Changed 11 months ago by Badmadblacksad

In 12081:

Gates. Adds UI buttons, replaces wall section with a gate, defines and create obstruction shapes, detects friendly units and eventually disable door's "block movement" flag, allows us to lock / unlock the door by disabling "block pathfinding" flag. Needs icons, play sound, animations. Fixes #1385, refs #619.

comment:10 Changed 11 months ago by k776

  • Milestone changed from Backlog to Alpha 11

comment:11 follow-up: ↓ 12 Changed 11 months ago by historic_bruno

Few comments on r12081, trying not to duplicate what's been said already in IRC:

  • I notice that locking the gate instantly adds the obstruction, even if a unit is directly under the gate. So I think locking should only take effect on the next gate close, after all units have left the Radius (I think it must be all units instead of just allies, or else an enemy unit passing the gate while it was opened, will be magically trapped inside the gate when it closes).
  • Change of ownership might have similar problems since it forces the gate closed, not sure if changing ownership (aka capturing) of gates during the game will ever occur in practice, so we may not have to worry about that. But if it's easy to fix, why not? :)
  • A related point: it seems gates will instantly open or close, so we should add timing variables in the template (when the animations are added). We could have gates that work at different rates, maybe a tech that makes them work faster, or upgrades to more HP but slower working, etc. :)
  • GuiInterface test is broken, usually a trivial fix

Minor aesthetic / cleanup issues:

  • Radius is kind of a confusing term for the gate's range, radius of what? :) Any better names, maybe PassRange?
  • The behavior of SetDisableBlockMovementPathfinding() is confusing now. It seems rather than setting flags directly, it toggles them, which doesn't match up with the name of the function or its parameters. At a minimum it needs a comment in ICmpObstruction.h to explain what it does, but is the toggling the best design? (I haven't looked into it enough to argue one way or another) I wouldn't mind the JS call sites including comments as well ;)

comment:12 in reply to: ↑ 11 Changed 11 months ago by historic_bruno

Replying to historic_bruno:

  • A related point: it seems gates will instantly open or close, so we should add timing variables in the template (when the animations are added). We could have gates that work at different rates, maybe a tech that makes them work faster, or upgrades to more HP but slower working, etc. :)

I'm not sure this is feasible. There are some pathfinding issues when there's a delay between opening and closing, a unit approaching the gate will not wait of course but will recalculate its path to go around a gate if it's blocking them.

For now we could have instant open/close logic, no reason to add so much complication.

comment:13 Changed 11 months ago by historic_bruno

I've been looking into adding animations, I already scrapped the idea of delayed opening/closing.

Now I'm finding a problem with using the gate transition animations. It's possible using CCmpVisualActor::SelectAnimation to play an animation once, and it conveniently stops on the last frame. While we serialize some animation-related state (see r10453), they will be replayed after deserialization, which has an adverse affect for single play animations. All gates would appear to fully open or close after loading a saved game (their actual state is unchanged) :(

Possible solution is to make single play animations skip directly to the last frame when deserializing. I think this would be least disruptive in most cases (it seems like what should be happening anyway?) The transitions look so good, it would be a shame not to use them.

comment:14 Changed 11 months ago by ben

In 12103:

Adds animation and sound support to wall gates. Uses temporary sounds for now. Adds new animation choices to actor viewer/editor. Refs #619

comment:15 Changed 11 months ago by historic_bruno

  • Description modified (diff)

OK animation and sound support is added. I haven't made the above changes to CmpVisualActor yet, pending discussion, that leaves a few animation bugs.

I found another case that needs a different solution anyway: if units are right on the edge of the gate's range, they might walk in and out of range quickly, causing the animations to start and stop abruptly which looks ugly. In this case, it would be useful to "reverse" the direction of the animation instead of starting a new one.

Related issue: Pureon mentioned it would be helpful for ship sails to have finer control of animations (particularly direction and speed). The whole system has other shortcomings, so it needs further discussion.

comment:16 Changed 10 months ago by ben

In 12139:

Adds gate conversion to palisades and siege walls. Fixes bug that all player entities in a selection could be converted to gates. Cleans up templates slightly. Refs #619

comment:17 Changed 10 months ago by Deiz

Going to re-use this ticket for some related fixes:

Each unique type of wall that's selected gets its own 'convert to gate' button. The 'convert to gate' icon is now the gate's, if it has one. Hopefully an artist can make a wooden gate icon so stone vs wood gate icons are distinct. gate_closed.png is still used as a fallback.

I didn't want to put the ugly template string hack into the simulation code, so input.js now filters the selection and will only send a wall-to-gate command if the selected wall's gate template matches the one we're trying to convert to.

Lastly, I've explicitly tracked whether the GUI's right panel has been filled, so that buildables/trainables are shown if possible, but never over top a 'dominant' type (e.g. trainables, trading, gate).

Changed 10 months ago by Deiz

comment:18 Changed 10 months ago by ben

In 12163:

Wall and gate selection usability improvements by Deiz/F00. Refs #619.
Fixes bug where selecting multiple wall types could convert to mismatching gates.

comment:19 Changed 10 months ago by gudo

Is there any way to attach child tickets? Cause this one has three: #1531 #1452 #1529

comment:20 Changed 10 months ago by k776

  • Priority changed from Should Have to Must Have
  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.