How to enable couched lance aiming: lets you aim a couched lance sideways!

Users who are viewing this thread

Aethelred

Sergeant Knight at Arms
Yeah, it does. Tweaking the animations file has become a hobby of mine lately, and I had the crazy idea that it might be possible to allow couched lances to be aimed sideways by editing the animation flags. I didn't really think it would be as easy as that, but to my surprise, it is. All I needed to do was add the flag acf_rotate_body to the couched lance animation (lancer_ride_4), and it functions perfectly. You can now rotate from side to side while couching a lance, and the targetting works perfectly, with the disclaimer that couch attacks to the sides are more powerful than they probably should be. It'd be good if I could find a way to narrow the field of view more realistically, in real life doing a couched lance charge into a target more than 30 degrees to your left or right would probably be rather dangerous for your spine and your chances of staying in the saddle (I base that on information I read from some American jousting group, someone on this forum posted a link to it). Another small issue is being able to couch through your horse's head; looks a little silly, but... meh, as with the aiming too far to the sides, just don't do it if it bothers you. :wink: Other than that, there are no major problems as far as I've seen, although I haven't tested it for long and only in small battles. No idea if the AI uses it properly; in my experience they only seem to do couched attacks by accident these days, and none of the Vaegir horsemen deserters I was testing it against used it once as far as I saw. Here's a screenshot for the skeptics, I'd have made a video but I couldn't be bothered:
couchedlance.png

So, how to enable this for yourselves? It's pretty easy, all you need to do is edit one file. Open the actions.txt file in whatever mod folder you want to use this in, and look for the animation called lancer_ride_4. The first line of the entry will look like this: 
lancer_ride_4 1677725953  1
You want to change the number 1677725953 to 1677734145. That's all, just remember to save the file after you make the change. You'll now be able to aim couched lances in M&B - like all animation changes it works with current save games. It's also compatible with any mod that uses the custom animations pack, since that pack doesn't edit the couched lance animation.

For mod builders who want to make the change in the module_animations.py file, all you need to do is find the lancer_ride_4 entry and add acf_rotate_body to the list of flags that follows the animation name.

Anyway, post any problems found here, and hopefully some clever person can find a way to limit the field of view more realistically.
 
There is no such thing as couching sideways. The whole point if couching is getting the combined momentum of rider and horse on the tip of the lance, and the only way a rider can direct this momentum is have the lance right on movement vector. Otherwise you will break your arm, get your lance broken and do not inflict damage. Try ride a bycicle holding a stick sideways and try to break something w/o swinging, but just holding a stick
 
GetAssista said:
There is no such thing as couching sideways. The whole point if couching is getting the combined momentum of rider and horse on the tip of the lance, and the only way a rider can direct this momentum is have the lance right on movement vector. Otherwise you will break your arm, get your lance broken and do not inflict damage. Try ride a bycicle holding a stick sideways and try to break something w/o swinging, but just holding a stick

I doubt realism is the point of this add-on. It has many other uses than simply old-school lancing. I find even for old-school lancing it's more convenient and more realistic because you can actually aim, a crucial part of jousting.
 
According to the analyzer I wrote the flag you changed was acf_rotate_body.  Try adding acf_enforce_rightside to the bitmask -- the integer value of that one is 512, so the value you want is 1677734657. See how that works.
 
Naah I think that this is cool. You could edit so that the rotation while crouching the lance is more limited. But it's cool.  :)
 
Nice find! So acf_rotate_body lets you rotate the upper torso with the mouse in any animation!
 
I used this with my jousting tournament mod, though (with the Module System) when I added that flag, I couldn't rotate fully.  Strange.  Maybe I had that other flag on too (enforce_rightside), which would mean it would do what you want.  I'd have to go back and check.

Say, if you are becoming knowledgeable with the animations, do you think you could tell me which animation call is for thrusting the lance when on horseback?  That's one thing holding back my release.
 
Sadly, M&B uses the thrust_onehanded_lance animations for both horseback and foot lance thrusts. It's a shame, because it'd be nice if they could be different. Guess that doesn't matter for your jousting mod, though.

Adding acf_enforce_rightside doesn't change anything it seems - rotate body overrides it. I also tried it with rightside on its own, and I could no longer rotate at all. Jik, if you were able to get a more limited field of rotation, it'd be great if you could work out how you managed it. I can't see any other flags that would work.

To those who say a couched lance shouldn't be able to be rotated at all, well... Read this article. It's illogical to think you can only couch a lance at one specific angle... and the M&B angle isn't a realistic one anyway.
 
Aethelred said:
Sadly, M&B uses the thrust_onehanded_lance animations for both horseback and foot lance thrusts. It's a shame, because it'd be nice if they could be different. Guess that doesn't matter for your jousting mod, though.

