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

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

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 374 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 :)

User avatar
Hazelnut
Posts: 2664
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: 3824
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: 1760
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
My released mods

"I feel like Ralzar specifically wrote those mods for me and then said "Use them". Just so he could watch me die more."
-FuzzyBeanPlays

User avatar
Hazelnut
Posts: 2664
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 197 times
torchAfter.JPG
torchAfter.JPG (96.3 KiB) Viewed 197 times
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

l3lessed
Posts: 752
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 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: 3824
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: 752
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 Mods: l3lessed Nexus Page

Daggerfall Unity mods: Combat Overhaul Mod

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

Post Reply