Sasai-Kudasai-BM / Water-Physics-Overhaul

48 stars 17 forks source link

I have upgraded this mod to 1.17.1 and 1.18.2 (@Sasai-Kudasai-BM if you want me to stop please let me know) #60

Open Felicis opened 1 year ago

Felicis commented 1 year ago

Again, @Sasai-Kudasai-BM , if you disagree with me upgrading your mods, please let me know.

I'm working on forks of this repo: https://github.com/Felicis/Water-Physics-Overhaul (WPO) ~https://github.com/Felicis/SKDS-Core (Core)~ (is being integrated into WPO in new release)

TODO:

Felicis commented 1 year ago

alright y'all, I'm done with the 1.17.1 port of both Water-Physics-Overhaul and SKDS-Core. You can get the jars for the mods here: https://github.com/Felicis/Water-Physics-Overhaul/releases/tag/0.2.0_mc1.17.1_forge37.1.1

SoapSoapSoapSoap commented 1 year ago

are you planning on updating it to all the newer versions? youre doing gods work right here lol, because no other mod is as good as this at water physics imo, so being able to use it in newer versions would be nice

Felicis commented 1 year ago

thanks Soap :) I totally agree: wpo has the best very vanilla feeling water physics. That's why I chose to upgrade this mod and not the others ;) I think I might try to keep upgrading it to 1.19 and further, but my computer is already starting to reach its limits, so idk whether I manage to run the game while debugging. I am also thinking about complementing the finite water (and ugly holes in oceans) with some refilling (e.g. with rain), but idk if and when I will manage. Also I am frankly thinking about also downgrading this mod to 1.12, since there are so many cool modpacks that could use it.

Felicis commented 1 year ago

also here is 1.18.2: https://github.com/Felicis/Water-Physics-Overhaul/releases/tag/0.3.0_mc1.18.2_forge40.2.0 I had to rewrite the rendering, so I hope I introduced no bugs... Let me know if you find some :)

SoapSoapSoapSoap commented 1 year ago

thanks Soap :) I totally agree: wpo has the best very vanilla feeling water physics. That's why I chose to upgrade this mod and not the others ;) I think I might try to keep upgrading it to 1.19 and further, but my computer is already starting to reach its limits, so idk whether I manage to run the game while debugging. I am also thinking about complementing the finite water (and ugly holes in oceans) with some refilling (e.g. with rain), but idk if and when I will manage. Also I am frankly thinking about also downgrading this mod to 1.12, since there are so many cool modpacks that could use it.

the refilling idea with rain sounds AMAZING, if you manage to pull it off it will be so cool to see!

HexHyte commented 1 year ago

thanks Soap :) I totally agree: wpo has the best very vanilla feeling water physics. That's why I chose to upgrade this mod and not the others ;) I think I might try to keep upgrading it to 1.19 and further, but my computer is already starting to reach its limits, so idk whether I manage to run the game while debugging. I am also thinking about complementing the finite water (and ugly holes in oceans) with some refilling (e.g. with rain), but idk if and when I will manage. Also I am frankly thinking about also downgrading this mod to 1.12, since there are so many cool modpacks that could use it.

Please do not forget about Block-Physics-Overhaul, it is also amazing

Felicis commented 1 year ago

Please do not forget about Block-Physics-Overhaul, it is also amazing

Block-Physics-Overhaul is currently not planned, since upgrading and fixing WPO takes enough time right now. Maybe I might upgrade it in future, but that's a big maybe. If someone wants to take on upgrading BPO I am willing to help, idk make a discord server or something to talk about the code, since it is scarcely commented. You would need some java coding knowledge to start, but not too much :)

Yanosiq commented 1 year ago

i hope u wont get angry i tried to make a suggestion on your wpo but i accidentally made a pull request of your code here (i closed it but its not deleted) i dont know how to even delete it and i am new to github srry and hope u wont get angry (plz dont kill me)

btw if you are still alive then is there a chance of create support

Felicis commented 1 year ago

