Hi there! You are currently browsing as a guest. Why not create an account? Then you get less ads, can thank creators, post feedback, keep a list of your favourites, and more!
Quick Reply
Search this Thread
Lab Assistant
Original Poster
#1 Old 11th Feb 2007 at 2:57 AM Last edited by cwurts00 : 11th Feb 2007 at 3:12 AM.
Default making body shape genetic & growing sims
I've started a project to have a large variety of body shapes in the game, and to make them genetic. I've looked over the text lists in Simpe, and that's about as far as I got. I have no idea where to go from here to program my desired changes.

Being an experienced programmer in other languages does not help me with Simpe, but I was able to make a detailed pseudocode to describe exactly what I want to do.

Results desired:

Definitions:

body size - the size of a sim under condition of average fitness. I have taken a maxis sim and scaled it in the x and z directions to make 10 different variations from 0.70 to 1.15. I will call these b1 to b10.

physique level - body shape resulting from a sim's fitness level. Ranges from p1 to p7. p4 is a normal maxis sim; lower is fat; higher is muscular.

body shape - body size and physique level combined make 70 different body shape variations.

body size gene: the b-size a sim will grow into by age 23 (anywhere from b1 to b10)

physique gene: the maximum p-size that is possible for a sim (anywhere from p4 to p7) called maxPhysique=4,5,6,7

body skill requirement: the number of body skill points required for a sim to reach a certain p-size: p5=6; p6=8; p7=10

outfit categories: each bodyshape has its own set of style categories (formal, casual, etc) which are unwearable to other bodyshapes.
---------------

At age 13 a sim grows up into a teenager with a body shape of b1p4. As he ages, he will take 10 days to grow into his maximum b-size (as determined by his genes). Then he will stay at that b-size for life.

A sim's P-size can be changed by increasing fitness level i.e. working out. If a sim's fitness meter falls to 0, he will drop one p-size; if it rises to 100 he MAY gain one fitness level, provided that 1) he has the genes to advance to that p-size and 2) he has the specified number of body skill points to advance to that p-size.

There are 70 unique bodyshapes, and each one has to have its own set of outfits which are all unwearable by the other bodyshapes. So it is very important that when a sim changes outfits, he changes into the appropriate outfit with the correct bodyshape.

Programming Details:

Note: The function names I am using are fictional. I am only using them to describe what is happening.

Bodyshape is really just the clothes the sim is wearing, so if a sim is wearing an outfit that is suitable to his bodyshape, it will remain that way until he changes clothes. So it is the "changing outfit" function that we have to tweak.

Changing Clothes Pseudocode(mod 1):

***a sim could change b-size or p-size at any time, but it will not show up until the sim changes outfits. This is an opportunity for the game to check if the bodyshape needs to be updated***

1. find appropriate b-size
get b-size gene -> set to x
get sim's ageInHours -> set to t
y=[t (integerDivide) [240/x]]+1
b-size = lower value of x and y

***sim will gradually grow from b-size 1 to b-size x at age 24 and on the way will transition through all sizes in between***

2. find appropriate p-size
if fitnessmeter=full then
if bodySkillPoints=bodySkillRequirement(p-size+1)
AND maxPhysique(p-size+1)>=p-size+1 then
p-size=p-size+1; set fitnessmeter to empty
endif
else if fitnessmeter=empty then p-size=p-size - 1; set fitnessmeter full
else p-size = p-size
end if

***working out continuously will eventually result in max p-size for sim,
while not working out at all will eventually result in p-size 1 (obesity)***

3. newbodyshape = b-size p-size combo

4. upon changeClothesAnimation, set sim's currentOutfit to newBodyshape version of style requested.

The exact same scenario will be applied during ageTransitionAnimation(mod 2).

(mod 3) add new data: b-size gene (b1 through b10)
(mod 4) add new data: p-size gene(p4 through p7)

