Okay, I give up. @SimGuruModSquad How can I tell which vertex is being affected in the DMap files? I've tried so much but I cannot figure this out.
EDIT 2:
Realized I was doing it wrong the whole time and I almost have it figured out! The problem is that the model is deforming weirdly, one half of the model is deforming wrongly while the other half is correct. Here are some images of the problem
EDIT 3
Got the "other half is wrong" bug to go away by simply mirroring the image as it was cut in half due to some optimizations (I read this in some GDC presentation by the TS4 team). Anyway, I seem to have it working correctly on the fitness morph. I'm going to try on the fatness morph again.
Yay, I've gotten it to work! Here's a comparison of the fat, normal, and muscular morphs in blender.
All that's left to do is create a converter from the modified sim model to the actual dmap resource, which shouldn't take very long!
> @simmythesim said: > Yay, I've gotten it to work! :smile: Here's a comparison of the fat, normal, and muscular morphs in blender. > All that's left to do is create a converter from the modified sim model to the actual dmap resource, which shouldn't take very long!
> @Agent48mk2 said: > > @simmythesim said: > > Yay, I've gotten it to work! :smile: Here's a comparison of the fat, normal, and muscular morphs in blender. > > All that's left to do is create a converter from the modified sim model to the actual dmap resource, which shouldn't take very long! > > Nice! Please keep us updated. >
I agree. Please do. If you succeed, would you be so kind as to walk us through the steps on how you accomplished it?
I'll make one in the morning, anyway for some odd reason I have two origin accounts, with this being potato for some reason. I've been meaning to merge them, but I've been too lazy.
Ah, there you go, now I'm back to the right account. Anyway, Simgurumodsquad could you give us some tips on how the Sims team converted the modified Sim model to the dmap resource? Thanks.
I'm still working on this, I've decided to write my own DMap reader in C#, so others can easily read DMap files without 010 editor. After that I hope to write an additional part where the user can easily extend the slider limits by adding a multiplier to the DMap values. Well, that's what I want to do, anyway, off to more programming!
EDIT 1: Whew! That was fast, I finished converting the actual dmap parsing into C#, and while the code is messy, it works! It needs an actual interface though.
> @simmythesim said: > I'm still working on this, I've decided to write my own DMap reader in C#, so others can easily read DMap files without 010 editor. After that I hope to write an additional part where the user can easily extend the slider limits by adding a multiplier to the DMap values. Well, that's what I want to do, anyway, off to more programming! > EDIT 1: Whew! That was fast, I finished converting the actual dmap parsing into C#, and while the code is messy, it works! It needs an actual interface though. Great work! Now just need to wait some days for the gurus to come back and provide more info.
> @simmythesim said:
> I'm still working on this, I've decided to write my own DMap reader in C#, so others can easily read DMap files without 010 editor. After that I hope to write an additional part where the user can easily extend the slider limits by adding a multiplier to the DMap values. Well, that's what I want to do, anyway, off to more programming!
> EDIT 1: Whew! That was fast, I finished converting the actual dmap parsing into C#, and while the code is messy, it works! It needs an actual interface though.
Great work! Now just need to wait some days for the gurus to come back and provide more info.
I've got the slider multiplier working!
All I need left is a list of DMAP resources, so I know which slider I'm editing. Currently I'm finding the sliders by getting them from the CASModifierTuning DATA files, which lacks some of them, by the way. @SimGuruModSquad, can we have the list?
EDIT: I've made a couple of changes to the way the numbers are multiplied. It's gradual now, so there won't be a sudden jump in sim vertices. It looks much nicer now, to say the least.
Anyway, the above change changed the increased fitness slider from this
> @simmythesim said:
> Thanks SimGuruModSquad! This is very valuable information for increasing the sliders.
Would you be able to make some sort of "How to"? I would love to know how to do this myself ^^
I'm not doing anything by hand in actually increasing the slider limits, my program does it all for me, I just input the file I want to change, wait a somewhat long time, and then poof! The increased limits are done. It's a very slow process though, and sometimes it reaches up to an hour to edit a large file, which is why I'm still working on it to be faster.
EDIT: I converted it from a Windows Forms C# application to a console application, and it yielded up to 60x performance gains. The largest file which took up to an hour using the Windows Forms Version, now only takes 1 minute and 21 seconds!
> @simmythesim said: > Fishinabarrrel wrote: » > > > @simmythesim said: > > Thanks SimGuruModSquad! This is very valuable information for increasing the sliders. > > Would you be able to make some sort of "How to"? I would love to know how to do this myself ^^ > > > > > I'm not doing anything by hand in actually increasing the slider limits, my program does it all for me, I just input the file I want to change, wait a somewhat long time, and then poof! The increased limits are done. It's a very slow process though, and sometimes it reaches up to an hour to edit a large file, which is why I'm still working on it to be faster. > > EDIT: I converted it from a Windows Forms C# application to a console application, and it yielded up to 60x performance gains. The largest file which took up to an hour using the Windows Forms Version, now only takes 1 minute and 21 seconds!
Would you be willing to share this at some point in the future? I have been trying with no luck to do it other ways.
> @simmythesim said:
> Fishinabarrrel wrote: »
>
> > @simmythesim said:
> > Thanks SimGuruModSquad! This is very valuable information for increasing the sliders.
>
> Would you be able to make some sort of "How to"? I would love to know how to do this myself ^^
>
>
>
>
> I'm not doing anything by hand in actually increasing the slider limits, my program does it all for me, I just input the file I want to change, wait a somewhat long time, and then poof! The increased limits are done. It's a very slow process though, and sometimes it reaches up to an hour to edit a large file, which is why I'm still working on it to be faster.
>
> EDIT: I converted it from a Windows Forms C# application to a console application, and it yielded up to 60x performance gains. The largest file which took up to an hour using the Windows Forms Version, now only takes 1 minute and 21 seconds!
Would you be willing to share this at some point in the future? I have been trying with no luck to do it other ways.
I'm going to post the mod on modthesims so everybody can have access to it, I'm still going to share the program, just in case new sliders or the dmap resource changes. Anyway, I'm still programming a new program to sort the extended DMap resources into their appropriate folders, so the user can mix and match which sim body parts to extend.
Guys, this may take a bit longer, as I think I'm close to creating a new DMap resource, anyway, while this may seem not important, this can be a huge discovery, if I get this right, the possibility of adding new sliders, or at the very least overriding them to create new sliders, would be made possible.
> @simmythesim said: > Guys, this may take a bit longer, as I think I'm close to creating a new DMap resource, anyway, while this may seem not important, this can be a huge discovery, if I get this right, the possibility of adding new sliders, or at the very least overriding them to create new sliders, would be made possible. > > Hope you can wait a little longer! :)
Take your time. Just keep us in the loop ^^ Good Luck
Okay, another question, @SimGuruModSquad, from what I've read, the Min/Max Col/Row, tells what part the data in the DMap resource starts and ends with. Can we get the maximum MaxCol and MaxRow values (since we know the Min Col/Row values start at 0)?
I'm very excited to say that we're getting there! Here's the first custom vertex-based slider for The Sims 4! All it does is move most of the Vertices forward, and while it seems that the directions are currently wrong, I can now say that it should be a breeze completing this.
Here's a pretty important question, @SimGuruModSquad, are truly custom sliders possible? Can I add new modifiers to the game? Currently I can make "custom" sliders, but I have to override another resource for it to work first.
The current max values in the cropped data are maxcol=479 and maxrow=1262, and the non-cropped source dmap images are maxcol=480 and maxrow=1280. This certainly could change, but in practice I don't see this happening any time too soon.
Adding new modifiers is likely not impossible but definitely tricky, the main issue of course is how to expose them to the user.
Adding a new direct manipulation control (so that the user can click on the Sim to trigger the new dmap) is theoretically doable but is a touchy thing to get right and there is a potential limitation that could be a problem (discussed below). Here is a rundown of how they work:
There is a texture that correlates dmaps to the 3D region of the Sim. The texture is 00b2d882:00000000:acc70cc7299a9662 (AKA "CASHotSpotAtlas"), and is mapped to the Sim via the 2nd set of UVs.
This texture's RGBA values indicate the SimHotspotControl Resource (type 0x8b18ff6e) resource used for that pixel. Where: Alpha : Specifies the SimHotspotControl to use for that pixel when in zoomed in (Micro) mode. Red: Unused (I think) Green : Specifies the SimHotspotControl to use for that pixel when in zoomed out (Macro) mode. Blue : Is used for highlighting and selecting, to determine if clicking on top, bottom, head or shoe.
The SimHotspotControl resource specifies a value between 0 and 255 for itself that maps to the values in the CASHotSpotAtlas A & G values. The keys for these SimHotspotControl resources are listed below, we have not published a .bt file for that resource but I can if you like.
The SimHotspotControl resource also specifies one or more SimModifier resourses which in turn references the DMAPs to use. The instances and .bt file for SimModifier resources can be found earlier in this thread.
However there is a problem. The CASHotSpotAtlas texture is lossily compressed, so there is data loss when reading the RGB values at runtime and so our artists kept the values in the RBG components 10 apart to account for that (250, 240, 230, etc.). The Maxis data already uses 0->250 for Macro mode and 0->240 for Micro mode. So there is effectively no space left in Macro mode and one space left for an additional Micro mode hotspot. You could try using one of the "in between" values (255, 245, etc.) that might work well enough. Or, not ideal but you could override all our data to step by 9 instead of 10 and that would give you more headroom and might be enough to avoid the compression issue.
Another approach would be to add a new slider to the UI, but unfortunately the UI interface to C++ is not generic enough to add arbitrary body modification sliders.
Can SimModifier files modify a sim's attributes without a SimHotspotControl pointing to them?
I mean, can I theoretically add new sliders without messing around with the SimHotspotControl resources, by simply adding a new SimModifier pointing to a new DMap?
If so, then I could use the script I made in the "Accessing CAS Modifiers from script" post (this,if you were wondering) to modify the slider value without touching the UI at all.
> @simmythesim said: > I'm very excited to say that we're getting there! Here's the first custom vertex-based slider for The Sims 4! All it does is move most of the Vertices forward, and while it seems that the directions are currently wrong, I can now say that it should be a breeze completing this. i.imgur.com/I2gETAT.gif
Comments
Okay, I give up. @SimGuruModSquad How can I tell which vertex is being affected in the DMap files? I've tried so much but I cannot figure this out.
EDIT 2:
Realized I was doing it wrong the whole time and I almost have it figured out! The problem is that the model is deforming weirdly, one half of the model is deforming wrongly while the other half is correct. Here are some images of the problem
EDIT 3
Got the "other half is wrong" bug to go away by simply mirroring the image as it was cut in half due to some optimizations (I read this in some GDC presentation by the TS4 team). Anyway, I seem to have it working correctly on the fitness morph. I'm going to try on the fatness morph again.
All that's left to do is create a converter from the modified sim model to the actual dmap resource, which shouldn't take very long!
> Yay, I've gotten it to work! :smile: Here's a comparison of the fat, normal, and muscular morphs in blender.
> All that's left to do is create a converter from the modified sim model to the actual dmap resource, which shouldn't take very long!
Nice! Please keep us updated.
> > @simmythesim said:
> > Yay, I've gotten it to work! :smile: Here's a comparison of the fat, normal, and muscular morphs in blender.
> > All that's left to do is create a converter from the modified sim model to the actual dmap resource, which shouldn't take very long!
>
> Nice! Please keep us updated.
>
I agree. Please do. If you succeed, would you be so kind as to walk us through the steps on how you accomplished it?
EDIT 1: Whew! That was fast, I finished converting the actual dmap parsing into C#, and while the code is messy, it works! It needs an actual interface though.
> I'm still working on this, I've decided to write my own DMap reader in C#, so others can easily read DMap files without 010 editor. After that I hope to write an additional part where the user can easily extend the slider limits by adding a multiplier to the DMap values. Well, that's what I want to do, anyway, off to more programming!
> EDIT 1: Whew! That was fast, I finished converting the actual dmap parsing into C#, and while the code is messy, it works! It needs an actual interface though.
Great work! Now just need to wait some days for the gurus to come back and provide more info.
I've got the slider multiplier working!
All I need left is a list of DMAP resources, so I know which slider I'm editing. Currently I'm finding the sliders by getting them from the CASModifierTuning DATA files, which lacks some of them, by the way. @SimGuruModSquad, can we have the list?
EDIT: I've made a couple of changes to the way the numbers are multiplied. It's gradual now, so there won't be a sudden jump in sim vertices. It looks much nicer now, to say the least.
Anyway, the above change changed the increased fitness slider from this
to this.
Here you go:
DMAPs
Sim Modifiers
> Thanks SimGuruModSquad! This is very valuable information for increasing the sliders.
Would you be able to make some sort of "How to"? I would love to know how to do this myself ^^
I'm not doing anything by hand in actually increasing the slider limits, my program does it all for me, I just input the file I want to change, wait a somewhat long time, and then poof! The increased limits are done. It's a very slow process though, and sometimes it reaches up to an hour to edit a large file, which is why I'm still working on it to be faster.
EDIT: I converted it from a Windows Forms C# application to a console application, and it yielded up to 60x performance gains. The largest file which took up to an hour using the Windows Forms Version, now only takes 1 minute and 21 seconds!
> Fishinabarrrel wrote: »
>
> > @simmythesim said:
> > Thanks SimGuruModSquad! This is very valuable information for increasing the sliders.
>
> Would you be able to make some sort of "How to"? I would love to know how to do this myself ^^
>
>
>
>
> I'm not doing anything by hand in actually increasing the slider limits, my program does it all for me, I just input the file I want to change, wait a somewhat long time, and then poof! The increased limits are done. It's a very slow process though, and sometimes it reaches up to an hour to edit a large file, which is why I'm still working on it to be faster.
>
> EDIT: I converted it from a Windows Forms C# application to a console application, and it yielded up to 60x performance gains. The largest file which took up to an hour using the Windows Forms Version, now only takes 1 minute and 21 seconds!
Would you be willing to share this at some point in the future? I have been trying with no luck to do it other ways.
I'm going to post the mod on modthesims so everybody can have access to it, I'm still going to share the program, just in case new sliders or the dmap resource changes. Anyway, I'm still programming a new program to sort the extended DMap resources into their appropriate folders, so the user can mix and match which sim body parts to extend.
Hope you can wait a little longer!
> Guys, this may take a bit longer, as I think I'm close to creating a new DMap resource, anyway, while this may seem not important, this can be a huge discovery, if I get this right, the possibility of adding new sliders, or at the very least overriding them to create new sliders, would be made possible.
>
> Hope you can wait a little longer! :)
Take your time. Just keep us in the loop ^^
Good Luck
Great progress!
The current max values in the cropped data are maxcol=479 and maxrow=1262, and the non-cropped source dmap images are maxcol=480 and maxrow=1280. This certainly could change, but in practice I don't see this happening any time too soon.
Adding new modifiers is likely not impossible but definitely tricky, the main issue of course is how to expose them to the user.
Adding a new direct manipulation control (so that the user can click on the Sim to trigger the new dmap) is theoretically doable but is a touchy thing to get right and there is a potential limitation that could be a problem (discussed below). Here is a rundown of how they work:
Alpha : Specifies the SimHotspotControl to use for that pixel when in zoomed in (Micro) mode.
Red: Unused (I think)
Green : Specifies the SimHotspotControl to use for that pixel when in zoomed out (Macro) mode.
Blue : Is used for highlighting and selecting, to determine if clicking on top, bottom, head or shoe.
Another approach would be to add a new slider to the UI, but unfortunately the UI interface to C++ is not generic enough to add arbitrary body modification sliders.
Hope that helps,
SGMS
-SGMS
Can SimModifier files modify a sim's attributes without a SimHotspotControl pointing to them?
I mean, can I theoretically add new sliders without messing around with the SimHotspotControl resources, by simply adding a new SimModifier pointing to a new DMap?
If so, then I could use the script I made in the "Accessing CAS Modifiers from script" post (this,if you were wondering) to modify the slider value without touching the UI at all.
> I'm very excited to say that we're getting there! Here's the first custom vertex-based slider for The Sims 4! All it does is move most of the Vertices forward, and while it seems that the directions are currently wrong, I can now say that it should be a breeze completing this.
i.imgur.com/I2gETAT.gif