Author Topic: "Strafe" sideways move  (Read 21840 times)

Offline alienfood

  • Captain
  • ***
  • Posts: 79
  • It's people!
    • View Profile
"Strafe" sideways move
« on: December 23, 2012, 05:08:41 pm »
I pushed a fairly small change that implements a "strafing" or sideways movement, as follows:

- Requires option "strafe: true" in options.cfg
- Hold down Ctrl-key when clicking
- Only strafe to adjacent tiles, in front or beside but not behind
- Large units (tanks) cannot strafe
- Strafing during a change of z not allowed

Strafing increases TU cost by +1. This seems reasonable, as usually you will have already paid the TU cost of turning to face the wall before strafing sideways into a corridor.

Graphically, the units "moonwalk" while scooting sideways. It looks neat to me.

I spent a long time trying to get backwards-strafing to work, but the units would exit through the front of the tile, teleport backwards, and enter through the back of the tile behind. I turned off strafing backwards, but eventually I think it can be done by fudging the "frame" count passed to the draw routine.

I tried very hard to follow the instructions provided by radius75, but I still ended up with the change on "master" instead of on my branch. If you can't find the changes and want them, they are very minor and I can post them here. I also tried the changes integrated into the latest Cydonia changes from Warboy, and they work just fine. I don't know why (or rather, I do know why and don't know how) to post the changes pre-integrated with the latest Cydonia work.

Offline michal

  • Commander
  • *****
  • Posts: 629
    • View Profile
Re: "Strafe" sideways move
« Reply #1 on: December 24, 2012, 01:08:37 pm »
Interesting idea :)

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: "Strafe" sideways move
« Reply #2 on: December 24, 2012, 11:19:59 pm »
we had a little discussion about this on IRC, i like the idea, and would like to expand on it a little, mostly regarding tanks.

so if ctrl+click moves a soldier without re-orienting him, how about using ctrl+rclick to re-orient the turrets on tanks and have their LOS be based on the turret rather than the chassis. that way tanks could "strafe" by turning their turrets 90 degrees perpendicular to their chassis prior to movement.

Offline alienfood

  • Captain
  • ***
  • Posts: 79
  • It's people!
    • View Profile
Re: "Strafe" sideways move
« Reply #3 on: December 25, 2012, 02:00:51 am »
I'm all for it and I think I can do it. Leave me with it for a couple of days. I will also post a fix for a bug that does not show up under the debugger, only when you start openxcom detached.

Offline Hythlodaeus

  • Colonel
  • ****
  • Posts: 276
    • View Profile
Re: "Strafe" sideways move
« Reply #4 on: December 25, 2012, 03:06:45 am »
we had a little discussion about this on IRC, i like the idea, and would like to expand on it a little, mostly regarding tanks.

so if ctrl+click moves a soldier without re-orienting him, how about using ctrl+rclick to re-orient the turrets on tanks and have their LOS be based on the turret rather than the chassis. that way tanks could "strafe" by turning their turrets 90 degrees perpendicular to their chassis prior to movement.

Regarding tanks/hwps, I believe this is a great idea, but wouldn't this imply a sprite redesign for the hwps, since their turret is not located in the middle? Also, I can sense cyberdiscs becoming a lot deadlier as a result of this, which is frankly quite an interesting perspective, in terms of challenge.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: "Strafe" sideways move
« Reply #5 on: December 25, 2012, 06:08:41 am »
Quote
Regarding tanks/hwps, I believe this is a great idea, but wouldn't this imply a sprite redesign for the hwps, since their turret is not located in the middle?
not at all, we just take the "direction" the unit is facing from the turret for LOS calculations.

Quote
Also, I can sense cyberdiscs becoming a lot deadlier as a result of this
cyberdiscs don't have turrets.

Offline alienfood

  • Captain
  • ***
  • Posts: 79
  • It's people!
    • View Profile
Re: "Strafe" sideways move
« Reply #6 on: December 25, 2012, 01:34:09 pm »
If Hythlo was referring in general to aliens strafing, the AI was not modified to be able to perform that kind of move. So it is a small advantage for the xcom faction.

Offline Hythlodaeus

  • Colonel
  • ****
  • Posts: 276
    • View Profile
Re: "Strafe" sideways move
« Reply #7 on: December 25, 2012, 01:53:52 pm »
cyberdiscs don't have turrets.

I know (duh), but don't they have to face the target in a specific direction in order to fire?

Offline alienfood

  • Captain
  • ***
  • Posts: 79
  • It's people!
    • View Profile
Re: "Strafe" sideways move
« Reply #8 on: December 25, 2012, 04:23:28 pm »
My git skills having improved, I resubmitted the changes that support the strafe move, starting from a recent branch that includes all changes through today.

I also sent in a small change to LBM file loading so that people like me who deleted them back when 20kb was a big deal can still run openxcom. ;)

Offline Chiko

  • Colonel
  • ****
  • Posts: 174
    • View Profile
Re: "Strafe" sideways move
« Reply #9 on: December 25, 2012, 07:02:56 pm »
Strafing was pretty useful in X-Com Apocalypse. I'd love to see it in the good old X-Com.

Offline papamaanbeer

  • Sergeant
  • **
  • Posts: 47
    • View Profile
    • Twitch papamaanbeer
Re: "Strafe" sideways move
« Reply #10 on: December 25, 2012, 11:51:13 pm »
i like! the strafing idea!

Moonwaliknig will be cool to, anymore dance moves we can implement ;)

Offline Mr. Quiet

  • Commander
  • *****
  • Posts: 523
  • Likes: Quiet things. Dislikes: Loud things.
    • View Profile
    • =Open_X_Com= Mods
Re: "Strafe" sideways move
« Reply #11 on: December 26, 2012, 05:25:31 pm »
I like this idea too. I just don't like pressing the Ctrl button, my picky is too long. Shift would be perfect. We'll be able to change the buttons, right?

thanks :)

Offline alienfood

  • Captain
  • ***
  • Posts: 79
  • It's people!
    • View Profile
Re: "Strafe" sideways move
« Reply #12 on: December 28, 2012, 02:41:36 pm »
Progress report: I have it implemented pending an issue with vertical movement for hover tanks. I may push some of the ready changes.

Whoever suggested this for tanks, it plays very well. Here's how it works, and there may still be time for small changes (e.g. tu cost):

- strafe: true option set
- Turret becomes the FOV
- CTRL-key, LEFT click the point you want to look at
- Turret turns, tu cost is 1 for 45-90, 2 for 135-180 (cheaper than regular turning)
- Turret stays turned as the vehicle moves, FOV will now strafe whichever way the turret is pointing. Note that the turret stays turned relative to the tank, not the compass.


Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: "Strafe" sideways move
« Reply #13 on: December 28, 2012, 02:46:26 pm »
nice.

Offline moriarty

  • Commander
  • *****
  • Posts: 1421
    • View Profile
    • Luke's OX mod site
Re: "Strafe" sideways move
« Reply #14 on: December 28, 2012, 08:40:18 pm »
is that turret direction also represented graphically?