The CAS underwear choices show all 10 b-sizes in 4 versions(one for each p-size). The p-size is indicated in the tool-tip. The underwear size chosen will determine the created sim's genes for b-size and p-size. The genes will be set when the sim is confirmed in CAS, and the sim will start the game in casual outfit with p-size(4) and b-size(CAS-determined) (mod 5)

A baby sim's genes are determined at conception and stored in the pregnant woman's person-data as "unborn genes 1 through 5" I am not aware of how DNA is stored in the base game, but at least my two new genes will have to be added. (mod 6?)

upon birthAnimation, the mother's unborn genes are transferred to baby sim's genes and nulled from mother's file(mod 7)

(mod 8) add new data: PersonOutfitCategories 70 versions of each clothing type(formal, underwear, swimwear, etc.)

Like I said at the top, all the info I got from the text Lists is what made me realize which aspects of the game I would be able to change; but in most of the mods I planned above, I have no idea how to start or where to look for the codes. Any help would be greatly appreciated.
Advertisement
Field Researcher
#2 Old 11th Feb 2007 at 6:27 PM
Maybe I'm on thin ice here, but wouldn't all this require modding of the game files also?
I suppose you would have to reprogram the life stages of the sims and make sure that the game use your meshes for the default sims generated by the game!

I like your idea and would love to see a little more than just 3 fitness posibilities for my sims, but having too many different bodyshapes would require too many versions of the clothes, most of the clothes are also meshes so they would have to be altered too - I simply see to many problems executing your idea!

Sorry, didn't mean to sound negative - I simply just don't believe it can be done :D

Life's a game, so let's play!
Lab Assistant
Original Poster
#3 Old 11th Feb 2007 at 6:41 PM
Maybe a mod could be made similar to stretchSkeleton which would scale all bodies and outfits in the x and z derection. Then the # of outfit catergories would be divided by 10. You would need just one for each fitness shape, then scale that one appropriately to obtain the bodyshape for each sim.
world renowned whogivesafuckologist
retired moderator
#4 Old 11th Feb 2007 at 6:50 PM
Thing is, I don't think you -can- scale bodies like that.