Adding acf_enforce_rightside doesn't change anything it seems - rotate body overrides it. I also tried it with rightside on its own, and I could no longer rotate at all. Jik, if you were able to get a more limited field of rotation, it'd be great if you could work out how you managed it. I can't see any other flags that would work.

To those who say a couched lance shouldn't be able to be rotated at all, well... Read this article. It's illogical to think you can only couch a lance at one specific angle... and the M&B angle isn't a realistic one anyway.

Maybe it has to do with the order that the flags are in?  I just tested my jousting and again it only shifted so much:
["ready_joust",  acf_enforce_lowerbody|acf_parallels_for_look_slope|acf_anim_length(100)|acf_rotate_body|acf_synch_with_horse,
  [0.5, "anim_human", horse_move+610, horse_move+650, arf_cyclic | arf_blend_in_128], ],

Of course, I'm using the MS, not tweaking...

BTW, what is the call for using the thrust on horseback.  If I use the lance thrust define in the animations, the agent moves to stand on the ground (through the horse) when the thrust is released.  I still can't find out how to fix that, though I've been told the change is made with flags (and the same with cheering while on horseback).
 
Aethelred said:
To those who say a couched lance shouldn't be able to be rotated at all, well... Read this article. It's illogical to think you can only couch a lance at one specific angle... and the M&B angle isn't a realistic one anyway.
Article is about stirrups, not basic impulse and momentum physics. And jousting is about sport, not combat. People strike slightly across a course of movement in jousting because they agreed to have shields (in inner hands) inbetween them for added safety. Best angle is aligned with course vector, +-5-10 grad away is fine, more and you are going to seriously unbalance yourself on impact.

Well, I read an article. Now would you please go ride a bicycle as I suggested? ;)
 
Aethelred said:
Maybe it has to do with the order that the flags are in?  I just tested my jousting and again it only shifted so much:
["ready_joust",  acf_enforce_lowerbody|acf_parallels_for_look_slope|acf_anim_length(100)|acf_rotate_body|acf_synch_with_horse,
  [0.5, "anim_human", horse_move+610, horse_move+650, arf_cyclic | arf_blend_in_128], ],

Order won't make a difference. That | between the flags is a Python logical OR operator, meaning that if you had a flag with a bitmask value of "0x2", which in binary is "010", and a flag that had a bitmask value of "0x4", which in binary is "100", the OR operator lines up the ones and returns a binary number that consists of a 1 if either of the two is a one, and a 0 if both are zeros. Example:

010
100
___
110

So what is happening is the flags are being lined up and combined with the logical OR operator. Changing the order of the flags won't make a difference.

What happens if you turn off acf_synch_with_horse? You can use bow and arrow on a horse and the animation in restricted to the right side, so maybe take a look at that animation in the module system.
 
It's actually already limited on the right side, to more or less the same angle as the bow is on horseback. Changing the order didn't fix anything, neither does removing synch_with_horse - my guess is that one's just a timing thing.

Jik, exactly how is jousting on your mod limited? Can you only aim about 30 degrees to the left and right? Can you think of anything different in the way you call the animation that would cause that? As for your problem, I don't really know, since I've no idea how to get the game to actually call custom animations. As far as I can see, none of the attack animations in module_animations.py have anything special that makes them work on horseback. If you just copied the flags for thrust_one_handed_lance, I don't see why it doesn't work. Have you tried just using the same name as the default animation (overwriting it, I mean)? I can only think there's an issue with the item properties, since they use a itcf_thrust_onehanded_lance_horseback capability tag. I doubt that's the problem, that flag doesn't seem to do anything; I tried replicating your problem by removing that property from items, but lances still worked fine.

GetAssista said:
Aethelred said:
To those who say a couched lance shouldn't be able to be rotated at all, well... Read this article. It's illogical to think you can only couch a lance at one specific angle... and the M&B angle isn't a realistic one anyway.
Article is about stirrups, not basic impulse and momentum physics. And jousting is about sport, not combat. People strike slightly across a course of movement in jousting because they agreed to have shields (in inner hands) inbetween them for added safety. Best angle is aligned with course vector, +-5-10 grad away is fine, more and you are going to seriously unbalance yourself on impact.

Well, I read an article. Now would you please go ride a bicycle as I suggested? ;)

Not until you try actually reading the article. You missed this part: "The "field of engagement" for the couched lance is approximately 20 to 30 degrees on either side of the horse's head." Read the whole thing, it's not just about jousting at all, and it refers to physics. I'm aware that the wide range enabled with this tweak isn't fully realistic, I already said that in the first post. It is, however, better than only being able to aim a couched lance by turning your horse, and it's only the left side range that's too wide. Lancing is already unrealistic in that your spear never breaks and you never get unhorsed by the force of a blow.
 
Back
Top Bottom