So for those of you have no seen we held a game jam end of last year, you can see more in the Black Forge Jam thread for all of the projects.
I was part of the Medieval Menagerie team and was focused on adding support for showing dogs alongside humans in the game during those three days, since I am leaving the company soon I also got a bit of extra time to finish up the system itself so that we can add the mod support required for this even though we're not actually adding the Medieval Menagerie features into the game yet.
So in the next major patch, whatever the patch alongside Roads to Power gets called, you will have access to a new system for "portrait types" which allows you to do custom portrait models and genes for your own species.
The different portrait types will all work alongside each other, so you can have any number of portrait types and they'll be safe to render together without fully replacing each other. They can share a lot of things too so you do not need to re-script everything.
I'll say that again in big bold letters, the next patch will NOT contain animal portraits or any Medieval Menagerie features, just the systemic mod support to allow custom portraits.
So with that out of the way lets look at some dogs
The way I've set it up is that there are two new concepts, a portrait type and a portrait group, both of which are scripted in common/portrait_types.
A portrait group is something like "human", it controls what genes themselves are used for the portrait, color palettes, how to join the joints, and any other major changes that are not compatible with other setups.
Within a group there is multiple types, like male, female, boy and girl for the human group. These types are picked via age and sex, and they control more minor variations within a species and which head and torso entity to use.
So for the dogs I added during testing they are just one group with one type, if we later added bigger changes for puppies then maybe we add a second type for needing a different entity there.
By default things will be human, but you can change that via define.
We deal with the script in two ways, some types like the genes themselves define the portrait group they are for and then will be read into that group. For example here everything read into this morph_gene section will be for dogs.
eg:
The other way we do it is by reaidng into either a list of groups or types, with the option to specify a default first. You can also copy from other entries too.
If you've seen the portrait script you'll have seen the spam of female = male, girl = male, boy = male for something that is shared across the types, now you can just specify one as "default" which has the added benefit of then working for any other portrait types too (as long as what it applies actually works still).
eg:
The barbershop and ruler designer will also work for customizing different portrait types, there is a another database to control customization rules here now in gfx/portraits/customization_rules.
This is basically moving the existing ruler designer and babrershop defines into being scripted per portrait group.
The database will error if you define rules for an unknown group or if you miss defining rules for a group.
So for humans it looks like:
The portrait editor now also lets you pick groups as well so you can see different gene impacts there.
Another change to support this is now every character stores the ethnicity their portrait was generated with, as ethnicities now define the portrait group.
When a child is born it will randomise between their parent ethnicities as the base, else it picks from a random one in the culture creating the character.
In old saves we randomise from your current culture, which is what the game effectively did before anyway, and from then we'll save it for new characters.
If you change ethnicity via effect to one with a different portrait group we randomise your new DNA. Ethnicity can be scripted for created characters via effect and in history too.
So with all of that said and done mods should now be able to add their own custom species with a lot less pain and without needing to juggle everything on one shared asset.
My parting gift to the modding community, have fun with it when it comes out

I was part of the Medieval Menagerie team and was focused on adding support for showing dogs alongside humans in the game during those three days, since I am leaving the company soon I also got a bit of extra time to finish up the system itself so that we can add the mod support required for this even though we're not actually adding the Medieval Menagerie features into the game yet.
So in the next major patch, whatever the patch alongside Roads to Power gets called, you will have access to a new system for "portrait types" which allows you to do custom portrait models and genes for your own species.
The different portrait types will all work alongside each other, so you can have any number of portrait types and they'll be safe to render together without fully replacing each other. They can share a lot of things too so you do not need to re-script everything.
I'll say that again in big bold letters, the next patch will NOT contain animal portraits or any Medieval Menagerie features, just the systemic mod support to allow custom portraits.
So with that out of the way lets look at some dogs

The way I've set it up is that there are two new concepts, a portrait type and a portrait group, both of which are scripted in common/portrait_types.
A portrait group is something like "human", it controls what genes themselves are used for the portrait, color palettes, how to join the joints, and any other major changes that are not compatible with other setups.
Within a group there is multiple types, like male, female, boy and girl for the human group. These types are picked via age and sex, and they control more minor variations within a species and which head and torso entity to use.
So for the dogs I added during testing they are just one group with one type, if we later added bigger changes for puppies then maybe we add a second type for needing a different entity there.
By default things will be human, but you can change that via define.
We deal with the script in two ways, some types like the genes themselves define the portrait group they are for and then will be read into that group. For example here everything read into this morph_gene section will be for dogs.
eg:
Code:
morph_genes = {
portrait_group = dog
gene_age = {
dog_aging_1 = {
index = 0
dog = {
}
}
}
}
If you've seen the portrait script you'll have seen the spam of female = male, girl = male, boy = male for something that is shared across the types, now you can just specify one as "default" which has the added benefit of then working for any other portrait types too (as long as what it applies actually works still).
eg:
Code:
idle = {
default = {
default = { head = "idle_entry" torso = "idle_entry" }
AI_honorable = {
... more script
}
}
dog = {
default = { head = "idle" torso = "idle" }
idle_1 = {
animation = { head = "idle" torso = "idle" }
}
idle_2 = {
animation = { head = "idle" torso = "idle_2" }
}
idle_3 = {
animation = { head = "idle" torso = "idle_3" }
}
}
}
The barbershop and ruler designer will also work for customizing different portrait types, there is a another database to control customization rules here now in gfx/portraits/customization_rules.
This is basically moving the existing ruler designer and babrershop defines into being scripted per portrait group.
The database will error if you define rules for an unknown group or if you miss defining rules for a group.
So for humans it looks like:
Code:
human = {
default_age = 25
min_age_for_sexuality = 10
modifier_overrides = {
clothes = ruler_designer_clothes
weight = ruler_designer_overweight
weight = ruler_designer_underweight
muscularity = muscular
}
accessories = {
hairstyles = custom_hair
beards = custom_beards
}
sex_only_genes = {
female = { gene_bs_bust }
}
hidden_slider_genes = {
gene_bs_body_type
}
gene_groups = {
anatomy = {
body = full_body
head_neck = face
ears = face
face = face
nose = face
mouth = face
}
hair = {
hairstyle = face
beard = face
}
}
color_genes = {
hair = custom_hair
}
cloth_color = custom_clothes
}
The portrait editor now also lets you pick groups as well so you can see different gene impacts there.

Another change to support this is now every character stores the ethnicity their portrait was generated with, as ethnicities now define the portrait group.
When a child is born it will randomise between their parent ethnicities as the base, else it picks from a random one in the culture creating the character.
In old saves we randomise from your current culture, which is what the game effectively did before anyway, and from then we'll save it for new characters.
If you change ethnicity via effect to one with a different portrait group we randomise your new DNA. Ethnicity can be scripted for created characters via effect and in history too.
So with all of that said and done mods should now be able to add their own custom species with a lot less pain and without needing to juggle everything on one shared asset.
My parting gift to the modding community, have fun with it when it comes out
- 34
- 13
- 3
- 1