Quick Reply
Search this Thread
Virtual gardener
staff: administrator
Original Poster
#1 Old 18th Nov 2024 at 3:50 PM
Default Ways to move the upper body on LookAtManager
Hey everyone!

This is probably going to be a far stretch, but i've run into a little annoyance (not necessarily an issue, but just annoying).

I'm currently working on maintaining Virtual Artisan's Pose Addon and fixing some bugs (and adding some of my own features! ) but i've come across an issue when looking at the "look at" code.

Right now I got this:

Code:
			Actor.LookAtManager.EnableLookAts();
			Actor.LookAtManager.SetInteractionLookAt(gameObject, 20000, LookAtJointFilter.EyeBones);
			Actor.OverlayComponent.UpdateInteractionFreeParts(AwarenessLevel.OverlayUpperbody);
			Actor.LookAtManager.DisableLookAts();
			PoseManager.SetCurrentPose(Actor, currentPose);
			Target.PlaySoloAnimation(Actor.SimDescription.IsHuman, Actor, currentPose, true, ProductVersion.BaseGame);
			Actor.ResetAllAnimation();

			Actor.WaitForExitReason(float.MaxValue, ExitReason.UserCanceled);
			Actor.LookAtManager.EnableLookAts();
			return true;


It works! But, here's the catch: When a sim is posed, and there is an object right next to them, they only ever so slightly move their head, rather than rotating it like, well, we humans would!

Example:


Here, Morgana is posed normally. No looking at anything.



Here she's "looking" at the bookcase.

As you can see... it's not really "looking".


Now what I've tried so far:

1. Changing the LookAtJointFilter from eyes to HeadBone or even TorsoBone, but none have any effect.
2. Joinging them through bit assignment (like so: LookAtJointFilter.EyeBone & LookAtJointFilter.TorsoBone), but nothing works.
3. Made my own Look At task! (Yep I went this far into the rabbit hole lol), changing the Torso Percentage and threshold, but nothing changes it. In fact, I'm convinced this code is pretty much abandoned by EA at some point and is mostly calculated internally now.
4. Changed the "UpdateInteractionFreeParts"param to have AwarenessLevel.OverlayBothArms, since eventually that seems to tell the game to use the torso fully.
5. Also tried "bit assigning" the awarenesslevel like 2.
6. Changed the LookAtManager tuning for human sims, and that got me to the conclusion that EA must've replaced most of the code and doing stuff internally, because I set the values to pretty insane numbers (High and super low) and it still had the same effect.

But it just keeps being so subtle! :/

My question is: Is there a way for the sim to ACTUALLY move their torso towards the item they're looking at, or at least a more extreme version of a head turn?

Currently I'm getting so desperate that I wonder if a better approach would be using "sliders" here. Similar to how the Growth mod by Consort does it.


Thanks in advanced!
Screenshots
Advertisement
Imagine Wonderfully!
staff: trainee moderator
#2 Old 18th Nov 2024 at 7:49 PM
The poses/animations themselves do have some influence on how much the sim's head turn, which in this case since she's looking to her left in the pose, so it probably will limit how much she can look to her right. Have you also tried removing the disable look ats line or waiting a couple sim minutes before calling it? It could be interrupting the look at function too early so the sim doesn't get enough time to look at something, but this is just speculation based on what I've seen with animations. And about the torso turning, I don't think I've ever seen sims actually turn their body towards something to look at it like in sims 2 and 4, so it might not even be a thing in the game itself, but I might be wrong (hopefully).

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Virtual gardener
staff: administrator
Original Poster
#3 Old Yesterday at 12:10 PM
Quote: Originally posted by TheSweetSimmer
The poses/animations themselves do have some influence on how much the sim's head turn, which in this case since she's looking to her left in the pose, so it probably will limit how much she can look to her right. Have you also tried removing the disable look ats line or waiting a couple sim minutes before calling it? It could be interrupting the look at function too early so the sim doesn't get enough time to look at something, but this is just speculation based on what I've seen with animations. And about the torso turning, I don't think I've ever seen sims actually turn their body towards something to look at it like in sims 2 and 4, so it might not even be a thing in the game itself, but I might be wrong (hopefully).


I was wondering if I should reach out to you about this issue, lol. (Since you're pretty much TS3's queen of animations :p) but thanks for the quick reply!

