Sprinklers No Longer Work
RlonRyan opened this issue Β· 32 comments
spinkler doesn't seem to water the farmland
https://clips.twitch.tv/SteamyWanderingLardPlanking
Can confirm, we are using the latest version of Agricraft and having the exact same issue. Sprinklers might animate and even spew particles periodically, but they don't actually appear to be DOING anything as the channels always step void of water. Bone dry!
Help?
I dont thinkt he blokrange is a good thing for the sprinkler, because they should stop irrigating once they reach a non "permeable" block
(meaning the crop, and the soil block below the crop)
Hmm, I was wondering about that too actually. It looks like that has been the effective behavior for a while, so I guessed it was just accepted to work that way. It'd be cool if it was somewhat more realistic.
Curious, what would be the preferred way to rewrite that? A) put the position iterating logic inside the sprinkler's update method, B) make a generic version that accepts something like a Predicate and a Consumer<BlockPos>, or C) something completely different and actually smart. :)
Two things that might be causing problems with sprinklers not irrigating correctly.
- For the area that gets irrigated, the y-offset is flipped, causing the irrigation happening above the sprinkler, not below. [commit]
- And I think the BlockRange iterator is not fully covering the volume defined by the pair of BlockPos in the two opposite corners. [commit]
I hope I'm not making any mistakes here, and thank you for any feedback in advance.
I'm not sure anymore how it is now, I'd have to look at the code, but in the beginning it was like that, and that I am sure of.
And the sprinkler did not iterate, every tick it selected a random (x, z) couple in its range and sprinkled the top block (iterating downwards in the y direction until hitting something), and the block below it, if that block was a plant.
I'll just chime in that in 2.0.0-0.9.0-a16
Farmland is not getting watered above or below the sprinkler.
Hello again sprinkler bug people. :) I've gotten them working at the moment, and I would love any comments on the fixes involved. See PR #973 for too many details.
Heads up, this update does not implement the approach that InfinityRaider is describing, which I still agree would be the preferred approach. But since the mod already uses the simplistic method, and it only needed some small bug fixes, I went ahead and made what was already there at least work for now. Gameplay mechanics are also definitely not balanced yet, especially the growth bonuses.
Preview:
Hi, @MidnightsFX, thanks for being patient! I wanted to double check that the jar worked outside of my dev environment, but I got sidetracked before setting up a pure profile.
PS, can you clarify what I would need to do for you to be able to pull the branch?
agricraft-2.0.0-0.10.0-a17.jar.patch-sprinklers.zip
Heads up: this jar also has the BlockCrop patch included, since the bug was making it harder to test out the sprinkler with crops.
Edit: Oh, and for extra clarification, the jar is otherwise built from the current head of the AgriCraft/master branch (commit 33f5d7c).
Edit2: Yup, hah, I know the feeling. And thank you!
This looks pretty sane to me. But I would be interested in doing some more validation if you could provide a build, or remote branch I could pull/build.
Looks good! Checked some modded crops, modded farmland and normal farmland and seems to all be growing as expected, and providing water to crops as it is supposed to.
I am not sure the water usage is actually happening, but I will look into that more.
Excellent! Yeah, for some reason before my coffee I forgot that your branch would be accessible from your forked repo...
I'll take a look at the modfile in a couple hours once I am home.
Ahhhh yes the lingering setting is almost certainly the issue since I previously had agricraft installed and did not delete the config.
I should have some time to look at the in-game config and verify that its actually working.
Hello !
Same bug in FTB Beyond 1.8.1 with sprinklers. It also get weird rendering things like grass became black when broken ...
Edit! Rebased the final commit onto master instead of overwriting the obsolete and naive fixes.
- New branch: patch-sprinklers-improved
- New commit: 74efbb8
- New jar: agricraft-2.0.0-0.10.0-a18-in-development.jar.zip
(Not really a zip, I added the extension to appease github. You can just rename it.)
Partial Summary:
- Solid blocks now stop the sprinkler, so only the plants and farmland on the surface get the bonus.
- A sprinkler will only search one X,Z column per update/tick, so it's nicer to the server.
- The area of effect now is actually located below the sprinkler, instead of above bedrock at the world's origin (0,0,0). Turns out that a TE's position isn't set until after creation, oops.
- The Mod Options have been reworded to explain the changed config settings.
- - - > E.g. Usage rate in mB/second. And minimum time before watering the area again.
- Sprinklers consume water correctly now, and can be set to arbitrary integer mB/sec rates, and it'll get spread out evenly over the ticks.
- Water Channels now fill up the water buffer inside a Sprinkler. They now check below, instead of above, for them.
- More of the state values of a Sprinkler should now get saved and loaded. Needs testing though.
- Plus a few more boundary and variable checks to catch errors.
Old post:
Quick placeholder, I'm currently on the move but wanted to put that patch up so it could be seen. Will edit once I can sit down properly. Chromebook+crouton+IDE is pretty nice, until it starts acting up. My patch compiles, but I haven't had a chance to run it myself yet, so I'm expecting this to fail.
The how is well documented I think, but I'll still go into the why of things here.
Thank you in advance for any thoughts or observations!
PS: @cap1o Yup, this is still being worked on. And I've had the same graphical glitch too actually, but I hadn't looked into that.
@CodesCubesAndCrashes I'll look into your new patch this evening. Been a little short on time recently, but should be able to test those improvements tonight!
@CodesCubesAndCrashes could you link an alpha18 version of infinity lib? I am getting: pastebin
Getting my IDE setup, but I'll load up your branch tomorrow, and take a look from there if you don't think the dependencies are an issue.
Interesting, hmm. What other mods were included? The jar in my post depends on the current InfinityLib, same as a17. That dependency hasn't changed or been updated. See here. My testing was via the gradle runClient task, which makes things easier, after checking out the patch.
The good news is that I had time today to test and make notes about my patch, and it's looking darn nice. All the core fixes/features are working, and I've already spotted a few quirks or things to improve.
Quick pictures
They show that the farmland under other blocks isn't irrigated, and the plants aren't growing faster.
These commands helped during testing
// The first one turns all the wet farmland into dry at once. Watch the watering.
/fill ~-10 ~-10 ~-10 ~10 ~10 ~10 minecraft:farmland 1 replace minecraft:farmland 7
// This one won't fit inside the chat window input box, but it fits inside a command block.
/give @p agricraft:agri_seed 1 0 {agri_seed:"carrot_plant",agri_growth:9b,agri_gain:9b,agri_strength:9b,agri_analyzed:1b}
Good to see! I'll needle through my mods tonight, I had a whole stack of them to test this with, so no telling what is particularly could be.
Ok had some time to get down to mod testing and getting my ide setup. Ran into a couple problems though, sometime seems to be missing- maybe you can point it out pretty quickly for me.
When I am trying to run the mod jar you supplied by its self I get: crashlog
Building the mod myself does work, and runs, however the sprinkler does not seem to keep anything watered. It does consume water though!
@MidnightsFX Mm, when I made my standalone testing modpack, I had to include TheOneProbe and WAILA for it to run successfully. I assumed that was because they were hard dependencies. Might help? But I'm glad that at least the runClient
way it loads and runs.
So, that's puzzling indeed! I can't see the channel(s), but it looks like there's more involved than just one tank, one channel, and one sprinkler. I haven't examined either the valves, or that second "channel" that looks like a wood block (slots 6 and 7 respectively). Can you summarize what the setup was?
Also, can you confirm what the config settings are? Defaults should be like:
- "Sprinkler irrigation interval minimum" = 100
- "Sprinkler growth chance" = 20
- "Sprinkler water usage" = 10
@CodesCubesAndCrashes I'll include WAILA and TheOneProbe in the modpack and give it a shot again in standalone.
The setup I was using was ~8 tanks directly stacked ontop of each other. With two sprinkler lines, one running off to the right and one to the left. The line you are looking at was the larger irrigation channels (Full irrigation channel?- the larger block shaped ones), whereas the other side was the smaller irrigation channels (small trough shaped). Both sides were having issues irrigating. I'll get some pictures of the whole setup this evening.
As far as the config, I do remember off the top of my head that the sprinker growth chance was 20, and water usage was 10. But I will verify that and the irrigation interval this evening.
@CodesCubesAndCrashes Ok! Standalone is still crashing with WAILA and TheOneProbe, not sure if its being built without deps? Gunna dig into that some more.
Otherwise, got your build working with my IDE, looks like I had not checked out the right thing, hence why sprinkler was not working.
Also here is an updated picture of my current testing setup.
The good: irrigation is working for both pipes, and at the levels expected!
The bad: not all of the tiles are staying irrigated consistently, every now and then a block will loose its watered status, very rarely this results in the block returning to plain dirt from farmland.
Other issue I am seeing is that the sprinkler seems to run something like every-other tick when out of water, so it continues to water blocks, just potentially a little slower.
Besides that looks like water sprinkled doesn't penetrate blocks, which checks out.
Sprinkler config settings look like they check out also!
- "Sprinkler irrigation interval minimum" = 100
- "Sprinkler growth interval" = 5
- "Sprinkler growth chance" = 20
- "Sprinkler water usage" = 10
As far as blocks not staying potentially irrigated, not sure how you want to handle that, I am pretty sure, with random chance there is at least some small chance that any block within the area will revert to dirt given enough time, even with a higher threshold to water a block, or more frequent updates.
Perhaps get all of the top-most blocks in the sprinklers area and split the 'water' and 'growth' functionality out so that 'watering' can be run every couple ticks or so, and you can keep the growth impacting random plants/blocks within range.
@MidnightsFX Thank you for the extra long report! Pretty sure you added on to it over time. :)
- Standalone needs more testing then. If I can't make a working jar, then any fixes are moot!
- Oops about checking out the right branch earlier. But I am glad that there's one fewer bug, hehe.
- It's worth saying that it feels good to see the patch working on other peoples' machines. :D
- The farmland does dry out faster than I was expecting too. I had thought irrigating every 5 or 10 seconds would be possible. I'm still surprised that blocks turned back into dirt though. Each call to
update()
in BlockFarmland decrements the moisture by one, from 7 to 0, and only on the eighth update will it turn into dirt. But it is possible. Hmm. - The stuttering empty sprinkler is a bug that I've got figured out and I'll upload the fix for it too. What is happening is that when water usage per second is <20, then some of the ticks try to consume 0mb of water. And
0 <= 0
. My solution is to now also require the sprinkler have a non-empty water buffer. A reasonable gameplay requirement I think.
So for the dry farmland, I was considering the same idea. First there could be a less frequent "scan" that finds any plants and farmland in range and saves them to two separate lists. And then the update can iterate through the lists however we need. This will make the code even longer, but I think controlling the abilities separately will be good.
@MidnightsFX 's problems seem to be repeating in a20. Hopefully the sprinklers will be fully fixed.
@darthvader45 the fix that was made by @CodesCubesAndCrashes hasn't been merged yet.
Coming up in a21. See 823e739 π
Edit: It makes me a little proud and excited to include my rewrite of the sprinkler logic in a release. ^_^ The fact that I've already thought of ways to overhaul it more doesn't negate that. ;)