don't worry Yanosiq, closing something on github is like deleting it, so everything is good (github does not allow deleting things, since they want to track the history of everything) :wink: just post suggestions as an issue to my fork: https://github.com/Felicis/Water-Physics-Overhaul

Felicis commented 1 year ago

status update: I have some bad news: the current system where the water level (0-8) and the fluid type (empty, water, lava, ...) is encoded in the blockstate as properties does not scale at all :sob:

For all the non-modders out there the problem is because minecraft pre-generates every block with every combination of its properties and keeps them in memory, which means it can just replace the block in the world when it is changed instead of having to create it again. For example this means that there are 10 redstone torch variants in the game at every time (4 on wall + 1 on floor * 2 on/off). For WPO we are adding 9 water levels to many blocks (~40), which means we have 9x the block variants in the game. My game froze and ran out of memory while trying. And even if it were to work in vanilla (on a faster computer with more memory), it's never going to work with more than a couple mods, never mind large modpacks.

Until now I have found 3 solutions to this problem and each one is more complicated than the other, so if you have tips, ideas or suggestions on how to tackle this, they are very welcome :heart: :

  1. Store in BlockEntities: the forge wiki says that if your data is too complex for a block state property, you should store it in a block entity. Now I do not know the performance impact of having block entities for every single fluid block, but already having to create and manage the block entities for all waterloggable blocks seems daunting (let along tweak the blocks which already have block entities).
  2. Reduce property combinations: right now every combination is created, even if it makes no sense (e.g. waterlogged=false, fluid_level=3). If there were a way to tweak the property combination generation, this might already ease the load, although I cannot say whether it will scale to modpacks with many modded blocks or fluids. Also feels like an ugly and brittle hack. However this is the only combination which directly works with modded blocks.
  3. Rewrite FluidStates to be stored like BlockStates in the server and synced across the network. Fluidlogged-API does this to add Fluidlogging/Waterlogging to 1.12. It looks very complicated and will take some time to set up, but I feel like this is the most elegant way to store the fluid type and level for each waterlogged or fluid block. It might also be easier to keep the custom fluid physics separate and just inject FluidStates where needed, but how hairy it is to wire this into the minecraft code has to be seen.

So... that's the status update I guess :smiling_face_with_tear:

SoapSoapSoapSoap commented 1 year ago

status update: I have some bad news: the current system where the water level (0-8) and the fluid type (empty, water, lava, ...) is encoded in the blockstate as properties does not scale at all 😭

For all the non-modders out there the problem is because minecraft pre-generates every block with every combination of its properties and keeps them in memory, which means it can just replace the block in the world when it is changed instead of having to create it again. For example this means that there are 10 redstone torch variants in the game at every time (4 on wall + 1 on floor * 2 on/off). For WPO we are adding 9 water levels to many blocks (~40), which means we have 9x the block variants in the game. My game froze and ran out of memory while trying. And even if it were to work in vanilla (on a faster computer with more memory), it's never going to work with more than a couple mods, never mind large modpacks.

Until now I have found 3 solutions to this problem and each one is more complicated than the other, so if you have tips, ideas or suggestions on how to tackle this, they are very welcome ❤️ :

  1. Store in BlockEntities: the forge wiki says that if your data is too complex for a block state property, you should store it in a block entity. Now I do not know the performance impact of having block entities for every single fluid block, but already having to create and manage the block entities for all waterloggable blocks seems daunting (let along tweak the blocks which already have block entities).
  2. Reduce property combinations: right now every combination is created, even if it makes no sense (e.g. waterlogged=false, fluid_level=3). If there were a way to tweak the property combination generation, this might already ease the load, although I cannot say whether it will scale to modpacks with many modded blocks or fluids. Also feels like an ugly and brittle hack. However this is the only combination which directly works with modded blocks.
  3. Rewrite FluidStates to be stored like BlockStates in the server and synced across the network. Fluidlogged-API does this to add Fluidlogging/Waterlogging to 1.12. It looks very complicated and will take some time to set up, but I feel like this is the most elegant way to store the fluid type and level for each waterlogged or fluid block. It might also be easier to keep the custom fluid physics separate and just inject FluidStates where needed, but how hairy it is to wire this into the minecraft code has to be seen.

