[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.
l3lessed
Posts: 1403
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD-wip] Faithful 3D Animals

Post by l3lessed »

Thanks for the reply lucas. I got it. Because I don't use prefabs a ton, I wasn't opening and attaching the script the proper way before recompiling and checking the mod.
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 8:30 pm 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.

I think letting other people mix and match would be great.
I've actually been thinking to make the mod have its textures exposed for the full release and append a folder containing all the various texture-alts people could mix and match to their heart's content.

What you're suggesting is even better, so people could basically curate their own mix and matches of textures they want, and how many variants they want for the designated animal model?
I'll start making up some solid colours to work off.
You can support me and in turn my art on my Patreon.
https://www.patreon.com/fireflyness

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

Re: [MOD-wip] Faithful 3D Animals

Post by l3lessed »

Yeah, if it works how I would like, that is the idea. If it is as easy as grabbing and modifying the attached render and texture objects, like in my minimap mod, shouldn't be an issue.

It would work exactly that way. The folder would pretty much become a dynamic array for the assigned animal textures, and as textures were added, it would populate the array, which would then provide the new textures for the models in game.

I'm doing this, in a very basic form in my minimap mod right now with blood, dirt, and other effect overlays for the glass I added to the compass. Users merely add new effect textures to corresponding folder, and the compass will automatically pull them randomly when it is adding said affect to the compass hud overlay.

Also, I got ahead of myself and began putting together a basic roaming routine for the models. Could you create a very quick walking animation for one of them, so I can see if I can get it working with this new behavior? If I can get the walking to work, I'm going to add a switch for different behavior/animation sequences starting with basic roaming and then adding things like grazing, resting, exploring. Each state will modify the pathfinding code and use whatever animations I can be provided.
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: Tue Sep 28, 2021 4:23 pm Yeah, if it works how I would like, that is the idea. If it is as easy as grabbing and modifying the attached render and texture objects, like in my minimap mod, shouldn't be an issue.

It would work exactly that way. The folder would pretty much become a dynamic array for the assigned animal textures, and as textures were added, it would populate the array, which would then provide the new textures for the models in game.

I'm doing this, in a very basic form in my minimap mod right now with blood, dirt, and other effect overlays for the glass I added to the compass. Users merely add new effect textures to corresponding folder, and the compass will automatically pull them randomly when it is adding said affect to the compass hud overlay.

Also, I got ahead of myself and began putting together a basic roaming routine for the models. Could you create a very quick walking animation for one of them, so I can see if I can get it working with this new behavior? If I can get the walking to work, I'm going to add a switch for different behavior/animation sequences starting with basic roaming and then adding things like grazing, resting, exploring. Each state will modify the pathfinding code and use whatever animations I can be provided.
It keeps evolving!
You're in luck, all models but the cat are already in possession of those animations...Been doing them as I was already making them for the enemy animals, so why not for all?
I'll export the camel and horse...for now to play around with; with their animations intact. the Og fbx for the mod were intended to just have the idle animation presenting, that's why I removed them for cleanliness of the export.

I put them in the root directory for now.
You can support me and in turn my art on my Patreon.
https://www.patreon.com/fireflyness

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 »

l3lessed wrote: Tue Sep 28, 2021 4:23 pm Yeah, if it works how I would like, that is the idea. If it is as easy as grabbing and modifying the attached render and texture objects, like in my minimap mod, shouldn't be an issue.

It would work exactly that way. The folder would pretty much become a dynamic array for the assigned animal textures, and as textures were added, it would populate the array, which would then provide the new textures for the models in game.

I'm doing this, in a very basic form in my minimap mod right now with blood, dirt, and other effect overlays for the glass I added to the compass. Users merely add new effect textures to corresponding folder, and the compass will automatically pull them randomly when it is adding said affect to the compass hud overlay.

Also, I got ahead of myself and began putting together a basic roaming routine for the models. Could you create a very quick walking animation for one of them, so I can see if I can get it working with this new behavior? If I can get the walking to work, I'm going to add a switch for different behavior/animation sequences starting with basic roaming and then adding things like grazing, resting, exploring. Each state will modify the pathfinding code and use whatever animations I can be provided.
Soo, the city building mod is getting delayed? :)
This sounds way more promising than what I thought could be done.
Link to my github here.
And here is my nexus profile.

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

Re: [MOD-wip] Faithful 3D Animals

Post by l3lessed »

Not delayed. Synergized. A massive part of the city building mod will need good pathfinding and object detecting for the npcs. You will need to be able to order around your citizens, so they can build and assist with tasks in the city.