stretchskeleton works purely vertically, and is limited to only around a 20% change up or down. You would have to actually change all the meshes for those different combinations which could be done in theory (warlokk's done some remarkably large packs of new body types), but it would be a BIG pack to download and a HUGE amount of work to create.

I guess one could -potentially- create some sort of hack alongside a set of meshes to control changes between meshes to create the aging scheme you suggest, but I don't know how one would link it genetically to a sim, and either way, it'd be a BIIIIIIIG complicated project. Maybe doable, maybe not, but it sounds like some uncharted waters, and one often sinks or swims on their own in those.

my simblr (sometimes nsfw)

“Dude, suckin’ at something is the first step to being sorta good at something.”
Panquecas, panquecas e mais panquecas.
Alchemist
#5 Old 12th Feb 2007 at 4:04 AM
Quote: Originally posted by cwurts00
Maybe a mod could be made similar to stretchSkeleton which would scale all bodies and outfits in the x and z derection. Then the # of outfit catergories would be divided by 10. You would need just one for each fitness shape, then scale that one appropriately to obtain the bodyshape for each sim.


I believe stretchSkeleton operates on the joints in the Sim itself, and only scales on the Z (up/down) axis. If we had access to modifying the game code, you could do what you want merely by altering the joints sizes on all three axes. Of course, if this was easy Maxis would likely have used it.

I suspect that you will find that after you get the sim properly sized this way, the animations will be off because the joints will be rotating limbs that are sized differently from what they were written for.

<* Wes *>
Admin of Randomness
retired moderator
#6 Old 12th Feb 2007 at 11:51 AM
And where would you _store_ this extra data on each sim. Currently we cannot change the actual skeletons on the sims, it breaks all the game animations, in addition to not being stored with the individual meshes, and I do not expect that to change for all of sims 2. Maybe Sims 3, maybe.

"Undertake something that is difficult; it will do you good. Unless you try to do something beyond what you have already mastered, you will never grow." - Ronald E. Osborn

Please do NOT PM me with requests, creation questions, or game help questions. Click for help:
Game Help | Create | Content List | Where Can I Find?
Alchemist
#7 Old 12th Feb 2007 at 6:50 PM
I don't want people to think I'm dissing this entirely. I think it is fundamentally a good concept, but I'm not sure how practical it is without access to the game core code. And the issues with animations opens up a whole level of additional complications (already there are child/adult specific animations needed).

I still think changes that would take can be made to the CRES of sim bodies in the Characters directory of the Neighborhood. This would be, of course, changes that only happen when the game is closed. Doing it in a manner that doesn't crash the game is another big challenge.

<* Wes *>
Lab Assistant
Original Poster
#8 Old 13th Feb 2007 at 12:51 AM Last edited by cwurts00 : 13th Feb 2007 at 10:50 PM.
Okay, so assuming that scaling is impossible, and there are still 70 body shapes for adult males(or any other older gender/lifestage):

When you only have one body shape, like the current game, you will want 100 varieties of outfits for that one body shape. But if there are 70 body shapes, would you really need 100 varieties for each shape? No, you would probably be satisfied with having 100 varieties in total, and dividing them among the different body shapes. Assuming you have 100 sims in your neighborhood: 50 would be male, 25 would be adult males, and that means that you are likely to have no more than two sims with the same shape at the same time. I estimate you would need no more than 5 outfits to choose from in each category.

In other words, all you would have to do is scale SOME of the outfits to match each body shape(5 per shape per category), then somehow code the game to choose an outfit appropriate to the sim's body shape each time he/she changes outfits.

See if you can help me with this: Somehow, I need to put all these outfits in different categories, so a sim will only select an outfit that is appropriate. I already know it can be done - outfits are already placed into categories by age, gender, and life stage - but I want to know how. Everytime I think I found a piece of the puzzle, I lose it when I try to go back to it. Somewhere, there should be a list of all the outfits and for each one, a list of properties, including which categories the outfit can be used for (adult,male,formal,etc).

Can anyone tell me where this information is stored, or possibly how it could be altered for my purposes?
Lab Assistant
#9 Old 31st Dec 2007 at 3:41 PM
I know this is a large necrobump of sorts, but i'm very interested in the prospect of having more bodyshape options avaliable for my sims.

If it helps at all, there is a (now abandoned and/or unsupported) mod avaliable at SexySims2 which allowed you to use numerous Body Shapes on a sim without the need for a custom skin tone. It used namely bodymeshes by BeosBoxBoy (Superhero, Athletic, Bodybuilder), and worked via an ingame menu. You clicked on a sim, set them to which body type you want them to be, and they will be that bodytype the next time they take a shower and such.

If I remember correctly from what the modder said, this was done by overriding the normal undress functions, so that instead of using the default nude base they would in fact wear a nude 'cloth' matching the bodytype set for that sim.

Before being abandoned, two other mods were made that shows just how flexible using the nude 'cloth' system can be. One mod was a Sauna Door (made before Bon Voyage), which allowed a sim to walk through it either nude or with a towel. The thing is, the towel outfit automatically matched the custom bodyshape the sim was set to (the door detected which bodyshape the sim was using, and used the nessecary towel mesh).

The second mod made was a global mod that did the same thing, except with Work Outfits. When a sim changed to go to work, the mod would detect which bodyshape the sim was using from the main mod, and use the appropriate Work Outfit mesh.

Unfortunately, as it currently stands, the mod is incompatible with Bon Voyage (sims refuse to bath or shower), has few bodytypes, and only works on male sims.

But if similar (if not the same) techniques can be used, quite a bit could be done. More bodyshapes could be included (for both men and women); certain outfits could automatically change to fit that bodyshape (as proven by the Work Clothes mod); perhaps even override the normal fitness system, and change bodyshapes appropriately.

The mod is available at SexySims2 under the mods section (as stated, it hasn't received updates for a while, so you might have to dig a bit to find it). Looking through it's files and how it works should help you immensely in figuring out how to implement more bodyshapes.
Back to top