Space Engineers

Space Engineers

Example Hand Weapons
Rotating Engineer issue
(Putting this here because it doesn't fit in a comment.)

Hello Chipstix, I came here because of your advice on how to future-proof the Engineer's Defense Kit a bit more by reverse-engineering this example mod.
I have currently been able to get the animations to work using just the renamed 2 or 3 statemachines, thank you for brining this to my attention. However, I ran into an issue that also seems to be present in this example.

When the engineer holds a weapon in third person, their legs rotate about 30 degrees clockwise, yet their torso does not. That's just part of the vanilla animation.
When this mod or mine is loaded, this rotation is increased by another 30 degrees. When they are both loaded... well... they stack. In other words, when both this and my mod are loaded, the engineer's feet are 90 degrees turned from where you are aiming, and your gun 60 degrees.
This looks pretty weird, especially when using the jetpack. Some of the effect bleeds through to the vanilla weapons as well.
This was not the case with my 'overwrite all' implementation, so we're still missing something here or accidentally do whatever causes that rotation again while the game already does that itself.

Additionally, I have noticed the female engineer turning the weapon far to her right when standing still in first person, also causing a strange looking firing angle. I fixed that for my mod somehow by opening the female astronaut animation controller, (going to lines 6570 and 6579 of yours,) and changing [To="RifleGunHipMovement"] and [To="DrillHipMovement"] to [To="RifleIdle"] and [To="DrillIdle"] respectively.

UPDATE:
I managed to remove half of the effect by deleting the RotateHipRifle node from the copied hip statemachine. So far the game also doesn't crap itself without it.
Last edited by Unsaved Changes; 25 Apr, 2022 @ 7:31am
< >
Showing 1-15 of 17 comments
Chipstix213  [developer] 25 Apr, 2022 @ 7:29am 
Ooof editing the animation controller as text is not nice. You can get a real time visual from using the vrage animation controller tool.

I will try swapping out that transition and see how it looks.

I hadn't noticed the feet rotating I wonder why that could be
Unsaved Changes 25 Apr, 2022 @ 7:38am 
I was hoping a tool or something existed for that. While fixing the defense kit I was already commending the giant modding community for its patience if there wasn't anything to make it less laborious.
I tried removing the RotateHipRifle from the female engineer's controller, too, and it seems to completely fix the rotation for her. Or, well, it's reduced such that it's almost invisible, if like the male engineer it only reduces it. Haven't tested if it gets wacky still if I'd stack another mod augmented to remove that node.

EDIT: Now I have, I was a little sneaky and just edited the downloaded files of yours for testing purposes. She's still standing 'correctly'. The male engineer still has quite a deviation with the two mods loaded, but nowhere near as bad.
Naturally I just try stuff and see what sticks now. If removing that node is awfully destructive in a way I am not seeing, do let me know.
Last edited by Unsaved Changes; 25 Apr, 2022 @ 7:54am
Unsaved Changes 25 Apr, 2022 @ 7:46am 
Actually, I overlayed two images, one when only mine and one when both mods are loaded, and removing that node apparently made it so the effect no longer stacks. After I also removed the node from yours, there is no visible difference anymore between when one or both mods are loaded.

Also, the male engineer's rotation isn't as bad as my wording probably made it seem. I think he's rotated about 15 degrees too far clockwise, which is somewhat acceptable.
Last edited by Unsaved Changes; 25 Apr, 2022 @ 7:51am
Unsaved Changes 25 Apr, 2022 @ 7:57am 
It is probably also best to remove the RotateHipDrill node as well, since this seems to be responsible for the same effect on, you guessed it, drills.
Chipstix213  [developer] 25 Apr, 2022 @ 9:54am 
I had planned to go through and see how many nodes it took to break it. Sounds like you can do quite a few
Chipstix213  [developer] 25 Apr, 2022 @ 9:55am 
Thanks for the tips and I commend you for your patience. I'm the same user on discord if you want more real-time communication
Unsaved Changes 26 Apr, 2022 @ 3:31am 
I'd need a #number for Discord too, I think. :P
In any case, I think I found it. In the male engineer's file I've been commenting out a load of things I didn't need, like the pistol animations etc, going through the file one node at a time and leaving notes on what they do if disabled.

And I think I found what causes the rotation. I commented out this piece of code and he stopped turning...! or, well, he turns as little as the female engineer does now. It's located just above the large 'RifleGunIdle' node within the code.
<Node> <Name>Any</Name> <AnimationTree> <EdPos> <X>-139</X> <Y>-2</Y> </EdPos> <EventNames /> <EventTimes /> </AnimationTree> <EdPos> <X>-1391</X> <Y>133</Y> </EdPos> <Type>AnyExceptTarget</Type> <Variables /> </Node> <Node> <Name>Equip</Name> <AnimationTree> <EdPos> <X>0</X> <Y>0</Y> </EdPos> <EventNames /> <EventTimes /> <Child xsi:type="MyObjectBuilder_AnimationTreeNodeTrack"> <EdPos> <X>235</X> <Y>-15</Y> </EdPos> <EventNames /> <EventTimes /> <Loop>true</Loop> <Speed>1</Speed> <Interpolate>true</Interpolate> </Child> </AnimationTree> <EdPos> <X>-861</X> <Y>-229</Y> </EdPos> <Type>PassThrough</Type> <Variables /> </Node>
It sounds super risky given it holds two pretty often-referred to nodes, but I guess that can also be exactly why it interfered...?

I now know there is a tool for this, yes, but given my built-up experience reading this too-many-cooks spaghet of XML, I figured by now it'd take me less time to continue like this than to download and learn the animation program. Though if I need to conduct more maintenance in the future, I'll likely use it.

I'm very tempted not to touch anything anymore and just upload this update, since now I'm satisfied, but I really should clean up the female engineer's code as much now... I'll probably leave most scrapped code in as comments just in case, though. Yes, I could leave a different version on my desktop, but like this that code is also backed up on the cloud and all I have to do is just download my own mod to get all the dev-stuff if I ever lose the files.

At any rate, many thanks again for putting me on the right track to getting this animation stuff cleaned up. Let's hope the future shows stability to make it worth the time. :)
Chipstix213  [developer] 26 Apr, 2022 @ 5:34am 
doh! Chipstix213#7332

you are removing the entry note to the state machine I'm not sure that's the best approach.

ill give this a look, though likely after the next update
Unsaved Changes 29 Apr, 2022 @ 2:36am 
Well, it seems the new update proved you right. Now the animations broke again... putting these lines back reintroduces the rotation, but fixes the animations at least.
Also the <node> in the code I pasted wasn't the first node of a statemachine, Steam just decided to line that one out all the way to the left because reasons.
I'm going to look for another way to go about this.
Last edited by Unsaved Changes; 29 Apr, 2022 @ 3:28am
Chipstix213  [developer] 29 Apr, 2022 @ 3:34am 
interesting, i'm going to try a stand alone node solution to see if i can replicate whats happening without taking the default controller as a start
Unsaved Changes 29 Apr, 2022 @ 3:47am 
Aight. In the meantime I went around the workshop to look for updated hand-weapon mods and see if they had found this out already.
But they all did it like I used to. In fact, they copied the Engineer's Defense Kit code to make it, as the weapons from the mod are still listed in their animation controllers. Which is funny, because it in turn also used to copy its controller from yet ANOTHER mod. Though I cleaned that up when I fixed it. But it seems the cycle continues, lmao
I suppose this also means their mod, without their knowledge, may still have the permanent animation corruptions if you make a wrong move, or have the female engineer stab herself with the drill all the time. If they'd fixed this, they'd have to have copied the animation controller from the updated game, not the outdated mod.
In any case, I got none the wiser from that, unfortunately. I suppose your example mod is pioneering with this clean controller, whilst mine is like the eager sidekick.

I've also tried to change every node to a custom named one, going off the posibility two animations are playing at once, given the effect can stack with your mod. I thought maybe if I change the animations to a virtual different one it could magically be fixed. The possibility exists I missed some nodes, but as far as I could tell it made zero difference.
To keep the people happy, I pushed a hotfix to the EDK for now that has the rotating engineer in it, but at least has the weapons held correctly again.
Last edited by Unsaved Changes; 29 Apr, 2022 @ 4:03am
Unsaved Changes 30 Apr, 2022 @ 6:01am 
Apparently the only thing required for me to have the rotation stop in my edited file is to call the weaponpin its vanilla name. This obviously breaks all vanilla weapons etc's animations because it overwrites, so it's not an option. But the fact that the code within stays the exact same while it suddenly works might be a hint towards something extra outside of that statemachine doing something with the vanilla weaponpin to fix this.
Chipstix213  [developer] 7 May, 2022 @ 7:42am 
okay I figured out the foot rotation.

all you have to do is change the hip layer from add to replace.
Unsaved Changes 8 May, 2022 @ 3:58am 
I have applied that change to mine, but it doesn’t seem to do anything on its own. I did notice reverting that change in your mod reintroduces the issue, including the stacking, so I see how that fixed it for you. I’ll keep the change in mine too just to omit the stacking effect.
However, I couldn’t help but notice the issue still persists in your mod, too. Instead of turning right the male engineer now turns to the LEFT and points the weapon slightly upward. Additionally, it affects vanilla weaponry in the same way. This is about the rifles only, the pistol seems to work fine.
The rotation doesn’t / hardly exists with the female engineer, though. However, she introduces a new problem where my mod’s weapons are held with a slight rotation in FIRST PERSON when I load your mod alongside it. So some stuff is still interfering with one another.

I’m going to try and completely cut my animation controller loose in terms of nodes and statements, see if that at least patches character weapon mods interfering. I’ll be sure to make a backup…
Do you by any chance know the exact animation/node that is active when standing still like that? Knowing what animations play a part in that state could really help curbing the scope, I imagine.

Or my game is just broken and I'm seeing ghost errors...?

EDIT: The now counter-clockwise rotation also applies to drills.
Last edited by Unsaved Changes; 8 May, 2022 @ 4:28am
Chipstix213  [developer] 8 May, 2022 @ 4:32am 
Some of these things I must just accept as being part of the animation, in testing yesterday I was instructing another person It seemed to go well until crouching with the weapon

I'd you use the animation controller editor shows you in real-time what node is playing
< >
Showing 1-15 of 17 comments
Per page: 1530 50