Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Cpt.Ohu

#271
Humanoid Alien Races



Description:

This mod contains a DLL which allows for creating humanoid alien races with unique graphics. Current features include:

             Features in 0.5
             - Custom head textures
             - Custom body textures
             - Custom skin colors
             - Custom hair colors
             - Custom gender distribution
             - Use of pawn-specific backstories

             New in 0.7
             - Forced Race traits
             - Race Restricted Apparel
             - Custom Backstories

             New in 0.8
             - Patch for Prepare Carefully

I tried to make it as modular as possible. Every part of the graphic set is defined in a Race ThingDef. Every entry that's left empy results in the use of vanilla assets.

For now, this is not a content mod and more of a framework to do your own modding. I have defined one example race, the reddish, horned Devilmen, just to show how the code is to be used (Look for the Devilman-Drifter in the console). Descriptions of each new ThingDef entry are included.

As of this version you can define colonists of your alien race that may be part of your starting party. It's based on a new PawnKindDef, an example is included in the mod.

The rest is up to your creativity: Fantasy races like Elves, Dwarves and Orks; Sci-Fi races like Asari, Klingons, Gungans ( :P ); eldritch beings like Deep Ones; or greenskinned and leaf-sporting mutants.

Just remember that this is for graphics only!

New Features

Race-restricted apparel:
A simple ThingComp that allows you to assign this piece of clothing to a specific race. Other race-members won't be able to equip it. This enables the creation of body- and head-types that can stray as far as you want from the vanilla shapes.

Race specific traits: You can define traits that EVERY member of this race WILL spawn with. This isn't ideal as it takes up a trait-slot, but since most traits that go in here will probably be rather powerful, I'd call the tradeoff acceptable.

Modified version of Prepare Carefully:
The patch I included is actually a standalone-version specifically for my framework, and only ONE version should be active at any time. It is near impossible to create a real patch, since the original code is focussed entirely on humans and defines a lot of stuff globally that had to be broken down to individual pawn level if anything other than humans are to be included.
DISCLAIMER: This also means that this version of Prepare Carefully is NOT compatible with presets of other versions. Your colonists won't be loaded in properly.

How it works
I'm detouring the GenSpawn spawn methods, which is the point where pawns are placed on the map. After a pawn is randomly generated by the game, my custom spawn method converts it into a subclass that updates the graphics according to the new entries in the race ThingDef. This has to be done because the base game locks certain pawn characteristics like skin color. These are still stored on the pawn, just not displayed.

As of 0.7, there are 2 new detours I had to include in order to keep everything working. First one is FloatMenuMakerMap.AddHumanlikeOrders, which enables race-restricted apparel. Second is InteractionWorker_RecruitAttempt.DoRecruit because the base code overrides any race-definition when a pawn is recruited, due to it being converted to the BasicMemberKind of the player faction.

Author/Mod Team
Cpt.Ohu

Downloads
Release 0.8 [A15]


Release 0.9 [A16]


Prepare Carefully Patch [A15]

No longer requires CCL:
The Detour-Code as well as the ability to add custom backstories is now part of the mod. Credits go to the creators of CCL and 1000101 in particular.

How to install:
- Unzip the contents and place them in your RimWorld/Mods folder.
- Activate the mod in the mod menu in the game.

Acknowledgements
Killface, joaonunes and Fluffy: Without looking into their injection code and approach to detouring, this mod would never have come to be (Mustaches are awesome)
Haplo: The framework for my custom pawn class is inspired by the MAI pawn and robots.
Erdelf: He was the one who started updating the mod for A16 before me and helped me in progressing.

EdB: Prepare Carefully is a gamechanger and in my view should really be included in the main game.

There may be snippets in the code that I haven't credited here because I can't remember whether they are from another mod, so please notify me if you find anything that needs to be mentioned.

Limitations / Things to do
I have no prior experience with C#; back when I learned programming, it was on Turbo Pascal. Because of that, the code is probably far from ideal. Some things have to be considered when creating custom graphics:

- Any base apparel in the game was designed for the vanilla body/head textures. So if you design a head or body that strays too far from the human form, you have to create new clothing for your pawns, otherwise there will be clipping.

Licence

As this is basically a helper-dll, you are heavily encouraged to use it for whatever ideas you're working on. Just mention that you've used this framework as a basis.

The source files are included, and you are free to edit whatever you like about them, especially if you want your custom pawns to have unique gameplay features.
#272
Unfinished / Re: [A14][WIP] Humanoid Alien Races
August 14, 2016, 02:27:12 AM
Yeah, I hastily put them together in like 5 min just to check if the code works, it's basically just a male body pinned on a deer  ;)
#273
Unfinished / [A14][WIP] Humanoid Alien Races
August 13, 2016, 07:37:45 PM
This project is probably going against established RimWorld lore by introducing something that has popped up now and again, yet has never been implemented in this fashion as far as I remember.

Humanoid Alien Races


While working on a Warhammer 40k Mod I ran into difficulties designing a custom Eldar race, since their lifespan is >1000 years, but obviously they came in greyhaired and riddled with disease due to being 10x over the human lifespawn when entering the world.

Trying to circumvent this original problem, I've started to create my own framework for not only implementing the very human-like Eldar, but for creating visuals for entirely new humanoid lifeforms.

Since I've seen people discussing Alien Races around here, I now intend to release my framework to the public so that everybody can create their own Humanoid Aliens.

Want to create a Mass Effect Mod starring Asari? Well, here you go:



Want to go bananas and fend off/play as centaurs? Knock yourself out:



It might also be useful for creating stuff like human mutants if you don't want to break the lore completely, or if you just want to switch out the base human textures.

Features
Note that this framework ist only concerned with graphics.


Custom Skin Colors
Pretty self explanatory. Have fun creating a race of red demons or greenskinned tree-people. So far they are based on a ColorGenerator (like Items). There may be more sophisticated ways, but for my needs this is sufficient.

Custom Hair
Custom colors based on a ColorGenerator. Also let's you decide at which average age your race should get grey hair or define them as hairless.
   
Custom Head & Body Graphics
Can be separately modified, as seen in the screenshots above. Heads are chosen randomly for now, a selection by gender will probably be implemented soon. Bodies are chosen according to BodyType, so Custom Backstories are (among other things) helpful for specifying the exact look of any pawn.

Additional Tweaks
Enables use of PawnKind-based backstory categories. This helps if you want to create a faction with specific pawn appearances based on background (e.g. traders are thin, warriors are all Hulks).

Set Gender distribution. Useful for creating an all male / female race.


How does it work?
I'm detouring the Genspawn.Spawn methods. The base pawn is generated as usual, picked up at the last second before entering the game world and converted into my custom alien pawn class.

Compability
I haven't done enough testing yet. However it should be compatible with all mods as long as they don't detour the same methods.

Release Plans
Right now the Assembly needs some cleanup and I want to create proper documentation for use by modders. Afterwards I will realese both the base DLL for modders that are just interested in the graphical aspect and the Source for people who want to implement additional features for their pawns.


Acknowledgements
Killface (and by proxy joaonunes & Simon; Fluffy): The Injection Method is based on their awesome mods.

Haplo: The basic framework for creating a Subclass of Pawns and updating their graphics is inspired by the AIPawns and Robots from his mod.


Finally, this is what drove me to start this mod in the first place.



Eldar of Alatoic fighting against a combined Gretchin/Orkboy/Orknob horde.
I'm also looking forward to releasing this Warhammer 40k themed expansion.