So... that's the status update I guess 🥲

i agree that the 3rd option does sound the easiest and maybe least laggy way of handling the issue, and i think that the time it might take you to set it up will be worth it as later youll be able to keep it seperate from the fluid states, only needing to edit those if you ever feel like porting it to another version, which would save you more time in the long run

Felicis commented 1 year ago

Small status update: I realized there is a collision between my new changes and SDKS-Core, therefore I have decided to kick it out. For me this means more work to get WPO done. For you it means longer to wait until I'm done smiling_face_with_tear

Technical comment: Decoupling WPO from SDKS-core seems easier than rewriting SDKS-core, also I did not like the mixins required to insert the worker threads into the server code.

emanuele246gi commented 1 year ago

Everything sounds great! Will you be able to upload it on CurseForge when you are done?

Felicis commented 1 year ago

Everything sounds great! Will you be able to upload it on CurseForge when you are done?

I hope so :sweat_smile:

emanuele246gi commented 1 year ago

That's nice! Unfortunately, or fortunately, CurseForge doesn't allow modpacks to have files outside their platform (with some exceptions)

Felicis commented 1 year ago

That's nice! Unfortunately, or fortunately, CurseForge doesn't allow modpacks to have files outside their platform (with some exceptions)

I see your problem. Considering how many bugs are still in the mod (e.g. wrong water-lava behaviour, oceans draining for no reason) I don't think it's a good idea to start mixing it with other mods yet. This mod tweaks so many things in minecraft that many mods (especially all mods with anything fluid related) will need compatibility patches to work properly, which are not there yet, so things will crash all over the place.

Btw I also I just checked the CurseForge rules and there should be no reason why I cannot upload the finished mod to curseforge :) Then you'll be able to use it in modpacks

Felicis commented 1 year ago

I'm fixing the water-lava interaction right now. However there are many possibilities how partial water and lava blocks should behave which all make some sense, and I'm not sure which to implement. If you want to join the discussion to decide how lava and water should interact join me here: WPO discussion: how should lava and water interact?

PickyPixelStudio commented 7 months ago

Hey!

What a lovely initiative! We're looking for that kind of mod, for 1.20.1, hope to see your work reach this point!

Felicis commented 7 months ago

Hey!

What a lovely initiative! We're looking for that kind of mod, for 1.20.1, hope to see your work reach this point!

I'm looking forward to getting there, too! Once the 1.16 version is working I'll start upgrading to all the newer versions! Stay tuned, but bring some patience (some months), since it will take some work to get to 1.20 :)

PickyPixelStudio commented 7 months ago

Hey! What a lovely initiative! We're looking for that kind of mod, for 1.20.1, hope to see your work reach this point!

I'm looking forward to getting there, too! Once the 1.16 version is working I'll start upgrading to all the newer versions! Stay tuned, but bring some patience (some months), since it will take some work to get to 1.20 :)

Yeah, i don't know much about Java, but i know coding/dubugging, take a lot of time, and coffee, sometimes with a breaked keyboard... (I'm joking).

Wish you all the luck we can give you!

wglpython commented 6 months ago

hey bro,i have question In the TFC (Terrafirmacraft) mod, blocks of type "tfc:rock/spike/quartize" do not have the boolean property "waterlogged." When "skds" attempts to perform this operation, it will result in an infinite loop.

