Requiem icon indicating copy to clipboard operation
Requiem copied to clipboard

Flesh out Warden Posession

Open Redfan2 opened this issue 1 year ago • 7 comments

THIS IS JUST A PROTOTYPE I WANTED TO GET UP; CODE WILL DEFINITIVELY AND CREATIVE DECISIONS WILL POTENTIALLY BE REWORKED

This PR expands on the visuals of posessed Wardens:

  • It applies a Shader to the Player's view that makes him more sensible to light
  • Only entities sensed by the warden are rendered, and have a glowing outline
  • Particles are spawned for any Game Event detectable by a Warden

I would specifically like feedback on:

  • whether it makes sense to use a Component for Syncing the detected Entities or some kind of Handler using Networking. Wondering whether the component could pollute the Player NBT to the point where it is filled up.
  • whether it would make sense to data-drive the Possession effects so that other Mods could declare their Mobs as having these features when possessed.

If you spot any Logic errors, point them out. Some of this was written late at night. When the logic is solid, I will look into JavaDocs (if needed) and Code style.

Also @pyrofab, if you agree with the Creative Aspect of this PR: Could you ask doctor4t whether he is ok that this PR reuses Textures and code for the SoundParticle from Sculkhunt? In terms of the warden Fragment Shader I am unsure as Rat does not hold the Intellectual property to it as far as I know.

Redfan2 avatar Sep 28 '24 22:09 Redfan2

Oh I like the sound of that. Although my initial idea for the warden was more making it actually blind - could you maybe post some screenshots of the shader ? A component for detected entities should be fine I think, you don't have to save anything to NBT (see TransientComponent). Textures and code from one Ladysnake mod to another is perfectly fine, but I'll try to get some feedback from RAT. And finally the shader I don't remember where it comes from, guess I'll ask.

Pyrofab avatar Sep 28 '24 23:09 Pyrofab

Oh I like the sound of that. Although my initial idea for the warden was more making it actually blind - […]

I did look into that (here and here) and I plan to do both, I just didn‘t mention it as it is not yet implemented as I don‘t know what would be the smartest way to achieve this with Mixins. Neither am I sure „how blind“ he should be (Darkness? Blindness with 3 blocks view distance?).

Redfan2 avatar Sep 29 '24 12:09 Redfan2

I think it should either be like the darkness effect, or a shader that makes you only see the outline of the terrain. In any case, the warden doesn't have eyes, so colours should not be accurate - maybe only use colours to distinguish the type of game event in the particles ?

Pyrofab avatar Sep 29 '24 15:09 Pyrofab

In any case, the warden doesn't have eyes, so colours should not be accurate - maybe only use colours to distinguish the type of game event in the particles ?

I'm gonna have to think about that, from what I can see it would require us Mixing into the ParticleManager, hijacking the Construction of this specific Particle Type and setting the color ourselves using the server-side (I think) knowledge about the Game Event that is happening at the Position. Not sure, but from what I can see the ClientWorld used to construct the SoundParticle doesn't know anything about the GameEvent's.

Screenshots

-could you maybe post some screenshots of the shader ?

Shader, Day Shader, day

Shader, Night Shader, Night

Darkness+Shader, Day Darkness+Shader, Day Darkness+Shader, Night Darkness+Shader, Night

Interestingly, Blindness is unaffected by the Time of Day BlindnessSometime BlindnessSometime

Redfan2 avatar Sep 30 '24 19:09 Redfan2

You're right that you need to use the server side data about the events, but you shouldn't have to hijack anything, just define particle parameters and register a custom particle factory IIRC

Pyrofab avatar Sep 30 '24 20:09 Pyrofab

Sorry for the wait:

You're right that you need to use the server side data about the events, but you shouldn't have to hijack anything, just define particle parameters and register a custom particle factory IIRC

Didn't know that was possible, Thanks.

I've implemented different particle colors for different types of game events. For now I’ve just made 2 tags and chosen some Colors for testing, let me know what you think of it. However, I am currently running into a bug where all SoundParticles are black. ( I suppose because VertexConsumers are affected by Fog, maybe a custom RenderType & Shader would be needed?) I am not skilled enough with Rendering to wage whether there is a suitable VertexConsumer, nor what would be the best Strategy to use a custom one. (A ParticleTextureSheet? Something like the GhostParticle?)

Redfan2 avatar Oct 23 '24 17:10 Redfan2

I think you could get away with making the particles emissive ? Or maybe not if it's caused by the fog; I guess you will need to experiment a bit

Pyrofab avatar Nov 05 '24 08:11 Pyrofab