redeclipse / base

Base environment for Red Eclipse and associated source files.
https://redeclipse.net/
431 stars 88 forks source link

Dehardcode player bodies and skins, allow modding like vanity items #1427

Open MirceaKitsune opened 1 year ago

MirceaKitsune commented 1 year ago

Currently both the player body and skins are hardcoded in the game code. This makes modding them impossible unless the code is edited and recompiled. I suggest moving them to a flexible definition system to lift this major limitation.

This is exactly how vanity items are now defined, bodies / skins would ideally use the same system. Anyone can model an unique vanity item, configure its settings in a text editor, then share a zip which just works when placed in the data directory. Examples can be found in data/vanities and its package.cfg file.

The change would need to be reflected in the Player Setup menu: At the moment the choice between Male and Female is a set of two buttons. To allow custom body types it should be turned into a list instead: Default Male and Default Female would be the vanilla options, any mod adding a custom body type can inject new entries into that list. Same with skin mods which should be able to add new patterns into the picker.

Note that skins may need to specify which body models they belong to, as third party bodies would have different UV maps and base textures making the default skins incompatible... the skin chooser should filter entries based on which body is selected. Since custom bodies are expected to use the same rig or at least the same bone names if they come with custom armatures and animations, vanity items should still be universally possible to attach to any model... if visual inconsistencies arise they too can support filtering so certain vanities are only attachable to compatible bodies and heads.

MirceaKitsune commented 1 year ago

Something I just remembered: I believe SniperGoth shared screenshots of a full skeleton player for RE, was a while ago but it should be working just as well or easy to adapt. If something as unusual is considered too much to include in vanilla, it would be one of the readily available mods we can offer instead: At the moment it probably requires code editing to work, after the change we can adapt it and others to function as drag-and-drop mods.

SniperGoth commented 1 year ago

Something I just remembered: I believe SniperGoth shared screenshots of a full skeleton player for RE, was a while ago but it should be working just as well or easy to adapt.

Yes, i've imported anime characters made with Vroid Studio, Skeleton, other characters and a whole lot of things back to RE, specifically 1.x and 2.0 versions, as 2.0.1 dev divided them between body and head types, they don't work currently out of the box. I'd just need to adjust the location of the files and cfg to reflect them, if i would say. Skeleton: 20191008231110 20191012000011 20191012001811 Tesseract man: 20190816232711

Cube-man: 20191004220347 20190926141358

The most complicated model to import, by far, was something i made on Vroid Studio as an experiment, because it has a lot of materials, you have to separate a LOT of parts to make it work, so the cfg file of the model is a mess on itself: 20200419214148

The big issue with custom player models, is the way patterns are used with, so it's a better practice to not let the models use them, otherwise it becomes a mess of pixels and different colors overlapping.

MirceaKitsune commented 1 year ago

Yes, I remember them now! I think the skeleton might even be good enough to be in vanilla as a bonus, we have several wacky vanity items so why not... others don't seem fitting for default so they could remain simple mods. I presume they work in first person as well, for seeing your legs as you look down and the hands holding the weapon? Indeed the head was separated into its own item, wasn't sure if they were adapted and it's good to hear they are. When this change happens they can all be distributed via zip and finally possible to use in practice.

Regarding patterns, a proper implementation will require skins to specify which model they belong to: Pattern definitions should list the player models with which they have a compatible UV map, will only show in the picker when a fitting model is selected. Once patterns are moved to defs I presume a filter option would be easy to support.