[22:18:42] [SKDS-Worker-1/ERROR]: Exeption while executing task 
java.lang.IllegalArgumentException: Cannot set property BooleanProperty{name=waterlogged, clazz=class java.lang.Boolean, values=[true, false]} as it does not exist in Block{tfc:rock/spike/quartzite}
    at net.minecraft.world.level.block.state.StateHolder.m_61124_(StateHolder.java:117) ~[client-1.18.2-20220404.173914-srg.jar%23164!/:?]
    at net.skds.wpo.fluidphysics.FFluidStatic.getUpdatedState(FFluidStatic.java:111) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
    at net.skds.wpo.fluidphysics.FFluidBasic.getUpdatedState(FFluidBasic.java:334) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
    at net.skds.wpo.fluidphysics.FFluidDefault.execute(FFluidDefault.java:58) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
    at net.skds.wpo.fluidphysics.FFluidBasic.run(FFluidBasic.java:129) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
    at net.skds.wpo.fluidphysics.FluidTask$DefaultTask.run(FluidTask.java:66) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
    at net.skds.core.multithreading.UniversalWorkerThread.takeTasksStack(UniversalWorkerThread.java:79) [skds_core-1.18.2-0.3.0.jar%23144!/:0.3.0]
    at net.skds.core.multithreading.UniversalWorkerThread.run(UniversalWorkerThread.java:51) [skds_core-1.18.2-0.3.0.jar%23144!/:0.3.0]
[22:18:42] [Render thread/WARN]: Unable to parse the boolean system property 'java.net.preferIPv6Addresses':system - using the default value: false
emanuele246gi commented 6 months ago

That's nice! Unfortunately, or fortunately, CurseForge doesn't allow modpacks to have files outside their platform (with some exceptions)

I see your problem. Considering how many bugs are still in the mod (e.g. wrong water-lava behaviour, oceans draining for no reason) I don't think it's a good idea to start mixing it with other mods yet. This mod tweaks so many things in minecraft that many mods (especially all mods with anything fluid related) will need compatibility patches to work properly, which are not there yet, so things will crash all over the place.

Btw I also I just checked the CurseForge rules and there should be no reason why I cannot upload the finished mod to curseforge :) Then you'll be able to use it in modpacks

Good to hear that, take all the time you need. However, about the compatibility thing, I don't think mod devs will update their 1.18.2 version, as my modpack is on that version. I'll see in that case what I'm going to do. Thank you for everything though, and keep up with the good work ^^

Felicis commented 6 months ago

hey bro,i have question In the TFC (Terrafirmacraft) mod, blocks of type "tfc:rock/spike/quartize" do not have the boolean property "waterlogged." When "skds" attempts to perform this operation, it will result in an infinite loop.

[22:18:42] [SKDS-Worker-1/ERROR]: Exeption while executing task 
java.lang.IllegalArgumentException: Cannot set property BooleanProperty{name=waterlogged, clazz=class java.lang.Boolean, values=[true, false]} as it does not exist in Block{tfc:rock/spike/quartzite}
  at net.minecraft.world.level.block.state.StateHolder.m_61124_(StateHolder.java:117) ~[client-1.18.2-20220404.173914-srg.jar%23164!/:?]
  at net.skds.wpo.fluidphysics.FFluidStatic.getUpdatedState(FFluidStatic.java:111) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
  at net.skds.wpo.fluidphysics.FFluidBasic.getUpdatedState(FFluidBasic.java:334) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
  at net.skds.wpo.fluidphysics.FFluidDefault.execute(FFluidDefault.java:58) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
  at net.skds.wpo.fluidphysics.FFluidBasic.run(FFluidBasic.java:129) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
  at net.skds.wpo.fluidphysics.FluidTask$DefaultTask.run(FluidTask.java:66) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
  at net.skds.core.multithreading.UniversalWorkerThread.takeTasksStack(UniversalWorkerThread.java:79) [skds_core-1.18.2-0.3.0.jar%23144!/:0.3.0]
  at net.skds.core.multithreading.UniversalWorkerThread.run(UniversalWorkerThread.java:51) [skds_core-1.18.2-0.3.0.jar%23144!/:0.3.0]
[22:18:42] [Render thread/WARN]: Unable to parse the boolean system property 'java.net.preferIPv6Addresses':system - using the default value: false

