Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flesh out Warden Posession #672

Open
wants to merge 4 commits into
base: 1.20
Choose a base branch
from

Conversation

Redfan2
Copy link
Member

@Redfan2 Redfan2 commented Sep 28, 2024

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.

@Pyrofab
Copy link
Member

Pyrofab commented Sep 28, 2024

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.

@Redfan2
Copy link
Member Author

Redfan2 commented Sep 29, 2024

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?).

@Pyrofab
Copy link
Member

Pyrofab commented Sep 29, 2024

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 ?

@Redfan2
Copy link
Member Author

Redfan2 commented Sep 30, 2024

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

@Pyrofab
Copy link
Member

Pyrofab commented Sep 30, 2024

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

@Redfan2
Copy link
Member Author

Redfan2 commented Oct 23, 2024

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?)

@Pyrofab
Copy link
Member

Pyrofab commented Nov 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants