Superkat32 / Explosive-Enhancement

Enhancing the explosion animation since 2023
https://modrinth.com/mod/explosive-enhancement
MIT License
12 stars 5 forks source link

Feature Request: Under-water Explosions #3

Closed BLUEChester closed 1 year ago

BLUEChester commented 1 year ago

If the explosion is under water it will cause a different 'under-water' animation.

Thanks so much for making this mod, i've been looking for something like this for ages, its such a beautifully made animation! Keep up the great work

Superkat32 commented 1 year ago

Hello! I really like this idea, but I don't have a clear vision of how the animation would look like. Would it be like, everything is colored bluer? Maybe bubbles spawn as well? I was planning on later adding an aqua-colored explosion for charged creepers, so maybe something like that?

Also, I would need to make sure it's possible with my current abilities, but once we can figure out an idea for what we're going for, yes! I would love to add this.

BLUEChester commented 1 year ago

I imagine it would be something like this: https://youtu.be/7AhEFEGnUTg?t=22

A circle or two that quickly explodes and spawns lots of bubbles around, and then a big cloud of 'underwater smoke' that slowly dissipates and maybe floats upwards

Here's another video: https://www.youtube.com/shorts/eTKDaoPuVns

I think the most important part to sell the effect would be to make the explosion feel slow/weighty; like it's underwater. And the bubbles afterward are definitely important to keep a lasting impact.

Obviously, it's all up to you and what looks best, and what you are capable of, so no stress at all.

Here's another example in a video game setting: https://youtu.be/TYik2b3ypv8?t=677

Superkat32 commented 1 year ago

πŸ‘€ πŸ‘€ πŸ‘€ I see exactly what you mean now. I will 100% see if this is within my skill range. If so, then I will try my best to get a good effect! (I would also like to note that I really really really appreciated the multiple examples! Extremely helpful!)

Superkat32 commented 1 year ago

I feel bad leaving you in the dark, so I'll give you a rough timeline of when to expect things.

I am currently finishing up a project, which should be done within the next week or so. Then I have a project which has a "deadline" for April 1st. Once I finish that last project, I will then see if it's possible for me to work on this.

I want to spend a lot of time on this underwater explosion as I have a really fun idea, which will take some time to get working. Another thing to keep in mind is if it's even possible in the first place. I might be wrong, but I'm pretty sure I remember seeing a boolean of some sorts while working on the initial explosion animation that could in theory allow for this to be easily possible. Otherwise, I'll have to hope for the best there is a work around of some kind.

There's also a chance I finish the April 1st project way before April 1st, and I have some spare time to port Explosive Enhancement over to a 1.19.4 pre-release. I'll see if the underwater boolean thingy I remember seeing is actually there.

(Sorry for the long message, lol. Have a good day!)

BLUEChester commented 1 year ago

No worries at all! You can take as long as you need theres no rush, i really appreciate you taking the time to write this out.

Also my current modpack is on 1.19.2, which I think might be a more popular version so hoping if the mod does get updated it will still be available for 1.19.2 πŸ™ If thats not a priority though thats all good, i'll still be using your mod either way! πŸ‘

Superkat32 commented 1 year ago

Backporting the mod previously to 1.19.2 wasn't an issue, so hopefully backporting this new feature shouldn't be an issue either.

Also, which modpack(if released) is Explosive Enhancement in? (I'm asking because I think it's really awesome one of my mods was good enough to be in a modpack.)

BLUEChester commented 1 year ago

Okay awesome thats great πŸ‘

And sorry to dissapoint but its just my personal modpack that me and a mate have put togsther. Although I definitely reckon your mod is very underrated, and certainly is good enough for a modpack. If you were to get some youtuber shoutouts or something like that i'm sure the mod would sky rocket.

Superkat32 commented 1 year ago

No disappointment whatsoever! In fact, I think that makes it a little cooler because I've also been making my own modpack for me and my brother, which we've dubbed as the "Makeshift Modpack." I've found out it takes a lot of work(waaaayyyy more than I ever thought it would) to make a modpack which only a couple people will be using, so good luck with that!

BLUEChester commented 1 year ago