Yeah, this is a huge known bug, it happens with all mods. And this bug is also the reason why I'm currently rewriting the mod. I hope I can finish and upgrade to 1.18 soon, so you can try the new version (currently only for 1.16), which should already work better, but is not finished yet.

Felicis commented 6 months ago

That's nice! Unfortunately, or fortunately, CurseForge doesn't allow modpacks to have files outside their platform (with some exceptions)

I see your problem. Considering how many bugs are still in the mod (e.g. wrong water-lava behaviour, oceans draining for no reason) I don't think it's a good idea to start mixing it with other mods yet. This mod tweaks so many things in minecraft that many mods (especially all mods with anything fluid related) will need compatibility patches to work properly, which are not there yet, so things will crash all over the place.

Btw I also I just checked the CurseForge rules and there should be no reason why I cannot upload the finished mod to curseforge :) Then you'll be able to use it in modpacks

Good to hear that, take all the time you need. However, about the compatibility thing, I don't think mod devs will update their 1.18.2 version, as my modpack is on that version. I'll see in that case what I'm going to do. Thank you for everything though, and keep up with the good work ^^

Yeah, i guess we'll have to see for the patches. Some kinds of patches should be very easy to fix and we can create pull requests for other mods to integrate easily, but otherwise we'll have to see... ^^

wglpython commented 6 months ago

嘿兄弟,我有问题 在 TFC (Terrafirmacraft) mod 中,“tfc:rock/spike/quartize”类型的块没有布尔属性“waterlogged”。当“skds”尝试执行此操作时,将导致无限循环。

[22:18:42] [SKDS-Worker-1/ERROR]: Exeption while executing task 
java.lang.IllegalArgumentException: Cannot set property BooleanProperty{name=waterlogged, clazz=class java.lang.Boolean, values=[true, false]} as it does not exist in Block{tfc:rock/spike/quartzite}
    at net.minecraft.world.level.block.state.StateHolder.m_61124_(StateHolder.java:117) ~[client-1.18.2-20220404.173914-srg.jar%23164!/:?]
    at net.skds.wpo.fluidphysics.FFluidStatic.getUpdatedState(FFluidStatic.java:111) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
    at net.skds.wpo.fluidphysics.FFluidBasic.getUpdatedState(FFluidBasic.java:334) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
    at net.skds.wpo.fluidphysics.FFluidDefault.execute(FFluidDefault.java:58) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
    at net.skds.wpo.fluidphysics.FFluidBasic.run(FFluidBasic.java:129) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
    at net.skds.wpo.fluidphysics.FluidTask$DefaultTask.run(FluidTask.java:66) ~[water_physics_overhaul-1.18.2-0.3.0.jar%23158!/:0.3.0]
    at net.skds.core.multithreading.UniversalWorkerThread.takeTasksStack(UniversalWorkerThread.java:79) [skds_core-1.18.2-0.3.0.jar%23144!/:0.3.0]
    at net.skds.core.multithreading.UniversalWorkerThread.run(UniversalWorkerThread.java:51) [skds_core-1.18.2-0.3.0.jar%23144!/:0.3.0]
[22:18:42] [Render thread/WARN]: Unable to parse the boolean system property 'java.net.preferIPv6Addresses':system - using the default value: false

是的,这是一个巨大的已知错误,它发生在所有模组中。而这个错误也是我目前正在重写模组的原因。我希望我能尽快完成并升级到 1.18,这样您就可以尝试新版本(目前仅适用于 1.16),它应该已经运行得更好,但还没有完成。

Could you please remind me when the corresponding version 1.18.2 is updated? I would greatly appreciate it

Bitznice commented 5 days ago

it seems that the current 1.18.2 version the water cant pass y=0 for some reason any ideas why?

had an entire ocean dry up on me and some friends cause of a pin hole that was draining into the deep

Felicis commented 5 days ago

it seems that the current 1.18.2 version the water cant pass y=0 for some reason any ideas why?

had an entire ocean dry up on me and some friends cause of a pin hole that was draining into the deep