I think you're right in regard to the way certain poses can be the bottleneck. Though, the reason I thought this may work, is due to the fact that when I've been working on the "OverlayComponent" parts of things (such as changing the facial expressions), and tell it to use, say, the torso bones, it will actually, well, use it as requested.

Though, I think the mistake I made, is that the lookAtManager in some degree uses the overlay component, but is actually its own thing. Meaning that the handling is simply not done the same way as the overlayComponent does.

So, I ran some tests to figure out how much of the API actually triggers the engine's function internally when triggering lookatmanager. I made 2 quick dialogues, where one I grab the OverlayLevels/AwarenessLevel to free the parts that I want having to check the item out, and then another one where I tell it to simply grab the JointFilter i want to use.

And to explain my reasoning of why I think EA has completely abandoned this code and instead doing stuff internally, here are some examples:

1. Variation used: OverlayLevel = All (head, spine and face should move), LookAtJointFilter = Torso
Expected result: Torso rotates somewhat towards the bookcase.

Actual result:



2. Variation used: OverlayLevel = Face, LookAtJointFilter = Eyes.
Expected Result: Eyes try looking at the bookcase, but doesn't move head/torso.

Actual result:



And before you ask, nope! Those are both seperate images Initially I thought I spotted at least the neck not being moved, but that's actually just wishful thinking.

I've also gone ahead and see if your suggestion disableLookAt() was the issue, but that actually still gave the same result, assuming I added only one like of EnableLookAt() of course.

I tried some other results too, but all gave the same result. Meaning... that all the Look At stuff was once probably pretty versitile, but then EA decided to make the system better by calculating the rotation of the bones internally. That's my guess anyways.

So... I think I will either just accept things right now as they are, or try to see if I can somehow make a similar system myself, with the actual OverlayComponent. In the end, I just want to make sure that poses can pose the way we want to.

So I might turn this into a research thread if I get closer to an answer! In case other people need it... for science!
Screenshots
Imagine Wonderfully!
staff: trainee moderator
#4 Old Yesterday at 9:58 PM
Quote: Originally posted by Lyralei
I was wondering if I should reach out to you about this issue, lol. (Since you're pretty much TS3's queen of animations :p) but thanks for the quick reply!

I think you're right in regard to the way certain poses can be the bottleneck. Though, the reason I thought this may work, is due to the fact that when I've been working on the "OverlayComponent" parts of things (such as changing the facial expressions), and tell it to use, say, the torso bones, it will actually, well, use it as requested.

Though, I think the mistake I made, is that the lookAtManager in some degree uses the overlay component, but is actually its own thing. Meaning that the handling is simply not done the same way as the overlayComponent does.

So, I ran some tests to figure out how much of the API actually triggers the engine's function internally when triggering lookatmanager. I made 2 quick dialogues, where one I grab the OverlayLevels/AwarenessLevel to free the parts that I want having to check the item out, and then another one where I tell it to simply grab the JointFilter i want to use.

And to explain my reasoning of why I think EA has completely abandoned this code and instead doing stuff internally, here are some examples:

1. Variation used: OverlayLevel = All (head, spine and face should move), LookAtJointFilter = Torso
Expected result: Torso rotates somewhat towards the bookcase.

Actual result:



2. Variation used: OverlayLevel = Face, LookAtJointFilter = Eyes.
Expected Result: Eyes try looking at the bookcase, but doesn't move head/torso.

Actual result:



And before you ask, nope! Those are both seperate images Initially I thought I spotted at least the neck not being moved, but that's actually just wishful thinking.

I've also gone ahead and see if your suggestion disableLookAt() was the issue, but that actually still gave the same result, assuming I added only one like of EnableLookAt() of course.

I tried some other results too, but all gave the same result. Meaning... that all the Look At stuff was once probably pretty versitile, but then EA decided to make the system better by calculating the rotation of the bones internally. That's my guess anyways.

So... I think I will either just accept things right now as they are, or try to see if I can somehow make a similar system myself, with the actual OverlayComponent. In the end, I just want to make sure that poses can pose the way we want to.

So I might turn this into a research thread if I get closer to an answer! In case other people need it... for science!



Hehe it's just a result of loving this game so much plus loving animation so much

I did some tests in my game and it does seem like there's no way to force the sim to look at something completely, or like ignore any offset from the pose. But, I did try a workaround to get a sim who is posed looking to their right to be able to look to their left with the help of a friend, track masks! In the picture below all of the sims are posed to look to their right (all using the same one too), but with a custom track mask I made a pose of the sim looking to their left and used it for the track mask, then made 2 sims look at the lamp to their left, which resulted in this:



