OpenXcom Forum
Contributions => Programming => Topic started by: alienfood 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.
-
Interesting idea :)
-
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.
-
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.
-
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.
-
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.
Also, I can sense cyberdiscs becoming a lot deadlier as a result of this
cyberdiscs don't have turrets.
-
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.
-
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?
-
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. ;)
-
Strafing was pretty useful in X-Com Apocalypse. I'd love to see it in the good old X-Com.
-
i like! the strafing idea!
Moonwaliknig will be cool to, anymore dance moves we can implement ;)
-
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 :)
-
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.
-
nice.
-
is that turret direction also represented graphically?
-
I pushed the changes, described above.
The request for shift-click as an option is reasonable, this will get done eventually. I used SDL to detect key states, so it ought to be cross-platform. It would be nice to hear from somebody that it works on a non-win platform. Turret state is rendered, this has been in there for a while I think.
I have not done much testing with path preview. If you have trouble, turn off path preview and I'll issue a patch.
I could have done a much better job with the soldier-strafe implementation, I will go back and code-clean that section using the learning I acquired during the last week. My thanks to Sup and Warb who waded through and cancelled some of my previous garbage.
-
To be fair, can aliens move in this way?
-
i can say - no
-
going to try to add this today, along with a "run" behaviour with shift+click that uses less TUs but more energy (and cannot be used in conjunction with strafe) as suggested by pmprog on IRC.
-
btw I've merged this locally several times, and would be happy to reopen two or three small branches to incorporate the changes a piece at a time.
-
ok, this seems to be working just fine, as is running, my only issue is that the "path preview" is now inaccurate when running.
-
going to try to add this today, along with a "run" behaviour with shift+click that uses less TUs but more energy (and cannot be used in conjunction with strafe) as suggested by pmprog on IRC.
A little suggestion regarding this: running should temporarily reduce the soldier's FOV, so enemies are harder to spot mid-run (which makes sense since you're not exactly looking around when sprinting). On the other hand, perhaps enemies could suffer a little aim penalty when reaction firing against running soldiers.
-
Actually moving objects are more noticeable. Alot of animals sees moving objects alot better, and some of them sees ONLY moving objects.
-
I was talking about the opposite. When running you're less likely to spot something that's still.
-
Of course moving units have less chances to spot something, even not still.
-
What about diagonal "strafe"? right/forward,left/forward, right/backward, left/backward?
-
whoops, i forgot to push this. :-[
this has now been added :D
thank you alienfood for the contribution!
-
Of course moving units have less chances to spot something, even not still.
Are the running units harder to hit by reaction fire? Are they easier to react fire against?
EDIT: Typo