glest / glest-source

Glest is a network multi-player cross-platform 3D real-time strategy (RTS) game, where you create armies of units and battle different factions.
https://glest.io
GNU General Public License v3.0
58 stars 40 forks source link

Attack commands cannot be queued #48

Closed Jammyjamjamman closed 5 years ago

Jammyjamjamman commented 6 years ago

This bug was inherited from MegaGlest, but I'm not sure it was mentioned there. If you try to queue many attacks, you get a rubberbanding glitch (where units jump back to their initial position), until the final attack is queued. if you try to queue attacks with other commands, the queue gets reset as soon as the different command is queued.

Jammyjamjamman commented 6 years ago

OK, the likely reason for the queue cancellation is the bad code on line 79 of https://github.com/ZetaGlest/zetaglest-source/blob/develop/source/glest_game/type_instances/command.cpp (I say bad because there is an instance variable defined to store a command priority, yet it uses an if statement to decide the priority later). Attacks have "lower priority" than other commands. This means it is cancelled, along with all other low priority commands if another "higher priority" command is issued.

Jammyjamjamman commented 6 years ago

I think it's more difficult because you have to re-learn default commands, but it's something you'd get used to.

There is one area where it definitely gets harder: when you're trying to retreat. I've thought of a couple of ways to fix this. One is to use "middle" click for move, or to move as soon as you press "m" (to the position of the cursor), rather than "m" + click.

andy5995 commented 6 years ago

If you try to queue many attacks, you get a rubberbanding glitch (where units jump back to their initial position), until the final attack is queued.

Yes.