[MOD] Faithful 3D Animals

A curated forum for compatible and maintained mods. Users are unable to create new topics in this forum but can reply to existing topics. Please message a moderator to have your mod moved into this forum area.
User avatar
Shapur
Posts: 154
Joined: Wed Apr 21, 2021 5:11 pm
Location: Czech Republic
Contact:

Re: [MOD-wip] Faithful 3D Animals

Post by Shapur »

TheLacus wrote: Mon Sep 27, 2021 2:58 pm There are no billboards if they are replaced with injected models. If you want to make variations you can add a custom script directly to the prefab, just remember to add the ImportedComponent attribute to the script.

EDIT
I uploaded a very simple script that applies a random scale in a range. Feel free to include it with the mod or use it as a reference for something more advanced.
It's that simple? :D That's good to hear.

I3lessed: if you plan to upgrade the example script, I think it would be worth it to implement some sort of weight randomness, so you could for example occasionally see very big or small camels, but their size would generally stay around 1x.
Link to my github here.
And here is my nexus profile.

User avatar
Ninelan
Posts: 187
Joined: Wed Jun 30, 2021 10:30 am
Location: Under your bed
Contact:

Re: [MOD-wip] Faithful 3D Animals

Post by Ninelan »

OH yee, so skins too, this is going to be delicious. Thank you TeLacus and l3lessed!

l3lessed> I'll give you access to my drive where I keep extra textures. I happen to have a few recolours on hand for horses when I was just making the model, and some more I did try to imitate the 3D enemy horse colours.
I also made some gnarly camel recolours a few days ago because the best way to see if something changes is with gnarly colours :lol:
You can support me and in turn my art on my Patreon.
https://www.patreon.com/fireflyness

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD-wip] Faithful 3D Animals

Post by l3lessed »

I3lessed: if you plan to upgrade the example script, I think it would be worth it to implement some sort of weight randomness, so you could for example occasionally see very big or small camels, but their size would generally stay around 1x.
Was planning on messing with this, along with their direct vector3 sizing. I wanted to try to make the smaller animals look a little more young like through portion changes.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
Ninelan
Posts: 187
Joined: Wed Jun 30, 2021 10:30 am
Location: Under your bed
Contact:

Re: [MOD-wip] Faithful 3D Animals

Post by Ninelan »

l3lessed wrote: Mon Sep 27, 2021 5:56 pm
I3lessed: if you plan to upgrade the example script, I think it would be worth it to implement some sort of weight randomness, so you could for example occasionally see very big or small camels, but their size would generally stay around 1x.
Was planning on messing with this, along with their direct vector3 sizing. I wanted to try to make the smaller animals look a little more young like through portion changes.
Before we get completely carried away by the sheer possibility of simulating different ages of animals if not even regional breeds and whatnot lol.

I can actually pretty easily do models for the babies, so they'd look accurate proportion-wise and cute. All it takes is me just reshaping the adult into the baby form, bada bing, bada boom, you got yourself a cute little leggy baby.
You can support me and in turn my art on my Patreon.
https://www.patreon.com/fireflyness

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD-wip] Faithful 3D Animals

Post by l3lessed »

I'm trying your ImportComponent method, and it isn't working. I'm sure I'm being dumb and overlooking something simple, and I'm to use to manually scripting in everything.

I created a new mod that is a direct replica of the original mod and called it Varied Faithful 3D Animals.
I then copied all the content over to the new Varied Faithful 3D Animals, compile, and test run it. Everything loads as should like normal mod.
I then copy the scaler script into the assets folder, attach it to the animal prefab as a script component, and then recompile and load the mod.
When I load the mod, go into the scene, and check the pig prefabs, which are the ones with the rescaler attached, it isn't showing the attached script.

The script language isn't changed at all. Do I need to add an initialization script method to load the the script file before the import component?

I was under the impression with the [ImportedComponent] above the MonoBehavior would be enough, but now I'm thinking we need the usual script initialization before the [ImportedComponent], so the engine is aware of the script.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD-wip] Faithful 3D Animals

Post by l3lessed »

Before we get completely carried away by the sheer possibility of simulating different ages of animals if not even regional breeds and whatnot lol.

I can actually pretty easily do models for the babies, so they'd look accurate proportion-wise and cute. All it takes is me just reshaping the adult into the baby form, bada bing, bada boom, you got yourself a cute little leggy baby.
This would be harder to do I believe because it would require a new flat type to be able to tell the difference between adult and child flats. The base engine just has flats, and after that, everything else is decided really by the texture for the flat. The other issue comes with also connecting the animations. Each flat needs its own animation file, so again, how would we create separate animations for child models when there is no predefined flat for them?