(They're using the EA loading screen y sim pose, looks a little silly I know) The first sim has no track mask and isn't looking at anything, so basically exactly how the pose is supposed to look like. The second sim doesn't have a track mask, but is trying to look at the lamp. The third sim does have a track mask and is trying to look at the lamp, which she succeeds in.

Another example with a very simple pose of my own (but for some reason the second sim can't offset her head at all even though she's still trying to look at the lamp)



So it is possible to get them to look at stuff that normally they wouldn't be able to because of the pose. The same can be applied to the torso too (I could show an example later for it).

I don't know if you know about track masks, but a quick explanation if you don't: They're basically pose overlays that stay on the sim until they're reset or stopped with a jazz script (or overridden by another pose). You can make custom ones, which I did for this test and set the head and neck bones to be used, but at 0.5 influence instead of 1. Because it's not fully influenced, it blends the two poses together so the second sim's head is not completely turned to the left:



^ The first sim is not looking at anything, and using a custom pose where they're looking up. Second one isn't looking at anything either and is using the same pose, but has a track mask combined with another pose of looking to the left.

So you could create 4 poses of the sim looking to their left, right, up and down and use them when you add a track mask to the head and neck (or torso as well) using a jazz script, like this:



Then you could make them into interactions! But make sure to add one to remove the track mask too. I can explain more and give more examples if you want since I feel like my explanations were pretty sloppy, but I'll be on vacay starting tomorrow for my birthday on Friday so I won't be very active again until the weekend
Screenshots

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Virtual gardener
staff: administrator
Original Poster
#5 Old Today at 12:01 AM
Ahhh!! Thanks for the detailed information!!

I know of track maps, but I had no idea EA had added it in the game actually! Goes to show how ahead of it's time it really was at times


So If i'm understanding this correctly, it's basically the non-programmatical way of doing OverlayComponents? I've been working with those a lot right now, where I blend 2 poses together: https://www.tumblr.com/greenplumbbo...ht?source=share

Rambling aside, I think I can handle this! So if I'm understanding it correctly, you made poses that look up/down/left/right, and then applied the look at? If so, I think this might be the best way to do it, given the limitations we have.
Do you happen to have an EA example of such an interaction? Otherwise, I can always check for it myself, of course!

And no worries! That sounds like a perfect way to celebrate your birthday! (Happy birthday by the way!)
Imagine Wonderfully!
staff: trainee moderator
#6 Old Today at 12:30 AM
Quote: Originally posted by Lyralei
Ahhh!! Thanks for the detailed information!!

I know of track maps, but I had no idea EA had added it in the game actually! Goes to show how ahead of it's time it really was at times


So If i'm understanding this correctly, it's basically the non-programmatical way of doing OverlayComponents? I've been working with those a lot right now, where I blend 2 poses together: https://www.tumblr.com/greenplumbbo...ht?source=share

Rambling aside, I think I can handle this! So if I'm understanding it correctly, you made poses that look up/down/left/right, and then applied the look at? If so, I think this might be the best way to do it, given the limitations we have.
Do you happen to have an EA example of such an interaction? Otherwise, I can always check for it myself, of course!

And no worries! That sounds like a perfect way to celebrate your birthday! (Happy birthday by the way!)


I don't know much about OverlayComponents, but yes! There's no coding involved (well except for jazz script stuff and adding the actual interactions to pose the sim). First I applied the track mask and made them look at an object using EA's motion tech test object, then posed them with a regular pose. I didn't use the pose player though, but you have to do it in that order if you do use it otherwise the sim will either A pose or do the pose from the track mask. I did notice with certain poses with the track mask added the sim was able to look in all directions (anatomically) regardless of how their head rotation is in the pose, I'm not sure what exactly determines that though but it was interesting.

I'm not sure if there's an EA interaction that tests this, I just created them myself apart from the look at interaction. But it's easy, I can share the code and poses with you if it makes it easier for you

And thank you so much! I'm looking forward to it, except for the getting older part

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Virtual gardener
staff: administrator
Original Poster
#7 Old Today at 1:09 AM
The order won't be a problem, I can program that order in quite easily, so that the end user doesn't have to go through hoops to get it to work.

If you could share it, that would be amazing!

Thanks again!
Imagine Wonderfully!
staff: trainee moderator
#8 Old Today at 1:54 AM
Quote: Originally posted by Lyralei
The order won't be a problem, I can program that order in quite easily, so that the end user doesn't have to go through hoops to get it to work.

If you could share it, that would be amazing!

Thanks again!


Awesome! here are 4 poses for looking up, down, left and right, along with 3 track masks (one for head and neck, another for spine 1 and 2 only, and one for head, neck and spine 1 and 2. The poses do have the torso turned according to the direction in the name so you can choose to either have just the neck and head posed, or just the spine, or everything) and a jazz script just for adding the track masks (feel free to give it a better name too :p). As for the code, you can simply make an immediate interaction and do the usual basic animation state machine stuff. Let me know if you need any more help on this!
Attached files:
File Type: rar  PosesTrackMasksAndJazz.rar (3.0 KB, 1 downloads)

- When one gets inspired by the other, the one inspires another - Anything is Possible.

You can view some of my WIPs and other stuff for TS3 on my Twitter here ---> https://twitter.com/SweetSavanita
Virtual gardener
staff: administrator
Original Poster
#9 Old Today at 3:06 PM
Quote: Originally posted by TheSweetSimmer
Awesome! here are 4 poses for looking up, down, left and right, along with 3 track masks (one for head and neck, another for spine 1 and 2 only, and one for head, neck and spine 1 and 2. The poses do have the torso turned according to the direction in the name so you can choose to either have just the neck and head posed, or just the spine, or everything) and a jazz script just for adding the track masks (feel free to give it a better name too :p). As for the code, you can simply make an immediate interaction and do the usual basic animation state machine stuff. Let me know if you need any more help on this!


Thank you! Ironically, I think this also fixes an issue I was having with blending custom poses together. EA also seems to use track masks for facial expression and reactions your sims can perform while sitting/standing (think: booing at another sim when sitting down).

Just out of curiosity! Since I was hoping to check if this is a way to make “Arms only” work, how did you export/edit the Track mask exactly? I'm guessing the values we see under "TrackMasks" are the bone weight value, but obviously I'd have to somehow figure out which index in that list is what bone.
Virtual gardener
staff: administrator
Original Poster
#10 Old Today at 4:00 PM
Ah wait Ignore my previous post! My initial suspicion that the Track mask List in S3PE being 100 entries and that being the bone of the rig, is actually correct here!

So it should be pretty easy to open up Blender, see what the RIG names are in some cases, and then look up which bone is what index, set the value from 1 to 0 (or other way around) and voila!

For anyone finding this, a tiny walkthrough to make your own Track masks!

Get a copy to work from first. You can find a few from the JazzData .package (found in: \The Sims 3\Game\Bin\Jazz\)

In my case, I want to make sure that the arms move, but everything else does not. So, the easiest I figured for me, is the "Arms And Head Reaction" TkMk file! I will be using this in this example.

Now, click on the file, right click > Export To package. And now open up your new package!

Thing is, right now we "technically" made a default replacement. So we need the instance ID to be different. So, we double click on our TkMk file, and then under "name" we type Another name that isn't used by EA (If in doubt just do "USERNAME_ArmsAndHeadReaction"). Then, press "FNV64" and Ok.

Getting The correct Rig:

After you got your file, we check in S3PE, what the RigKey is. You can see this when you click the item you want to use as a reference, and on the right preview bit, you will see it!

Mine says: RigKey: 0x8EAF13DE-0x00000000-0xD057FCC534C1BCBB

Now, copy the Resource key, since we'll need to check the proper rig for this!

Allright! So a few things to note when looking for Rigs:

1. DON'T use the Rigs you see in FullBuild01. These are GrannyRig files, before EA changed to another rig system after Pets was installed. These will NOT work, and won't give you the result we're looking for!

Allright, with that out of the way, we're opening "DeltaBuild0" (found in: \The Sims 3\GameData\Shared\Packages), as that's most likely where all the Rigs are. of course, if your RIG is missing from there, I would recommend checking DeltaBuild03 (01 is textures only).

As you now have the DeltaBuild0 package open, on the bottom, we click "filter active", then press the "paste RK" button and make sure you checked the "ResourceType", "ResourceGroup" and "Instance"! Otherwise it won't show your file

Getting Our Bones List, indexed:

As we click on our Rig, we see in the preview the "BoneList". It's huge! It look something like this:

Code:
--- BoneList: Bones (0x101) ---
--- Bones[000] ---
   Position: { 0,0000; 0,0000; 0,0000 }
   Orientation: { 0,0000; 0,0000; 0,0000; 1,0000 }
   Scaling: { 1,0000; 1,0000; 1,0000 }
   Name: b__ROOT__
   OpposingBoneIndex: 0x00000000
   ParentBoneIndex: 0xFFFFFFFF
   Hash: 0xFEAE6981
   Unknown2: 0x00000023
--- Bones[001] ---
   Position: { 0,0000; 1,0122; 0,0000 }
   Orientation: { 0,0000; 0,0000; 0,0000; 1,0000 }
   Scaling: { 1,0000; 1,0000; 1,0000 }
   Name: b__ROOT_bind__
   OpposingBoneIndex: 0x00000001
   ParentBoneIndex: 0x00000000
   Hash: 0x57884BB9
   Unknown2: 0x00000023
--- Bones[002] ---
   Position: { 0,0000; 0,1110; 0,0000 }
   Orientation: { 0,0000; 0,0000; 0,0000; 1,0000 }
   Scaling: { 1,0000; 1,0000; 1,0000 }
   Name: b__Pelvis__
   OpposingBoneIndex: 0x00000002
   ParentBoneIndex: 0x00000001
   Hash: 0x556B181A
   Unknown2: 0x00000023
--- Bones[003] ---
   Position: { -0,0660; -0,1110; 0,0000 }
   Orientation: { 0,9998; -0,0179; -0,0018; 0,0132 }
   Scaling: { 1,0000; 1,0000; 1,0000 }
   Name: b__R_Thigh__
   OpposingBoneIndex: 0x0000001A
   ParentBoneIndex: 0x00000002
   Hash: 0x83B1355C
   Unknown2: 0x0000003A
--- Bones[004] ---
   Position: { 0,0000; 0,4840; 0,0000 }
   Orientation: { 0,0403; 0,0000; 0,0000; 0,9992 }
   Scaling: { 1,0000; 1,0000; 1,0000 }
   Name: b__R_Calf__
   OpposingBoneIndex: 0x0000001B
   ParentBoneIndex: 0x00000003
   Hash: 0x81B330DE
   Unknown2: 0x0000003A
--- Bones[005] ---
   Position: { 0,0000; 0,4190; 0,0000 }
   Orientation: { 0,9995; -0,0179; -0,0011; 0,0272 }
   Scaling: { 1,0000; 1,0000; 1,0000 }
   Name: b__R_Foot__
   OpposingBoneIndex: 0x0000001C
   ParentBoneIndex: 0x00000004
   Hash: 0x37BB051C
   Unknown2: 0x0000003A

Etc, Etc, Etc.....


What I like to do is to select this whole BoneList, until you see the "skeletonName" and/or "IKChainList" bit.

"Erm, Lyra, This is all gibberish... could you share your rig file with you?" - And that's why I attached it! ;D As long as your RIG is supposed to be the "AuRig", then feel free to download the txt file, instead!


Editing The MaskTrackList:

And now we finally got to the part we wanted to, editing the MaskTrackList. Let's open up our new Package file with our TkMk in it

Click the TkMk > right click > Grid (found at the bottom)

Double click "ChunkEntries"> [0] ChunkEntries > RCOLBlock > TrackMasks. To make things easier, I like to click on the bit it says "Collection: 0x101) and then click the "..." button.


Now, with your AuRig Text file next to you as a refererence, we want to do the following:

1 = Influenced, Will Move
0 = No movement.

I'm not entirely sure if you can do in-between values (say: 0,5), but it wouldn't surprise me!

Deciphering which index is what bone:

Okay, now looking at my TrackMaskList, let's take [00A] as an example. On my AuRig text file, I look for the same index ([00A]), and here I'm seeing: Name: b__R_backCalfTarget_slot

The name here is actually really helpful!

Though, note, if it's offsets and they happen to be set to 1, I personally would leave them. EA probably did it for a reason, but "Slot" or "offset" bones, just keep them at 1. Those are only used for Visual effects and nothing else. So it won't break anything!


And now you have an edited TkMk file!
Attached files:
File Type: txt  AuRigBones.txt (73.4 KB, 0 downloads)
Back to top