SpriteShadow (Duke3D Shadows) v1.85 [more optimization!]

Post your example zscripts/ACS scripts/etc here.

SpriteShadow (Duke3D Shadows) v1.85 [more optimization!]

Postby Nash » Wed Jan 18, 2017 4:04 am

Image Image

Adds shadows under monsters, like in Duke Nukem 3D. Works with all monsters and players, for any game and with any mod. Autoload ready.

Requires GZDoom 3.7.0 or higher!: viewtopic.php?f=1&t=63032

Update December 29th 2018 (version 1.85)

- Declaring this mod to now require GZDoom version 3.7.0 to fully take advantage of JIT compiler
- Updated ZScript directive to 3.7.0
- Fixed shadows to update properly when partially blocked from your line of sight
- Even more optimizations, it runs even faster now!
- Don't draw shadows when your view is under them

Spoiler: "Old Updates"


Known Bugs or Limitations:

- Shadows are ignoring player's crouching sprite frames for some reason
- Looks like crap when sprite billboard mode is set to XY. Monsters look like crap with this setting even on vanilla so I don't recommend it anyway (why was this option even added, ugh)

If you find any other bugs, please let me know.

Have fun!
Attachments
SpriteShadow v1.85.pk3
(5.12 KiB) Downloaded 1059 times
SpriteShadow v1.6.pk3
(2.04 KiB) Downloaded 1953 times
Last edited by Nash on Fri Dec 28, 2018 1:25 pm, edited 30 times in total.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Postby Rachael » Wed Jan 18, 2017 5:25 am

Glad to see you didn't give up on this despite the guy who originally asked giving up on it so quickly. :)
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Postby D2JK » Wed Jan 18, 2017 6:49 am

I don't remember how it was in Duke3D, but if there's a ledge, won't part of the shadow end up hovering in the air?
D2JK
 
Joined: 30 Aug 2014

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Postby Kinsie » Wed Jan 18, 2017 4:40 pm

Yessss! I've wanted something like this for a long, long time!
Nash wrote:Since extending Actor isn't allowed in ZScript, making this work with ANY monster in any mod is going to be tricky
Honestly, making this work with EVERY actor may not actually be a good idea - not every actor will look good with this, resulting in weird things like shadows for fire on torches etc.
User avatar
Kinsie
A Concept Utterly Obsolete
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Postby TerminusEst13 » Wed Jan 18, 2017 5:07 pm

Fucking hell, this is incredible.

Dumb question, but just to make sure, would it be all right if I nicked it for use in my own projects?
User avatar
TerminusEst13
I'm just a guy.
 
Joined: 09 Nov 2009
Twitch ID: TerminusEst13

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Postby Nash » Wed Jan 18, 2017 5:17 pm

Kinsie: I think I can limit it to actual living monsters by just doing a check for the +ISMONSTER (bIsMonster in ZScript) flag, although of course this won't be 100% fool proof against people who are doing hacky things with Things that aren't supposed to be monsters but are still flagged as such...

TerminusEst13: Have fun! When/if I update this to be more modular, I'll update this thread. I don't think the way I did it in that proof of concept is the best way (I can't imagine copy/pasting all that into every monster definition... a better way would be if this thing just works in the background with minimal code)

Additionally, I'm not feeling too good about that hack I did to force the shadow to be drawn under the monster (that is, spawning the shadow -> spawning a copy of said monster -> destroying original/map-placed copy of monster, in that order)... o_O
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Postby TerminusEst13 » Wed Jan 18, 2017 5:21 pm

Yeah, there's definitely a lot of avenue for tweaking to make things more streamlined, but I think that's half the fun of things like this. It's like a puzzle game!

You'll probably solve it first, but I still like fiddling and experimenting. :D

Thank you very much again for this!
Last edited by TerminusEst13 on Wed Jan 18, 2017 5:22 pm, edited 1 time in total.
User avatar
TerminusEst13
I'm just a guy.
 
Joined: 09 Nov 2009
Twitch ID: TerminusEst13

Re: [ZScript] Duke3D-style Actor Shadows [WIP]

Postby zrrion the insect » Wed Jan 18, 2017 5:22 pm

This looks very interesting! Hopefully you figure out a way to do this for everything.
User avatar
zrrion the insect
Like a fish in a child's hands.
 
Joined: 25 Jun 2009
Location: Time Station 1: Moon of Glendale

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Postby Nash » Thu Jan 19, 2017 4:35 am

New version in OP!
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Postby Jimmy » Thu Jan 19, 2017 8:18 am

Do you really need to extend Actor to do this across the board? It's only monsters that generate this effect in Duke, right?

(/me might be posting without any real idea of how much ZScript is/isn't capable of)
Jimmy
I picked a fine day to be lactose intolerant
 
 
 
Joined: 10 Apr 2006
Location: Perth, WA
Discord: Jimmy#4100
Twitch ID: JimmySquared

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Postby Nash » Thu Jan 19, 2017 8:55 am

Yes, because if I don't extend Actor, I'd have to end up coding the functionality and a bunch of "replaces" for EVERY kind of monster (what I am doing in the latest version of the WAD in the OP). And it won't cover mod monsters without manual intervention.

The whole point of putting it in Actor is so that every monster in any mod, ever, will have the functionality, because when it boils down to it, everything you place in the map descends from Actor.

Simply checking for bIsMonster is enough to filter the effect to only happen on actual, living monsters... should be a non-issue, in most cases. So don't worry, the shadows won't be spawned for items, decorative stuff, etc...

(and again, I am already doing a monster check in the WAD in the OP - this shadow won't appear on the player, even if you give yourself the item - it will only appear on monsters)
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Postby Tormentor667 » Thu Jan 19, 2017 1:30 pm

Very impressive work, congraulations for this showcase of the capabilities ZScript has :)
User avatar
Tormentor667
needs more detail
 
Joined: 16 Jul 2003
Location: Germany

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Postby osjclatchford » Fri Jan 20, 2017 1:27 pm

looks great! this is something that I felt should always been apart of zdoom. nice to see it done with such skill
osjclatchford
 
Joined: 07 Feb 2011

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Postby Caligari87 » Fri Jan 20, 2017 8:10 pm

Nash, I gotta say this is a gamechanger. It looks good in screenshots, but actually playing is incredible. I never knew how much I needed this until now. This tiny change makes Doom look so much better.

8-)
User avatar
Caligari87
I'm just here for the community
User Accounts Assistant
 
Joined: 26 Feb 2004
Location: Salt Lake City, Utah, USA
Discord: Caligari87#3089

Re: Duke3D-style Actor Shadows [WIP] - Doom monsters done

Postby Nash » Sat Jan 21, 2017 3:42 am

Thank you! I really want to make this modular and be autoload-friendly, so I'll just wait for "extends Actor" to be possible.

I also could submit it as a GZDoom feature but I think that's way out of scope for base engine functionality.

EDIT: Found a bug

Monsters that disappear when dying (Lost Soul, Pain Elemental) will leave their shadows behind despite their corpse not existing anymore. Will be fixed for next version
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Next

Return to Script Library

Who is online

Users browsing this forum: No registered users and 0 guests