I'm using this as the base to begin that work. It just happens that this mod has an overlapping need with my mod already. Developing the basic roaming pathfinding and other pathfinding behaviors for this mod will help me construct my city building mod much quicker.

Which, the most very basic roaming is in now. Animals will have a set roaming radius from their spawn point. From there, they will wonder around this area, randomly shooting out spherecasts to detect where they can go and stop them from wandering into solid objects. I haven't tried coupling the animations with this yet. Need to do more looking into this.

Also, with wandering behavior in, it is clear, the 3d animals will need a mesh collider so they don't walk through one another. With flats, this isn't nearly as jarring as seeing 3d cows and pigs phase through one another. I'm unsure about 3d models and collision meshes though. Can unity create one from scratch or does the model maker need to create one for the specific model?

I guess I could always use a basic engine level square mesh collider sized to the model for now.
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: 1403
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD-wip] Faithful 3D Animals

Post by l3lessed »

First iteration of varied textures, sizes, and roaming parameters is in. I'm going to put this up on my github as a extension project for now, if that is okay? I'm going to have to setup an initialization master script and other things, so it feels easier and better to track it under my github as a separate expansion of this mod. If you want to take it back after completion and release it under a joint credit/joint mod release under both our names, that is cool. Is that okay with you?

Some things already noticed, but I can resolve:
  • Counting all the texture files, loading them through a load routine, and dumping them into an array for easy retrieval is not a low CPU process. As a result, load times of your first game loading are noticeably longer.
    • Create a single control master script for running these processes in the background, separate from the flats and their attached scripts. This will allow the texture population to execute on game launch and should be much more efficient doing it this way and not at scene creation time.
      This will also remove the duplicate code and arrays being created by every flats individual attached script.
  • Roaming code needs further work for both optimization and smarter roaming.
    • Currently using a set 2 second timer between retrieving a new move location once done with previous move. I could optimize this further to adjust based on player fps and possibly other factors to try and limit raycast and calculations for roaming.
    • Randomly shoots out a ray in a 360 degree circle to find a new roaming location within the bounds allowed. This could be improved to consider the last position of the animal, their facing direction, and objects around them without to much more code lines and demand.
    • Anyone else know of good ways to optimize something like pathfinding code?
  • Models phase through each other because of a lack of collider mesh to detect when another model is in there way. This creates very jarring visuals that were not noticeable with flats as much.
    • Just get a collider mesh attached to the models so other animal models that are roaming and the player will not phase through them giving the 3d models a real life feeling.
  • Smaller models need to be size in a more unique way to make them appear more childish in appearance and not merely miniaturized collectables of the full sized ones.
    • Easiest way to do this is merely create a custom model scale setting for any models under a certain scale size and than apply it. Would make them little shorter, fatter, and stumpier by adjustingin the x,y,z scale values as needed.
    • The better solution is mentioned by mod developer, but would require more scripting. The modelers create a unique model and animation set for children versions of animals, and then the script is setup to swap out a certain random percentage of the animal models to the child ones on creation. Again, the models would need to be loaded by a master script on game launch to minimize load time and cpu calls while playing.
I'm so tempted to add a health property to their attached script and allow players to kill animals, because why not. Guess should focus on more important stuff first though. me and my ADD tendencies.
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: Tue Sep 28, 2021 9:39 pm First iteration of varied textures, sizes, and roaming parameters is in. I'm going to put this up on my github as a extension project for now, if that is okay? I'm going to have to setup an initialization master script and other things, so it feels easier and better to track it under my github as a separate expansion of this mod. If you want to take it back after completion and release it under a joint credit/joint mod release under both our names, that is cool. Is that okay with you?

Some things already noticed, but I can resolve:
  • Counting all the texture files, loading them through a load routine, and dumping them into an array for easy retrieval is not a low CPU process. As a result, load times of your first game loading are noticeably longer.
    • Create a single control master script for running these processes in the background, separate from the flats and their attached scripts. This will allow the texture population to execute on game launch and should be much more efficient doing it this way and not at scene creation time.
      This will also remove the duplicate code and arrays being created by every flats individual attached script.
  • Roaming code needs further work for both optimization and smarter roaming.
    • Currently using a set 2 second timer between retrieving a new move location once done with previous move. I could optimize this further to adjust based on player fps and possibly other factors to try and limit raycast and calculations for roaming.
    • Randomly shoots out a ray in a 360 degree circle to find a new roaming location within the bounds allowed. This could be improved to consider the last position of the animal, their facing direction, and objects around them without to much more code lines and demand.
    • Anyone else know of good ways to optimize something like pathfinding code?
  • Models phase through each other because of a lack of collider mesh to detect when another model is in there way. This creates very jarring visuals that were not noticeable with flats as much.
    • Just get a collider mesh attached to the models so other animal models that are roaming and the player will not phase through them giving the 3d models a real life feeling.
  • Smaller models need to be size in a more unique way to make them appear more childish in appearance and not merely miniaturized collectables of the full sized ones.
    • Easiest way to do this is merely create a custom model scale setting for any models under a certain scale size and than apply it. Would make them little shorter, fatter, and stumpier by adjustingin the x,y,z scale values as needed.
    • The better solution is mentioned by mod developer, but would require more scripting. The modelers create a unique model and animation set for children versions of animals, and then the script is setup to swap out a certain random percentage of the animal models to the child ones on creation. Again, the models would need to be loaded by a master script on game launch to minimize load time and cpu calls while playing.
I'm so tempted to add a health property to their attached script and allow players to kill animals, because why not. Guess should focus on more important stuff first though. me and my ADD tendencies.
Yeah, absolutely, it should be its own mod, considering how massive your contributions are, it's no longer a simple billboard to 3D model replacer, it's 'Living Animals of Daggerfall' co-op mod now.
This branch should also probably be appropriately named 'Lively 3D animals' or something similar to signify that the animals are more 'lifelike' in this version, as they move around, making Daggerfall feel a little bit more lifelike than it was before?
Though the variable colour variants would still come useful in the simple billboard to 3D replacement version of the mod-for those that like it small and simple, with a dash of extra customisation.
  • Colliders can be added via unity, shapes like capsules and spheres etc. can be utilised to make quick and easy collisions. There's also an option I can't remember where I saw, where it generates custom colliders off the mesh, but that makes a too complex collider!
  • There is a third method to perhaps solving the scaling issue of babies.
    The babies could just be a shape key of the adult form, This means that there is a smooth transition between the 'adult' and 'baby' form that can be controlled by it, so an animal that's scaled 50% between minimum and maximum would have 'yearling' proportions. While a bigger baby looks older than a smaller baby, and a smaller adult looks like a younger adult.
    -Only issue is I'll probably need some of that dark magic to mess with the armature compatibility. (animals will still need to be scaled along with the shape key I think, depending on what I do with the armature issue)
Hehe, health bar for the animals, except for extra interactivity, might be useful for compat with other mods, like providing food/leather for the town or yourself. And maybe getting on the bad side of the law! But ye, it's not that necessary or important atm.

Anyway, I'll continue working on adding the walking animations to the cat, and maybe some other animations too while I finish the colour morphs for the remaining animals.
Pigs, camels, dogs, cats and seagulls are currently lacking variants. Gonna work on pigs today. Some will be 'furry' others will be 'muddy'.
You can support me and in turn my art on my Patreon.
https://www.patreon.com/fireflyness

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

Re: [MOD-wip] Faithful 3D Animals

Post by l3lessed »

Master script is in, and long load times are gone.

To help with minimizing script load, I plan on making a script for each animal type, so there are no redundant code ran on the scripts. Only checks and code for that specific animal type will run, which should minizines script hits and can make a difference if the scripts begin growing with more feature needs and demands.

However, I am running into an odd bug I can't sort out script side.

When I add my script to the horse prefab, it will only attach the script to a single horse flat and then stops with all other horses.

I tried attaching the same script to both pig prefabs, and this bug was not replicated. All pigs took on the new textures, rescaled, and started roaming.

To me, this says there is something going on specifically with the horse prefab, and I do not know what.
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: 1403
Joined: Mon Aug 12, 2019 4:32 pm
Contact:

Re: [MOD-wip] Faithful 3D Animals

Post by l3lessed »

Okay, the above bug seems to happen on any model that has more than one skinned mesh model. Aka, Horse and cow so far. I bet the camel will do it too.

I'm pretty sure it has to do with the skinned mesh renderer loop I'm using. The loop, when applying it to the model that has multiple sub parts with skinned mesh renderers must be hitting a null check or bug some where that isn't in the simpler models, like the pig. Need to dig around more. The odd thing is there are no null or console errors pumping out to indicate any issue. I also am confused, because I thought a new script would be created for each flat no matter what. But, when checking through the differing horses and cows, only the first one has the attached script showing on it. Any ideas?

I also updated the master script. Now any png file, with any name, will be pulled into the random texture array for that animal. No need to worry about naming standards causing issues or crashes. It will only grab .pngs and nothing else when loading. This also sped up the texture loading some.

Also, are animations working on the base mod? My mod doesn't have any animations going on. Am I needing to get this implemented script wise?
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.

Post Reply