No disappointment whatsoever! In fact, I think that makes it a little cooler because I've also been making my own modpack for me and my brother, which we've dubbed as the "Makeshift Modpack." I've found out it takes a lot of work(waaaayyyy more than I ever thought it would) to make a modpack which only a couple people will be using, so good luck with that!

Oh yeah it takes soo long its really crazy, i've recently started using ATLauncher which speeds it up heaps and also auto updates mods in your pack which is extremely useful. Definitely cool to make your own as it feels way more special and personalized then the already made modpacks

Superkat32 commented 1 year ago

I've only played one modpack before my Makeshift Modpack, which was Medieval MC. I had a lot of fun with it while using a launcher until that launcher eventually got uhh, destroyed, to say the least. I've since switched over to Prism Launcher after a few months of me being lazy. It definitely feels much more satisfying using a modpack you know you've put time into. It also helps me get more familiar with the modding scene as a whole since I've only been here for about 8 months now(which sounds like a lot, but I only barely touched client-side mods ONLY until about last month whenever I started playing around with non client-side mods).

Superkat32 commented 1 year ago

Hello! Sorry for the delay, but I plan on getting to this sometime this week. Hopefully, it is possible, because it would be really disappointing otherwise.

Superkat32 commented 1 year ago

I've started working on trying to see if it's actually possible. There is, in fact, no such boolean that would make my life so much easier. However, I'm going to spend some time trying to find a way to get this working. I'll continue to update you on progress.

Superkat32 commented 1 year ago

I found a way to detect if the explosion happened underwater or not!!!!

Superkat32 commented 1 year ago

Preview of what I've gotten done so far. There will be a config for the amount of bubbles you want(none, low, medium, high slider of up to probably 250). In the video, there are about 50 bubbles. Thoughts?

https://user-images.githubusercontent.com/89557012/230674460-045a9f85-ff01-4e6e-9e2b-2dabf0234a76.mp4

BLUEChester commented 1 year ago

Hey, that's great to hear you've figured out a way to do it!

Sorry for the late reply - I don't get GitHub notifications for some reason.

The bubbles there is a really great start, I have some ideas to make it even greater:

Firstly, the bubble's velocity should start fast but SUPER quickly slow down (so they look like they are being resisted by the water).

You should add ~30 or so more bubbles that are SUPER tiny and all go out in a horizontal direction (more so than the current 50 bubbles) it would add some more density to the current bubbles I think.

Also, I think there should be some shockwave effect of some sort that happens in all directions similar to the current 'on-land' explosion except it comes out in all directions (in case you weren't already considering this)

And to add on top of my already way too long list of ideas; if you know how to, it would really help sell the effect if the explosion sound was more muffled/sounded like it was actually underwater (ik this isn't the goal of the mod but it would help with the effect substantially, I understand if this isn't possible.)

In my mind all these ideas are flawless but I'm sure if you try them it might look weird or something so ofc everything is up to you. There are my ideas! let me know if you need any further ideas or examples or anything, really love helping w/ this! :D

BLUEChester commented 1 year ago

You could take advantage of that unused bubble pop texture that minecraft has, seen in this mod: |https://www.curseforge.com/minecraft/mc-mods/make-bubbles-pop

Not sure how - but it could be useful

Superkat32 commented 1 year ago

Shouldn't be too hard to make the bubbles slow down sooner. They already start pretty fast, then slow down a bit, make I can change it to slow down even sooner.

There will be a config slider for the amount of bubbles the user wants, as particles can sometimes be tough for weaker devices. The config slider will go up to 250 bubbles(will send a video of more bubbles soon). However, I do like the idea of extra smaller bubbles.

I meant to add a shockwave effect, but I forgor πŸ’€ Will try to work on making that look nice if possible.

Adding a muffled explosion sound isn't really something I can do. However, there is actually already a mod which does this that I've used in the past. It's called Dynamic Sound Filters. You can find it on Modrinth, and probably also on Curseforge if you searched for it. (I don't really use Curseforge as my device doesn't really handle it very well performance wise) https://modrinth.com/mod/dynamic-sound-filters

I've actually tried to use the unused(I think, didn't actually know they were unused) bubble pop textures already. I wanted it so that the bubbles popped if A: They were in the world for about 4-7 seconds. B: If they left the water. I couldn't get it working initially, as either the particles would spawn with the wrong texture, or it would crash the game. But, I have one more idea I've been meaning to try which may or may not accomplish the effect I want. Looking at the source code of Make Bubbles Pop(I love it whenever mods are open source), however, they spawn in a new particle which is just the bubble popping whenever the bubbles leave the water. I could probably do the same thing.

