(REALIZED IDEA) Equipped torch casts shadows same as the spell "Light"

Talk about the mods you'd like to see in Daggerfall Unity. Give mod creators some ideas!
Post Reply
User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

(REALIZED IDEA) Equipped torch casts shadows same as the spell "Light"

Post by King of Worms »

So when I cast a "light" spell, the light produced casts shadows all around including the world geometry (like walls) and I like that.
01.jpg
01.jpg (366.77 KiB) Viewed 2471 times
When I equip my torch, the light casts shadows from sprites, but not from world geometry.

Is it possible to change that?

It could be either a option in the game (Torch casts geometry shadows ON/OFF)

OR

A mod script ppl can use. Id like to include such script in my DREAM mod, it would be great!

Also, a detail. When you cast "light" the light source is kind of moving and that makes the shadows jump around.
This effect is too strong. But if it was reduced to 50 or 25% it could produce realistic torch light, because that light is not 100% static in real life neither.

Thanks a lot for consideration :)
Last edited by King of Worms on Sun May 02, 2021 6:12 pm, edited 1 time in total.

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

Re: IDEA: Equipped torch casts shadows same as the spell "Light"

Post by Hazelnut »

Hmm, I can't believe I never noticed that! :)

Not sure how to enable this, but i will try.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: IDEA: Equipped torch casts shadows same as the spell "Light"

Post by King of Worms »

Hazelnut wrote: โ†‘Mon Feb 01, 2021 4:21 pm Hmm, I can't believe I never noticed that! :)

Not sure how to enable this, but i will try.
Great ๐Ÿ˜Š

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: IDEA: Equipped torch casts shadows same as the spell "Light"

Post by Ralzar »

Oh wow, I always felt that the light spell was more atmospheric, but I never knew quite WHY until now :D

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

Re: IDEA: Equipped torch casts shadows same as the spell "Light"

Post by Hazelnut »

So having taken a look into this, I actually did notice this at the time but after reading your post didn't put 2 & 2 together until looking inside unity tonight.

The player torch does cast shadows off the static geometry, but due to it's position relative to the player camera you don't really see them. Basically the relative positions of the torch light and the camera ensure they are rarely visible.

The magic candle on the other hand floats in front of the player so it's much easier to get cast shadows like in your picture.

What I've done is to offset the player torch light source game object if item based player torch is active - I don't want to affect the normal player light at all. It's slightly forward and to the left as well as a bit higher.

Code: Select all

torchLight.transform.position = new Vector3(-0.3f, 1.2f, 0.2f);
This simulates holding torch in left hand, slightly to left and forward, as well as above the eyeline. Lets not get into how this would work for 2h weapons, bows and shields etc.

So now you'd see shadows but only from left/above. See example:

torchBefore.JPG
torchBefore.JPG (94.83 KiB) Viewed 2294 times
torchAfter.JPG
torchAfter.JPG (96.3 KiB) Viewed 2294 times
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: IDEA: Equipped torch casts shadows same as the spell "Light"

Post by l3lessed »

Beautiful job. Looks more realistic. Technically, if someone wants to give me a good enough sprite set for a animated torch being held, I could add it into the FPS render system in ambidexterity so torches show being held.

As for two handed weapons, I thought about this some. I plan on hitting this after first release of my ambidexterity mod. It wouldn't be hard to shift the idle sprite offsets for two-handed weapons, so they are positioned more center or center left to signal visually two-handed stances. Add a quick pull down/back animation (or not), and then run normal attacks. Same with small blades; I plan on resizing them to reflect blade size better.
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
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: IDEA: Equipped torch casts shadows same as the spell "Light"

Post by King of Worms »

Great job Hazelnut ๐Ÿ˜Š in my mind I always imagined holding the torch in my right hand, eventho it makes no sense as there is usually a weapon (but with 2h it doesnt make sense in either hand and its no problem as well) I just hope this change will not trigger my ocd about it ๐Ÿ˜‚ I think I will test it and hope for the best indeed. Will report back asap. Left/right switch in options would be nice, but the options are already full basically..

I can try to provide the animated sprites based on ingame art 3lessed... question is, in which hand it will be held ๐Ÿ˜‚

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

Re: IDEA: Equipped torch casts shadows same as the spell "Light"

Post by l3lessed »

Ha king. If I had art for each hand, I could possibly add it as an option to the mod to have torch switch hands or disappear on duel wield. Or I can code flip the art myself, as I have done for weapons and animation smoothing. It is just harder than loading a new sprite.

Still plan on dream patches in near future. Once wrap up this final test release of smooth animations to ambidexterity module, I will work on patching it for Dream weapons, and the dream shields you gave me.
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
King of Worms
Posts: 4752
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: IDEA: Equipped torch casts shadows same as the spell "Light"

Post by King of Worms »

Completely forgot about the 1st person handheld torch - will add it to my notes.

Post Reply