SpriteShadow (Duke3D Shadows) v1.9

Post your example zscripts/ACS scripts/etc here.

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

Postby WARCHILD_89 » Mon Jan 30, 2017 3:47 pm

looking forward to its development! Would be great to just use it for any actor
User avatar
WARCHILD_89
DOOM NEMESIS / 3D MODELS / RESOURCE BACKUPS
 
Joined: 17 Nov 2013
Location: MIA between doomed dimensions

Duke3D-style Actor Shadows 1.0

Postby Nash » Mon Feb 27, 2017 5:37 am

New version added to the OP. Works with all monsters in Doom and Heretic.

Note: currently breaks the monster scripting in Hexen and Strife. You will see the shadows, but the level scripting will break. I don't know how to fix this yet. I suggest only playing with Doom and Heretic (and their mods) for now.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Postby Expect No Mercy » Mon Feb 27, 2017 7:14 am

v1.0 works fine for me! Thanks!
Last edited by Expect No Mercy on Wed Mar 01, 2017 8:05 am, edited 1 time in total.
User avatar
Expect No Mercy
 
Joined: 18 Mar 2012

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Postby Hipnotic Rogue » Mon Feb 27, 2017 3:43 pm

This is great! I started a new game of Heretic Episode 5. Seeing all those pesky gargoyles hovering in the air casting shadows was quite lovely. It certainly added to the air of menace at the opening of the level. :)
User avatar
Hipnotic Rogue
 
Joined: 15 Jul 2016

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

Postby Gez » Mon Feb 27, 2017 5:54 pm

Nash wrote: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

Is that why the actor scripting in Hexen or Strife breaks?
Gez
 
 
 
Joined: 06 Jul 2007

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Postby Nash » Mon Feb 27, 2017 5:56 pm

Gez: I suspect just as much. It seems that shit just breaks horribly if I do that. There's currently no way to make the shadows draw behind the monsters, because they are spawned after the monsters... so I may have to ditch that concept and just accept the shadows being drawn in front of the monster sprites... >_<
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Postby The Zombie Killer » Tue Feb 28, 2017 4:09 am

Could you spawn a dummy actor after the shadow that copies the position, sprite, frame, etc. of the real actor?
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Postby Nash » Tue Feb 28, 2017 4:29 am

So what do I do with the real actor? Make it invisible? That won't work too well, if a modder has scripted the monster's visibility and renderstyle FX.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Postby The Zombie Killer » Tue Feb 28, 2017 4:31 am

If they're synced up properly, whether the original is visible or not shouldn't matter. (I can confirm the method works at least, it's just getting the positions synced perfectly that's painful)
EDIT: Got it, will update my shadow example in a sec, feel free to take a look and copy the solution here (although it's rather simple to do anyways)
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Postby iamthemithras » Wed Mar 01, 2017 2:38 am

Thanks for this nash. tested it with gzdoom-g2.4pre-693-g4a87a59 and it worked perfectly - I didn't know this dev version existed! The monsters' movement are so smooth now like Risen3D! :shock:

Played with a personal weapons mod. You're a genius, you know that?
iamthemithras
 
Joined: 29 Jan 2017

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Postby Nash » Wed Mar 01, 2017 2:41 am

The Zombie Killer wrote:whether the original is visible or not shouldn't matter.


Actually this isn't really a solution. So you're allowing the monster to be drawn twice, correct? For monsters with render style effects (like stealth monsters, or monsters with fancy translucency) you're basically overdrawing the sprite twice. The effect will look wrong.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Postby The Zombie Killer » Wed Mar 01, 2017 2:44 am

Nash wrote:
The Zombie Killer wrote:whether the original is visible or not shouldn't matter.


Actually this isn't really a solution. So you're allowing the monster to be drawn twice, correct? For monsters with render style effects (like stealth monsters, or monsters with fancy translucency) you're basically overdrawing the sprite twice. The effect will look wrong.

Hrmm, good point. Will need to think of a way to cleanly hide the original actor without breaking any renderstyle scripting then.
User avatar
The Zombie Killer
King of the Kangaroos
 
Joined: 14 Jul 2011
Location: Gold Coast, Queensland, Australia
Discord: Zombie#1795

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Postby Gez » Wed Mar 01, 2017 3:34 am

Should translucent monsters have a shadow anyway?
Gez
 
 
 
Joined: 06 Jul 2007

Re: Duke3D-style Shadows v1.0 [works with any Doom/Heretic m

Postby Nash » Wed Mar 01, 2017 4:05 am

Here's what I found: setting bInvisible on the original monster is a huge NOPE because that messes up the AI and targeting mechanics (monsters will not infight anymore, for example). So you can kiss bInvisible goodbye.

Setting alpha = 0 or RenderStyle None of the original monster also is bad because then you'd just nullify all the RenderStyle effects the monster was defined with.

And after a lot of thinking, everything we're trying to do here is a huge hack. I mean, come on, seriously? Spawning a duplicate of the visible monster? Sheesh. There needs to be a way to natively draw an Actor before other Actors.

Overriding RenderFrame has already been shut down, so, hmm. Maybe a dedicated flag and a StatNum to go along with it that tells the Actor to always draw behind normal ticking Actors. Requires work in the source code.

At this point, I wonder if I should just delete all my hacks related to trying to position the shadow behind the Actor, and just release it as-is, with the shadows being drawn in front of the Actors. This is the cleanest and safest way to do it - ie, normal gameplay isn't interrupted, scripting/AI does not break, etc.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Duke3D-style Shadows v1.1 [final, It Just Works™]

Postby Nash » Wed Mar 01, 2017 4:50 am

Final version added into the OP.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

PreviousNext

Return to Script Library

Who is online

Users browsing this forum: No registered users and 2 guests