This would have to all be done within the script file to figure out on initialization. It would require a script the, one a certain chance, replaces the default pig model and connect animation prefab with the child one.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
Ninelan
Posts: 187
Joined: Wed Jun 30, 2021 10:30 am
Location: Under your bed
Contact:

Re: [MOD-wip] Faithful 3D Animals

Post by Ninelan »

l3lessed wrote: Mon Sep 27, 2021 7:18 pm
This would be harder to do I believe because it would require a new flat type to be able to tell the difference between adult and child flats. The base engine just has flats, and after that, everything else is decided really by the texture for the flat. The other issue comes with also connecting the animations. Each flat needs its own animation file, so again, how would we create separate animations for child models when there is no predefined flat for them?

This would have to all be done within the script file to figure out on initialization. It would require a script the, one a certain chance, replaces the default pig model and connect animation prefab with the child one.
Flats are even easier to do! Especially since the animals aren't all that complex in shading nor colouring compared to trees and the like. :D They're barely animated too.
(when it comes to art and the like I mean)
You can support me and in turn my art on my Patreon.
https://www.patreon.com/fireflyness

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD-wip] Faithful 3D Animals

Post by l3lessed »

Yeah, I mean, we have to have a specific type of flat for the model type. As an example, there are two flats for the pig and you have two models to replace them. This means the default variation maxes out at two pig types, since we only have two flat textures to pick from in original game; the raised and lowered flats.

So, you could turn one of the flat types into a child and the other into an adult, and then yes, you have a child and adult now, but now you have all adult pigs and all child pigs with aligned animations since there are no longer the head up and down variation in default. So, then you would have to ensure the model animation started at different places, so each model had unique animation timing and didn't all sync up.

As for the ImportedComponent issue, I think I'm just compiling the base prefab wrong. I noticed the prefab is connected to a fbx prefab setting file that uses the armature object to get all the components. I imagine I need to add the script file to this object, like the model and material is, and then recompile the prefab with the new added script compiled into the fbx setting file?
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

l3lessed
Posts: 1399
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD-wip] Faithful 3D Animals

Post by l3lessed »

I attached the script, and it is working. Now time to try skin variations.

The question is, do you want to me to create a dynamic skin script that uses the streaming texture directory, so anyone can add textures on the fly.

It would scan the directories based on flat type. So, if it is a pig, it will go into streaming textures/3d animals/pig, scan the folder for all texture files, create a quick list of them, and then when the model is created, randomly choose from that array. The benefit of this method is anyone can add texture/skins for the animals without needing to recompile the mod itself. It would also make adding more skin variations as easy as people sharing and dropping the textures into the proper folder.

The other method is more straight forward, and that is create a predefined list of textures for the specific model using the GetAsset combined with a list object, and then load the variations directly from the saved mod file assets. The benefit is it stays in house, requires less scripting work, and minimizes possible bugs coming up from poorly constructed scripts.

I always prefer the streaming method, as I always like to give users as much freedom and control as I can.
My Daggerfall Mod Github: l3lessed DFU Mod Github

My Beth Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

Enjoy the free work I'm doing? Consider lending your support.

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: [MOD-wip] Faithful 3D Animals

Post by TheLacus »

l3lessed wrote: Mon Sep 27, 2021 7:15 pm I'm trying your ImportComponent method, and it isn't working. I'm sure I'm being dumb and overlooking something simple, and I'm to use to manually scripting in everything.

I created a new mod that is a direct replica of the original mod and called it Varied Faithful 3D Animals.
I then copied all the content over to the new Varied Faithful 3D Animals, compile, and test run it. Everything loads as should like normal mod.
I then copy the scaler script into the assets folder, attach it to the animal prefab as a script component, and then recompile and load the mod.
When I load the mod, go into the scene, and check the pig prefabs, which are the ones with the rescaler attached, it isn't showing the attached script.

The script language isn't changed at all. Do I need to add an initialization script method to load the the script file before the import component?

I was under the impression with the [ImportedComponent] above the MonoBehavior would be enough, but now I'm thinking we need the usual script initialization before the [ImportedComponent], so the engine is aware of the script.
The attribute is enough, you don't need an Init method. Did you add the script to the list of assets? Otherwise the new MonoBehavior class is not known at runtime.

Post Reply