Superkat32 commented 1 year ago

Now that I think about it, the Make Bubbles Pop mod actually has a really clever way of doing exactly what I was trying to do but doesn't crash the game. I'm probably going to try a very similar thing here soon(also helps that both our projects, Explosive Enhancement and Make Bubbles Pop are MIT licenses).

Superkat32 commented 1 year ago

It also seems like Make Bubbles Pop has an underwater explosion effect, but it's pretty different from the effect in the earlier video.

Superkat32 commented 1 year ago

Here's a video of 250 bubbles. Nothing has been changed about the bubble's movement.

https://user-images.githubusercontent.com/89557012/231019560-b6994e9c-fa8f-4911-b930-d9efe2df51a6.mp4

Superkat32 commented 1 year ago

I don't remember everything I did in this video, as I recorded it a couple days ago now. However, these are the biggest things I do remember.

Pretty sure I've made a few adjustments to when the bubbles pop upon entering the air, it's just now shown in this video. (Didn't want the bubbles to feel like they were being spawned in groups).

There are some cuts in the video, simply don't worry about it. That was my computer dying from having IntelliJ running in debug mode and OBS recording at the same time(and probably a YouTube video somewhere in the background that I paused while recording). Also, the video was compressed a little bit because the original file was about 500kb over the 10mb upload limit of GitHub.

https://user-images.githubusercontent.com/89557012/231590790-c109f6b6-dcb5-4026-aab7-38be8e89107a.mp4

Superkat32 commented 1 year ago

Attempted a shockwave-like effect. However, there's something about it that feels... off. And I can't figure out what it is. (also I didn't feel like turning off my music because I was rushing to finish recording so enjoy that too I guess)

https://user-images.githubusercontent.com/89557012/231636354-d00d8c15-3527-42c8-9e7e-17f329fc7eaa.mp4

IceBlossom commented 1 year ago

Hmm... I feel there is something off about it too. I feel like there's not enough of a ripple effect? Not too sure, was trying to go based off of the video from a few replies back. I think the bubble amount is fine... maybe you could add some white into the explosion effect and have it go a little further?

IceBlossom commented 1 year ago

Side note 2 hours later: I would go and re-watch this video from the beginning of this Feature Request. (https://www.youtube.com/watch?v=7AhEFEGnUTg&t=22s) Maybe you can try to incorporate smoke still being there, and the explosion bubble coming back in on itself to lead to that smoke. It's all up to you, though.

Superkat32 commented 1 year ago

I've changed the texture since my last message, but I didn't send a video because there are already like, 7 replies since BLUEChester's last message and I didn't want to spam his notifications anymore(lol). Here's a couple videos of the updated shockwave texture.

https://user-images.githubusercontent.com/89557012/232178110-6869fbcf-f4a5-456d-bca7-6894e17edcbe.mp4

https://user-images.githubusercontent.com/89557012/232178109-06143121-84d4-4d7b-98b0-1a611ca68026.mp4

As for your side note, I plan on reworking the smoke particles in the near future because of how the particle's textures work.

If you don't feel like reading the next block of text, here's a TLDR. Particle texture currently has a band-aid fix and I'd like to make it better both visually and code-wise.

Currently, a little bit of orange is on the particle which is part of the texture images themselves. This is a band-aid fix. I didn't know at the time of making this mod, however, that particle texture colors could be changed via the particle itself(the totem of undying particle texture, for example, is actually a white texture with some green and yellow added via code). I plan on adding the orange to the texture via code to make the particle look better overall. Also helps reduce the insanely awful .json file for the smoke texture, which is a total mess.

BLUEChester commented 1 year ago

Wow! You've made heappsss of progress since i last checked, I'm currently away on holiday so i apologise for late reply.

The bubbles are looking wayy cooler. Incase you havent tried it yet I still think it would be great to have a seperate group of smaller bubbles that explode in a different velocity/direction then the rest of the bubbles, could add some extra effect.

Also the shockwave certainly adds so much more to the effect but it certainly needs just a bit more polish. Similar to how the 'on-land' explosion from this mod has both the 'vertical' explosion and 'horizontal' shockwave effects I think the underwater explosion definitely would benefit from this as well.

You could also consider adding some additional particles, like some lines that shoot out, or dirt/sand particles. This would add some variety and make the effect look more detailed. I understand that lower end pc's can't handle to many particles though so you could simply make it so the particles still have a maxed limit and are simply randomly chosen when they spawn.

Also i highly reccomend watchinf this video if you haven't already:

https://youtu.be/E5rGFZWQfzk

At 0:52 you can see how the explosion has some 'water smoke' that stays around for a while. You could try to emulate something similar to this.

And at 3:08 of the same video you can see how it starts extremely bright but very quickly turns dark. It would be cool to see the shockwave effect emulate something similar to this. It also has '2 layers' an outside shockwave and the inside one that is way brighter.

You could emulate the '2 layer' effect in Minecraft by simply copying that shockwave effect u have atm and have it play 2 times, one of them is normal and the second one starts a little bit later and is way brighter.

Also, this is an extra addition and just an idea that might not fit into the vision of this mod: not sure if this is possible but in my non-coder brain i imagine it would be simple: when an explosion occurs underwater it could temporarily replace the water in a small radius around the explosion with air blocks (exactly like how a sponge block would) and then the area would be filled in w/ water again. The most important and crucial part of an explosion in games is to leave an effect on the environment around to sell the impact, so having the explosion impact the water around would certainly help boost the effect even more.

As always its super cool to see you are very interested in working on this and Im really grateful for all your hard work!

BLUEChester commented 1 year ago

Apologies - i just realized one of my ideas was basically exactly what IceBlossom said.

Superkat32 commented 1 year ago

I'll play around with small groups of bubbles next time I work on the project.

I could add the horizontal explosion effect from the land explosion to the underwater explosion, only with a different texture. The biggest concern I have for that is that there is actually a rendering "bug" with the horizontal particle. If you look at from below the actual particle, it doesn't render in. I think this is because I copied pasted(with permission) that part of the code from the Visuality mod. It's actually just Visuality's water ripple particle, only bigger ~, faster, and stronger too!~ I believe this is actually intentional by the Visuality creator, but not intentional for this mod. I could play around with it later(probably not going to have much luck, though).

I have actually tried to create an effect of lines coming from the explosion... three times. Each time was using a completely different approach. However, I've had another idea that I've been wanting to try which I'm pretty sure will work. It's very similar to how the explosions from Minecraft Legends look. In the video below, towards the very end(around 1:15), you can see a creeper explode. If you slow the video down, you will notice some white lines that briefly appear. I'm pretty sure I could recreate that for this mod. https://www.youtube.com/watch?v=lw6f-tJKoao&t=75s

I never really noticed the "layers" of the shockwave. I can't really spawn in a particle after some time has passed, otherwise, it crashes the game. However, I could make it so that it's just part of the already existing textures.

I can't change any blocks or entities as this mod is exclusively a client-side mod. I want it this way because I love mods that I can use on any server, at any time, without the server needing to do anything. However, I love the fact that you're still willing to throw in ideas even after all these messages.

No worries about the late response! Enjoy your holiday!

BLUEChester commented 1 year ago

Yeah honestly I really think the horizontal explosion effect would be extremely beneficial, but ofc if it isn't in your personal vision and is way to much hassle don't waste your time on it.

And yeah I totally forgot to look for some inspiration from the other Minecraft games that's such a great idea, though's creeper lines were exactly what I was thinking of. Would LOVE to see something like that if it's possible! Fourth times a charm! (maybe Lol)

and yeah I guess you could definitely try adding a second shockwave to the existing texture. Glad you understood what I was saying tho I thought it made no sense tbh. You can also probably tell I have no idea how mod development goes, I imagined you could simply can just 'spawn in' more particles, goofy ah me.

And yes I totally understand the client-side nature of the mod that makes complete sense and is a huge benefit of the mod tbh.

Thanks for your fast reply!

Superkat32 commented 1 year ago

I'm going to play around with the horizontal effect and send videos once I get something I'm happy with. Not sure when that'll happen because I have a busy week ahead of me.

This entire mod was pretty much inspired by Minecraft Dungeon's explosion effect. There are so many other effects that I want to add to Minecraft from both Minecraft Dungeons and Legends(Butterfly particles are on my list next).

The way I tried to spawn in particles after x amount of time caused my game to have a nasty crash(can't remember if it caused a ticking entity or just crashed). However, if you really wanted to spawn in particles after some time, you could spawn in a "dummy" particle initially. This particle would have no movement and no texture and only stays around for a while. Then spawn in a particle via that dummy particle. I never thought of this until now because I didn't know particles could spawn in other particles until your Make Bubbles Pop suggestion. ~I guess I could also spawn in another particle simply via the first shockwave particle after x amount of ticks.~ (This idea has an oversight: It keeps spawning in particles... never ending particles...) I think the first time I tried to spawn in particles after some time failed because I was using the wrong methods. (Me throwing my ideas out there so I can refer to them later, LOL)

Even if you don't understand how coding works, you can still give really good ideas and extremely valuable feedback.

Also, I need to find a way to add something like Discord's spoiler thing to these messages because I always end up with huge blocks of text LOL

BLUEChester commented 1 year ago

Yeah, totally understand if you're busy, take your time. I dont mind the huge blocks of texts, its really cool getting detailed updates of your progress like this.

Superkat32 commented 1 year ago

I've "fixed" the particle not rendering if viewed from beneath. I realized two things whilst doing so. 1: My naming scheme for the particles sucks. 2: ChatGPT is OP. 3: There is no third thing because ChatG... I'm so good... yeah...

Okay, but actually, ChatGPT is a really really useful tool. I only sorta understand the code being used to render the particle at an angle, and even then, I still wouldn't be able to make it do what I wanted it to do without insane trial and error. ChatGPT helped me do it within about 10 minutes 🀯

Superkat32 commented 1 year ago

I've made another update to the underwater shockwave effect. Thoughts?

https://user-images.githubusercontent.com/89557012/233869100-c38f47b3-005a-4e77-ad22-744a42c4ab06.mp4

IceBlossom commented 1 year ago

I like it! Something that I feel could make it a bit better though is if the orange part of the explosion fade into a dark-ish white, the combine with the blue part of the explosion. This, once again, would make it feel like an actual, real world underwater explosion, like how the videos at the top of this issue thread show it. I don't know if it would be possible, but it could make it look a bit cooler.

Superkat32 commented 1 year ago

I could try to add that fade into dark white color. Give me about 30 minutes(famous last words)

Superkat32 commented 1 year ago

I'm not really sure if I made much of a difference with the new changes. I think it might be something to do with the colors I chose, or maybe the fact that it moves through the textures much faster now.

(Also, now that I reread your message, I believe I initially read it wrong. If I have, pls let me know)

https://user-images.githubusercontent.com/89557012/233870291-876ce2b7-dbea-4f6f-a0b8-bbb48e3bb87d.mp4

BLUEChester commented 1 year ago

Yeah, that animation looks very smooth, but you should definitely change the orange color to a white/light blue as there wouldn't really be any 'fire' underwater.

On top of that, to sell the fact that it's underwater, everything needs to 'keep moving', the way the animation stops abruptly at the end sort of doesn't follow the way water moves. Maybe to cover this up you could try spawning in bubbles around the edges of the animation? Although not sure if this is possible, you may need to make the animation fade out slightly faster, before it stops.

And in the gif you sent with the bubbles: I think that the bubbles should be spread out a lot more, there should be (by default) a little bit fewer bubbles and the bubbles should float up a little bit faster.

It's definitely getting good now though the animation is looking so much smoother already.

Superkat32 commented 1 year ago

I see what you mean by changing the orange to a different color. I really just copied the colors I used for other particles in this mod and left it.

I could make it so that a hole opens in the middle of the particle so as to let it fade out that way? Not sure about spawning bubbles on the edge.

Bubbles' movement can be easily changed.

I'm really really glad all of us are able to work on this together to achieve a really nice and satisfying looking effect.

IceBlossom commented 1 year ago
  1. I'm happy that I could help on this mod and help it improve! I may not know how to code, but at least I can give some decent direction!
  2. I think the 'hole in the middle' effect would work really well. If while working on it and it doesn't feel cool, you can always reference the videos at the beginning. It doesn't have to be realistic, but the effect should be something you can be proud of. :D
IceBlossom commented 1 year ago

Any updates? I don't want to rush you, just checking in.

Superkat32 commented 1 year ago

Not as of now. I've been very busy and am working on another project which takes priority as it has a deadline. Should be able to get back to this hopefully within a few days. Thanks for checking though!

On Sun, Apr 30, 2023, 5:26 PM IceBlossom @.***> wrote:

Any updates? I don't want to rush you, just checking in.

β€” Reply to this email directly, view it on GitHub https://github.com/Superkat32/Explosive-Enhancement/issues/3#issuecomment-1529142765, or unsubscribe https://github.com/notifications/unsubscribe-auth/AVLIQFCFCDOHL66JCOW33BLXD3KKDANCNFSM6AAAAAAVAMBWVQ . You are receiving this because you were assigned.Message ID: @.***>

Superkat32 commented 1 year ago

Another update: Almost done with the project which has a deadline. Should be able to get back to this suggestion either later today or sometime tomorrow depending on how lazy I am. Thanks for waiting guys!

Superkat32 commented 1 year ago

UPDATE TIME!!!

Bubbles movement has been updated to spread out more and float up faster. Vertical shockwave effect(Shockwave particle) has had its textures updated(I really like it). Finally added the horizontal shockwave(Underwater blast particle) effect.

https://user-images.githubusercontent.com/89557012/235664013-be5dc216-1cfb-408a-bb8f-bf2598533c49.mp4

Feedback on both the visuals and the names of the particles would be nice. I'm about to change the names of all the particles and I need to make sure that the names are somewhat descriptive of the particle.

IceBlossom commented 1 year ago

That looks sick! However, the big problem I see right now is the core of the explosion still being orange. If you can find a way to turn it from an orange to a blue-tinted white mid-effect, I think it would look spectacular!

Superkat32 commented 1 year ago

Ooooh, I forgot about that. I'll get started on it soonβ„’

Superkat32 commented 1 year ago

I added a blue tint to it, but it sorta feels like it has just had it's saturation turned down. I also removed the odd semi-transparent pixels in the top left corner of the texture, no idea how long that's been there. Thoughts?

https://user-images.githubusercontent.com/89557012/235679264-8caa7c81-fd17-4f3b-b054-98ed5ebd6568.mp4

IceBlossom commented 1 year ago

Referencing the videos at the beginning of the thread, the orange should not be there by the end of the effect. It should be faded to a white with a blue-tint, like I mentioned. If I had even the slightest bit of knowledge about hoe to animate, I would try to show you what I mean.

Superkat32 commented 1 year ago

The orange doesn't actually stay till the very end of the effect. However, I do agree with the fact that it could still be improved upon. I'll try again in a little bit(right now I'm messing around with the config). πŸ‘

Superkat32 commented 1 year ago

I've changed the colors, finally found a good way to have the fade out of the colors, and added one or two extra frames. Also cleaned up some random pixels being off(won't really notice that one unless you're in the texture editor). I've even got the perfect music for the video!

https://user-images.githubusercontent.com/89557012/235703728-07b912a3-7609-4073-b34f-2933cd7e50bd.mp4

IceBlossom commented 1 year ago

WOOOOOOOOOOO THAT'S WHAT I LIKE TO SEE!!!! The only thing I'm really confused on is whether or not it should be brighter or dimmer... experiment to see what you like!