Is there a way to hide NPC billboards?

Discuss modding questions and implementation details.
Post Reply
concarne
Posts: 6
Joined: Fri Apr 19, 2019 12:34 am

Is there a way to hide NPC billboards?

Post by concarne »

Hello to everyone here, congrats to everyone on their work so far on DFU. I'm having a blast!

First off I'm a dabbler in game development, have made a lot of systems but never a full game, so I thought I might apply myself to modding this project to actually get something out there for a change. I think I'd rate as somewhere between beginner and intermediate.

I've just started to make a mod to replace (mobile) NPCs with 3D models. Has anyone else played with this yet? I've found that at the moment mobile billboards cannot be hidden as it is now due to the concealment code always setting the MeshRenderer either off or on, and I'd rather not strip away components as it would be good to keep the engine running as it should especially if another mod relies on something.

I've found adding a simple check into EntityConcealmentBehavior.cs would be a very simple way to allow modders to hide the billboard

Something like

Code: Select all

        // Concealed by engine not including force concealment
        private bool isConcealed = false;

        public bool IsConcealed
        {
            get { return (isConcealed); }
        }

        // Override any concealment to force billboard to always be hidden
        public bool forceConcealment = false;


. . .

Code: Select all

            isConcealed = (entityBehaviour && entityBehaviour.Entity.IsMagicallyConcealed);
            MakeConcealed(isConcealed || forceConcealment);

Is there another way to do this? Is this the right place to ask for this kinda thing. I'm not the most confident programmer so I don't want to clog DFU's github.

Any help much appreciated!

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

Re: Is there a way to hide NPC billboards?

Post by l3lessed »

I do not know 3d development or art design, but this does not seem like the proper way to go about this.

Why are you using a built in conceal effect, which I'm sure is being used for things like invisibility? Even if this works, this will probably break mechanics by making the engine think npcs are invisible when they are not since you're hijacking the conceal effect.

Shouldn't the sprites be complete removed, and then replaced with 3d models and meshes, so there are no longer 2d sprites at all? We need to replace the sprites with 3d models, not hide them and then ram in models on top of them.

However, there are artists on this forum who can answer this much better than I. Either way, keep up the great work. I'm dying for 3d models. That would really make my combat mod have more to it, as 3d models can do more than 2d sprites.

You are also going to have to explore how to setup and import 3d animations. Currently, the animation system, at least in the FPSWeapon script and other things I have seen, is pretty simple timed loop that retrieves and updates the frame with the next image in the animation file. Point being, there isn't really any 3d or 3d animation system setup yet, and this is what is needed.
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.

concarne
Posts: 6
Joined: Fri Apr 19, 2019 12:34 am

Re: Is there a way to hide NPC billboards?

Post by concarne »

I think hiding the billboard is a good way to avoid breaking the system for other mods, as it is I think having a concealed billboard that doesn't update it's texture is a very negliable amount of resources. The code I put there means that anyone can reference whether the engine has concealed the billboard be it magic or distance culling, and then conceal the 3D model by the engines decision (public IsConcealed)


As for animation I haven't looked thoroughly through the system used but due to the fact that DFU uses deltaTime and has timers it should be reasonably easy to interpolate animations through the time between the frames changing.


Player/enemy animations are a future problem for me. I've just created a paperdoll and mobile citizen replacer so far. The easy stuff

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

Re: Is there a way to hide NPC billboards?

Post by l3lessed »

Oh, thanks for the explanation. That makes sense. I thought you were leveraging an already created conceal code/effect.

I can't wait to see it develop.

I may join you in this area at some point. Once, I get combat coding overhaul done, I was thinking about looking at replacing first person sprite with a 3d model rig next. However, hesitant, since I would be learning from scratch. Not a artist in any real sense of the word.
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.

concarne
Posts: 6
Joined: Fri Apr 19, 2019 12:34 am

Re: Is there a way to hide NPC billboards?

Post by concarne »

Well the thing is I'm a mediocre artist at best myself, but I have made a skinning tool in the mod so anyone should be able to easily "attach" their clothes models without worrying about skinning or blendshapes - so essentially someone who is actually good at modelling could make a model pack for my mod. Or potentially I could team up with someone who could just replace the ones I make included in the mod.

In regards to viewmodels - I'll be sure to have a read through your thread to see how you going about things, and we can see if we can link the two in the future (or I'll put an option to hide mine out of the way :P )

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Is there a way to hide NPC billboards?

Post by Hazelnut »

The NPCs in buildings are disabled by setting the billboard gameobjects to inactive. I just submitted a PR to have them come back if you rest inside, you might find it interesting https://github.com/Interkarma/daggerfal ... /pull/1466
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

concarne
Posts: 6
Joined: Fri Apr 19, 2019 12:34 am

Re: Is there a way to hide NPC billboards?

Post by concarne »

Hmmm I didn't realize those billboards toggle too. That will be another problem later down the track when I tackle those.

The mobile NPC are calculating their concealment every frame and forcing the Mesh Renderer to be on, so it stuck out to me more.

Maybe I'll just crack on and get further in development and a make note of changes to the core I'd hope to be implemented when I'm ready to make a first release.

Cheers

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

Re: Is there a way to hide NPC billboards?

Post by l3lessed »

If you have any questions about the current combat or animation system and how it all runs, just le me know. I've figured out the vast majority of how the FPSWeapon and WeaponManager script work to run animations and combat. I'll be looking at enemy script files next to get a grasp of how the engine is handling their side of combat.
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.

james2k
Posts: 9
Joined: Wed Dec 04, 2019 8:16 pm

Re: Is there a way to hide NPC billboards?

Post by james2k »

You'd have to model dozens of different articles of clothing too, and then for consistency the monsters too. Not sure if this is really feasible.

Post Reply