Ludeon Forums

RimWorld => Mods => Help => Topic started by: keylocke on March 15, 2016, 10:28:43 PM

Title: need help modding pawn body textures
Post by: keylocke on March 15, 2016, 10:28:43 PM
sup guys? i'm trying to reskin pawn bodies and create custom body shapes like these :

(http://i.imgur.com/QbkEoBp.jpg)

can anyone point me to a good tutorial? it says here that the tutorials posted there are out-of-date for a12 and up.

anyways. i hope someone can point me in the right direction while i still got freetime to do it. (hoping to finish this in a day or two)

stuff i'm hoping to learn :
-what are the defs that i need to change for my custom head, body, and hair textures?
-how do i replace/remove unwanted graphics from vanilla? (since old textures for apparels would look incompatible for these.
-what about pants? what's the defs needed for pants graphics? are there no graphics for pants?

thanks in advance.  ;D
Title: Re: need help modding pawn body textures
Post by: keylocke on March 16, 2016, 02:39:52 AM
hmm, the images in the rimworld core textures are greyscale, so i started doing these in greyscale like this.

(http://i.imgur.com/I39qmd4.jpg)

(i'm gonna pixel art this when i go final, but for testing, i think these will do until i learn how to mod this into the game itself)

anyways, i just remembered shinzy's cool apparello mod having colored textures instead of just greyscale.

-is that applicable to pawn bodies?
-how do i do that? which tag should i change in which def?
Title: Re: need help modding pawn body textures
Post by: Fluffy (l2032) on March 16, 2016, 06:08:39 AM
Even though your concepts look awesome, I would strongly advise against going down this rabbit hole.

Pawn graphics are largely hardcoded, and not at all easy to mod. This would be a C# project, and a relatively difficult one at that. Also, keep in mind that if your pawns have different dimensions, you'd basically need to redraw all apparel to match, or it would look out of place. Apparel isn't automatically 'morphed' to body sizes, there's actually 3 (body types) * 3 (facings) versions of every single apparel. In addition, the game doesn't (need to) render lower body apparel, as these are normally not visible. Your pawns would need to do this, so again there's a ton of extra graphics to do, and custom code to write.
Title: Re: need help modding pawn body textures
Post by: Shinzy on March 16, 2016, 07:36:59 AM
Don't be such a killjoy robert!
I want to see this man descend into madness!

all the apparel work would be mostly easy to do. There's just lot of it
and can't you just have the game use these graphics instead of the vanilla ones
by simply making new folder in the same path/filename the game seeks the textures from?
I recall Jabbamonkey doing that
just got to remember heads and bodies are added separately
aaand you'd need fifth body type (The hulk)

And pawn bodies have to be grayscale unlike apparel cause like robert said their graphics are largely hardcoded, whereas with the apparel you can choose in the xml's if they use the colouring comps or not

Title: Re: need help modding pawn body textures
Post by: keylocke on March 16, 2016, 09:32:52 AM
thanks for the info guys.

Quoteand can't you just have the game use these graphics instead of the vanilla ones
by simply making new folder in the same path/filename the game seeks the textures from?

yea i was wondering that. but i don't know the filepath for the hair, head, and body textures. what def has those filepath info? i checked pawnkind def and couldn't find it.  :-\

Quoteaaand you'd need fifth body type (The hulk)

what hulk? is that a name for a mod i can use for reference?
Title: Re: need help modding pawn body textures
Post by: skullywag on March 16, 2016, 09:38:26 AM
theres another body size, normal, thin, fat, female and Hulk I believe.
Title: Re: need help modding pawn body textures
Post by: Shinzy on March 16, 2016, 09:42:22 AM
The official texture pack  (which is outdated) has all the textures arranged correctly (unless theyve changed) in the folders
Edit: should be able to see the paths directly from whatever code handles it aswell

Youll find all the original bodytypes and their names in there

Think its something like things/pawns/human/bodies or something like that

Hairs have their own xmls in thingdefs/hair
Title: Re: need help modding pawn body textures
Post by: skullywag on March 16, 2016, 09:45:39 AM
it used to be:

Mods/Core/Textures/Things/Pawn/humanoid, i.e:

Mods/Core/Textures/Things/Pawn/Humanoid/Heads/Male/Male_Average_Normal_front.png

I think that now should be humanlike...i think...ill check properly in a sec.
Title: Re: need help modding pawn body textures
Post by: keylocke on March 16, 2016, 09:56:10 AM
woot! thanks a lot guys.  ;D

Title: Re: need help modding pawn body textures
Post by: skullywag on March 16, 2016, 09:58:54 AM

private const string NakedBodyTextureFolderPath = "Things/Pawn/Humanlike/Bodies/";

public static Graphic GetNakedBodyGraphic(BodyType bodyType, Shader shader, Color skinColor)
{
if (bodyType == BodyType.Undefined)
{
Log.Error("Getting naked body graphic with undefined body type.");
bodyType = BodyType.Male;
}
string str = "Naked_" + bodyType.ToString();
string path = "Things/Pawn/Humanlike/Bodies/" + str;
return GraphicDatabase.Get<Graphic_Multi>(path, shader, Vector2.one, skinColor);
}


this.dessicatedGraphic = GraphicDatabase.Get<Graphic_Multi>("Things/Pawn/Humanlike/HumanoidDessicated", ShaderDatabase.Cutout);

private static readonly string[] HeadsFolderPaths = new string[]
{
"Things/Pawn/Humanlike/Heads/Male",
"Things/Pawn/Humanlike/Heads/Female"
};

private static readonly string SkullPath = "Things/Pawn/Humanlike/Heads/None_Average_Skull";


edit - there that should be all you need
Title: Re: need help modding pawn body textures
Post by: Fluffy (l2032) on March 16, 2016, 11:26:45 AM
quick note; you can't normally add head graphics - the game only looks in the vanilla resources. I made a mini mod a while back that changes this, it's part of MVP.
I'm not sure about body graphics, but there might be similar problems there.
Title: Re: need help modding pawn body textures
Post by: keylocke on March 16, 2016, 04:11:47 PM
it works.

(http://i.imgur.com/WsxFe12.jpg)

right now i'm still experimenting with the head sizes. but yep. progress is moving smoothly.

thanks a lot skully!  ;D
Title: Re: need help modding pawn body textures
Post by: keylocke on March 16, 2016, 06:57:03 PM
a bit more progress. (decided to maintain headsize)

(http://i.imgur.com/gtIMaaO.png)

anyways, i was planning to make different types of power armor, each gives different types of combat stat boost.

ie : power armor that boosts  :
-melee (improves melee combat)
-sight (improves ranged combat)
-movement (speed boost)

is this possible? which defs should i modify for this, and what tags should i use?
Title: Re: need help modding pawn body textures
Post by: Shinzy on March 17, 2016, 05:53:49 AM
Quote from: keylocke on March 16, 2016, 06:57:03 PM
anyways, i was planning to make different types of power armor, each gives different types of combat stat boost.

ie : power armor that boosts  :
-melee (improves melee combat)
-sight (improves ranged combat)
-movement (speed boost)

is this possible? which defs should i modify for this, and what tags should i use?

I'd keep that as a separate project =P
anyway!
look from thingdefs/apparel_various and apparel_hats

apparel various has the power armor def
and apparel hats have some examples of how to plop stat bonuses on things
(like how cowboy hat gives social boost)

all the stats you can plop on apparel can be found in StatDefs
Title: Re: need help modding pawn body textures
Post by: keylocke on March 18, 2016, 11:58:13 AM
thanks shinzy! also, yea. i think you're right. i should separate the additional power armors. i could probably just focus on the graphics pack.

(http://i.imgur.com/Iwe1Y9V.jpg)

right now i came into a bit of a snag. i based the arm positions based on the rifle's positions.
but it turns out that other weapons (especially melee and pistols) have varying positions.

so i'm currently in the process or readjusting the hands of the front and side bodies. (almost done now actually) will start to reskin the core apparels next.
Title: Re: need help modding pawn body textures
Post by: keylocke on March 18, 2016, 09:45:03 PM
so i started doing the apparel reskins, but i couldn't find the texture path for pants. i'm not even sure there's a "layer" for pants. (armor vest has it's own layer but can't seem to find pants layer).

(http://i.imgur.com/nJlA3KO.png)

can anyone advice me for a workaround on this? or should i just include pants/skirt graphics for bottom layer clothes like shirts?
Title: Re: need help modding pawn body textures
Post by: keylocke on March 19, 2016, 06:59:34 AM
anyways after several testing, it seems i can't combine skirts with dusters (the bottom part of the duster would cover the are skirt are)

bottom layer clothes must be "body fit" if it can be worn together with jackets, dusters, armored vests, and powerarmor.

(http://i.imgur.com/ZwqYZxs.png)
Title: Re: need help modding pawn body textures
Post by: Shinzy on March 19, 2016, 07:09:34 AM
pants don't have worn graphic by default
I added those for mine in apparello

the pants share the same OnSkin layer with shirts
It works cause they don't overlap with the area of coverage
tshirt covers chest and pants only legs

And you can make skirts if you have them be middle layer apparel
Power armors would shed skirts right off you, then and with dusters you'd just have
to make sure the skirt graphic stays under the duster "skirt"

Apparello armor pants     <worngraphicPath>Accessorello/Pants/Pants</worngraphicPath>
      <bodyPartGroups>
        <li>Legs</li>
      </bodyPartGroups>
      <layers>
        <li>OnSkin</li>
      </layers>


T-shirt       <bodyPartGroups>
        <li>Torso</li>
        <li>Shoulders</li>
      </bodyPartGroups>
      <worngraphicPath>Things/Pawn/Humanlike/Apparel/ShirtBasic/ShirtBasic</worngraphicPath>
      <layers>
        <li>OnSkin</li>
      </layers>




so you have to make def to overwrite the vanilla pants with the worn texture
Title: Re: need help modding pawn body textures
Post by: keylocke on March 19, 2016, 12:17:16 PM
wow! thanks shinzy. you're my hero.  ;D
Title: Re: need help modding pawn body textures
Post by: yusukenl on January 05, 2017, 11:18:43 PM
Hi, I am very new to modding, and not quite understand the codes posted above.
It would be great if someone could point where I should put those codes in, and how the files structure of the mod should like.
Thanks in advance!!
Title: Re: need help modding pawn body textures
Post by: tiltos on May 09, 2017, 05:53:27 AM
Quote from: keylocke on March 19, 2016, 12:17:16 PM
wow! thanks shinzy. you're my hero.  ;D

Sorry to revive a dead thread @keylocke, but how did you go with this? I'd love to have a look at your source files if possible. I'm keen to do some texture replacement on pawns and it looks like you've done the legwork (pun intented, as you solved the legs issue)
Title: Re: need help modding pawn body textures
Post by: keylocke on May 09, 2017, 08:36:04 PM
hmm.. it's been a long time since i abandoned this project. iirc, my last main snag was coz the weapons moved when shooting at different angles so the gun looks like it's floating rather than being held by the hands. <- this killed my enthusiasm.

as for the legs/pants/skirts/shorts thing, i just used shinzy's awesome apparelo mod as reference, so you should probably download his mod and use that as reference.
Title: Re: need help modding pawn body textures
Post by: tiltos on May 11, 2017, 09:10:52 AM
That's fair. I wonder if Fluffy's moddedhead file is floating around? I couldn't find it in MVP (which is long dead now).
Title: Re: need help modding pawn body textures
Post by: tiltos on May 12, 2017, 10:24:04 PM
Quote from: skullywag on March 16, 2016, 09:58:54 AM

private const string NakedBodyTextureFolderPath = "Things/Pawn/Humanlike/Bodies/";

public static Graphic GetNakedBodyGraphic(BodyType bodyType, Shader shader, Color skinColor)
{
if (bodyType == BodyType.Undefined)
{
Log.Error("Getting naked body graphic with undefined body type.");
bodyType = BodyType.Male;
}
string str = "Naked_" + bodyType.ToString();
string path = "Things/Pawn/Humanlike/Bodies/" + str;
return GraphicDatabase.Get<Graphic_Multi>(path, shader, Vector2.one, skinColor);
}


this.dessicatedGraphic = GraphicDatabase.Get<Graphic_Multi>("Things/Pawn/Humanlike/HumanoidDessicated", ShaderDatabase.Cutout);

private static readonly string[] HeadsFolderPaths = new string[]
{
"Things/Pawn/Humanlike/Heads/Male",
"Things/Pawn/Humanlike/Heads/Female"
};

private static readonly string SkullPath = "Things/Pawn/Humanlike/Heads/None_Average_Skull";


edit - there that should be all you need

Skully can you please give a little context to these snippets? Unfortunately I don't understand C#. I basically just want to allow the game to look at the mod's texture folder for heads and bodies (like it does for most other textures). Thanks!
Title: Re: need help modding pawn body textures
Post by: keylocke on May 13, 2017, 07:26:13 PM
you can use mods like advance bodies (for bodies), change 12 faces (for faces), rimsenal hair (for hair) as references. they will give you the correct filenames/texture paths.

old texture paths are probably outdated.

when i was making my body mod, i just placed it in vanilla folder since i'm not sure about releasing it coz it would have conflict with many clothing/hair mods, and i'm not sure i want the hassle of users complaining to me about it.

but yea, those 3 mods i mentioned above would be good references for custom body/face/hair, apparello mod for the clothing reference.

---

edit : i'm also planning on modding body/clothes/hair again using the style i used for my war orphans mod. i'll do it after i release my furniture/building/wall/floor/terrain/trees/etc.. texture pack. so i can probably help you out more and provide better examples when i start working on that. (coz i lost my PSD files for the custom body with arms/legs when i accidentally deleted old copy of rimworld several months ago)

here's what i got so far for the furniture mod.
(http://i.imgur.com/5oPXjEol.jpg) (http://imgur.com/5oPXjEo)
(http://i.imgur.com/uXuy71Hl.jpg) (http://imgur.com/uXuy71H)

the royal bed looks kinda fugly (will probably redo that) and i think i'll turn the hobo bed (sleeping spot) into a sleeping bag instead. will probably be done in around a week. (unless i get lazy again), then i can start doing custom body/hair/clothing mod

Title: Re: need help modding pawn body textures
Post by: tiltos on May 14, 2017, 12:24:03 AM
@keylocke I think that's why you haven't had the issues with the pawn textures - they're all okay in /core, however it gets a bit sketchy when in your own mod. I have bodies working for my Legs mod (turns out image filenames are case sensitive), however I can't get heads to work. So yeah, it's not the image names or paths - I uploaded the full A17 nested textures w/ paths a few days ago.

That said, I'll look into 'change 12 faces' as that might do the trick, thanks!

As for you furniture, it's looking great! Love the concept of having in-style wooden floors.
Title: Re: need help modding pawn body textures
Post by: Fluffy (l2032) on May 16, 2017, 03:29:02 AM
@keylocke; Damn, I love that style you've got going there. Would love seeing that in game!

One concern I do have is that it so different from vanilla, it kindof clashes? E.g. those trees look damn weird in the same 'world' as the floor (which is bloody lovely).

@tiltos; my lil' dll didn't help? You might want to poke in on the modding discord and ask there, there's several people who've been involved in this stuff hanging out there - including me.
Title: Re: need help modding pawn body textures
Post by: tiltos on May 16, 2017, 04:40:56 AM
@fluffy unfortunately I couldn't get your dll working! However, I did a full case-sensitive pass over all files and paths, and that did the trick.

After all that, I'm not sure I'm happy with the style direction I was going with, so put it on hold for a bit :)

(https://cdn.discordapp.com/attachments/215496692047413249/313173188794384384/unknown.png)
Title: Re: need help modding pawn body textures
Post by: Fluffy (l2032) on May 16, 2017, 07:43:40 AM
ah, right - looks like the underlying issue was resolved then. Btw, that dll was never going to work out of the box - it was for A12, and mostly meant to be decompiled and used as a guide.

I quite like the faces actually, but it wouldn't really make sense for pawns to permanently have the same expression - unless you were planning to switch faces for different moods?
Title: Re: need help modding pawn body textures
Post by: Shinzy on May 16, 2017, 08:59:48 AM
They remind me of a mash betweenOxygen not included and Android
Title: Re: need help modding pawn body textures
Post by: keylocke on May 18, 2017, 01:49:07 PM
@tiltos and shinzy : ooh yea. it looks like oxygen not included. i like the style of that. i actually bought that game as soon as i saw it and heard it was made by klei, who also created don't starve (which i also bought asap like rimworld). totally lurve the artstyle.

@fluffy : no worries about the clash with the trees and stuff since i plan to retexture the trees as well. (probably gonna retexture all except GUI)

here's a bit of progress.
(http://i.imgur.com/gXEy2sTl.jpg) (http://imgur.com/gXEy2sT)

there's a few things i realized after i made the powerplant retexture :

1) i used two-tone colors for the smaller furniture coz i thought i could get away with lazyness since items are too small.
2) i use camera plus mod, so zooming in is fun. problem was that large furniture and buildings like powerplant, long tables, etc.. look crappy with just two-tone colors, so i decided to make them look less potato.
3) i'm gonna have to recolor/redo the previous stuff i made and use this powerplant/metal floor as quality standard.
4) rimworld buildings/furniture have weird angles. some are completely topview, while some are a bit isometric, and some are completely flat side/front/back view. (just look at the wall and door..) maddening.. hahaha :o
Title: Re: need help modding pawn body textures
Post by: Fluffy (l2032) on May 18, 2017, 03:38:01 PM
Quoteprobably gonna retexture all except GUI
Good, leave that to me :P.

Quote4) rimworld buildings/furniture have weird angles. some are completely topview, while some are a bit isometric, and some are completely flat side/front/back view. (just look at the wall and door..) maddening.. hahaha :o
Couldn't agree more. Some of the old stuff in particular needs an artist to redo it. Maybe Tynan is waiting for a good modder artist to get so fed-up and redo it so he can use those textures for free/cheap? :P
Title: Re: need help modding pawn body textures
Post by: Shinzy on May 18, 2017, 04:36:06 PM
Ow the generator is beautiful! (although the angle on those meter things bother me quite a bit)

You don't burn out Key, I expect full overhaul from you :p
Title: Re: need help modding pawn body textures
Post by: keylocke on May 18, 2017, 05:03:32 PM
yea, those condom lightbulbs look too pointy coz of my bad. haha.  :P
i drew geothermal plant (top view) beside fuel generator (side view/slightly isometric) in my power room sketch and got confused with the angles.

i was gonna lazy pass on it if people didn't notice. (nuuuu..)

Title: Re: need help modding pawn body textures
Post by: tiltos on May 19, 2017, 01:39:13 AM
I was thinking about how to go about giving everything an angled top-down view (non-isometric, so like zelda or Ultima), however you're spot on - it's mainly the furniture that is 3/4 view, all the power & production units are directly top down (and don't have any rotational views. If you could add additional rotated views (like side view etc), I'd be interested in retexturing things to align to a unified perspective..
Title: Re: need help modding pawn body textures
Post by: Shinzy on May 20, 2017, 07:22:51 AM
Quote from: tiltos on May 19, 2017, 01:39:13 AM
I was thinking about how to go about giving everything an angled top-down view (non-isometric, so like zelda or Ultima), however you're spot on - it's mainly the furniture that is 3/4 view, all the power & production units are directly top down (and don't have any rotational views. If you could add additional rotated views (like side view etc), I'd be interested in retexturing things to align to a unified perspective..

In A17, with the patching you can (It would be a bit of a chore I admit but you still can!)
as in you could add the necessary codebits to vanilla things without overwriting them entirely
Title: Re: need help modding pawn body textures
Post by: minimurgle on May 25, 2017, 08:50:51 PM
Wow, looking good there Keylocke.

I'm still looking forward to this texture packs completion.