Straw Golem Rebaled

Straw Golem Rebaled

5M Downloads

[1.15.2] Build from 06/12. Golem ignores chests.

Geethebluesky opened this issue ยท 22 comments

commented

Copied from Curseforge.

The golem just wanders around and ignores the chest entirely:

Screenshot

The 2 chests in that screenshot are 1 Oak chest from Quark mod (left), and 1 Minecraft original chest (right). Neither seems to appeal to the little guy.

On Forge 31.1.88
No crash, let me know what other info you might need!

commented

Ok - so I realized that my implementation wouldn't see modded chests - that should be fixed for the next build - as to why its ignoring the vanilla chest in this case - I don't know

Looking into it!

commented
commented

Sorry, still no change to the chest-ignoring issue.

Poor thing also gets stuck on half-slabs I have over my water channels as well and just stops doing anything.

They can also go through closed fences and jump on top of fences, even... I have screenshots. Are those intentional by any chance?

commented

Now I've tested this quite a bit and haven't really been able to reproduce - however I always do notice sometimes the golems do wander for longer than I'd like before delivering the item

I've already committed a fix for this - golems now should deliver to a chest (if they can find it) basically immediately after they pick up a crop.

Perhaps that will resolve this issue as well.

I'm also investigating an issue / improvements for the way I detect if certain blocks are "reachable", that could end up helping as well.

commented

That might be it, I did notice that one of the golems eventually delivered to a chest, but it took maybe 10 minutes or so before it did, even though it was right next to the chest.
Another golem that was next to it didn't find that chests though, even though it was spawned and harvested at the same time.

commented

That might be it, I did notice that one of the golems eventually delivered to a chest, but it took maybe 10 minutes or so before it did, even though it was right next to the chest.
Another golem that was next to it didn't find that chests though, even though it was spawned and harvested at the same time.

https://drive.google.com/file/d/1RFH1VQ6ti84FQGQyfP1Sed79HVHCg3Q1/view?usp=sharing

Try this and see if its better?

commented

It seems to be better. The first few golems recognized the chest and immediately put the crops in the chest, but after creating new golems and more crops grew and then were harvested, they just stood in that spot for a while. And didn't recognize any chests, even newly placed. But they do seem to eventually place it in the chests, from what I can tell.

commented

Hmmm. Can't say they are. I've still been unable to replicate the issue with the chests.

Perhaps if I had a copy of the world save?

I'll see if I can replicate these new issues.

As is I'm using the near-exact same system (with improvements to allow it to harvest stem grown blocks) as the old mod for the harvest AI goal, and an extremely similar system for the delivery AI goal.

Perhaps I should switch to a new implementation for these tasks..

commented

I've run into the same problem when testing my modpack on a server.

When I first spawn a golem, it harvests the crops and places it in a nearby chest, modded or vanilla, but then by the time a new crop grows, it seems to forget that a chest is nearby and just holds the item.

commented

Okay - so from testing I see the problem arises with the method responsible for finding the block to move to, which is actually vanilla code.

The further solution I am attempting is having golems "remember" chests they'd used previously so it doesn't have to search for a chest each time it tries to start the delivery goal

Will update this comment with results when I have them

EDIT:
Okay - so it was basically this:

First, golems would sometimes get preoccupied with chests they couldnt reach. I fixed this by raytracing from their to the chest position and checking for an obstruction

Also, if golems weren't immediately able to find a chest (e.g. due to something obstructing their view of it) it would start them wandering around. I fixed this by reducing the time for the next check to start the delivery task and disabling the wandering task when they have an item

Crops are 0.07 blocks less tall, and so when I'm having the golems search with a y height of 1, that fails because the blockpos is an integer, so instead of being at y=4 theyre considered at y=1, and the searchForBlock method in MoveToBlock uses BlockPos.

This wasn't a problem before because they would wander around - and eventually off the crops, where they could see the chest again, but in the change that made them significantly faster at delivering once they harvest I made it so they dont wander when holding an item, which created this issue (while fixing the earlier one)

So I just increased the height it searches to 3 blocks. This will have some performance impact but it should be negligible

Then it led to another issue which is how I raytrace to see if the chest is in the line of sight. Since their blockpos would be in the Crops block, it would consider that block "in the way"

Both of these should be fixed.

commented

I tried your last Dropbox build. The golem still stalls after depositing a few carrots in the chest I have next to the stone stairs.

I remade the farm to get rid of all the half-slabs because they seemed to get him stuck, but that wasn't the problem; he's just standing in the middle of the field with a carrot in hand, perpendicular to the chests in my screenshot from a few days ago, and doesn't move.

Sometimes when I bump into him, he'll take notice of the chest and go deposit, but otherwise he's pretty much holding on to his carrot.

commented

Not sure if this is the way you want to go, but how much work would it be to assign a chest to the golem?

Two other mob-farmer mods (Thaumcraft, Rats) have a mechanism like that, where an item is used to connect or "assign" a mob to a specific chest. Would solve the issue with things being visually in the way?

commented

Are you sure you're using the latest dropbox build? I verified myself that the getting stuck on farmland issue no longer occurs and would be very surprised that it is still occuring on your machine.
And by verified, I mean I literally left a LAN world running for an hour and they were still efficiently gathering and delivering crops.

@WenXin20 perhaps you could confirm?

I don't really want to sacrifice the simplicity of the current way it is, but I could add that as an option for players who are so inclined, it wouldn't be much work given that I already added memory for chests.

commented

I didn't notice them getting stuck on farmland, but I think @Geethebluesky said they were getting stuck on half slabs, which I haven't tried yet. I'll check again to be sure

commented

I didn't notice them getting stuck on farmland, but I think @Geethebluesky said they were getting stuck on half slabs, which I haven't tried yet. I'll check again to be sure

And this is with the newest build (for no getting stuck on farmland?)

That would corroborate what I'm seeing, but I suppose I could add the feature of "prioritizing" a chest somehow. Not sure what implementation would best "fit" the theme of the mod for that though

I've also been porting the mod to fabric which is taking more time than I'd like

commented

Newest build, yes, but I will need to check again to be sure. I only tilled a few grass blocks into farmland, so they weren't walking on it a lot.

commented

They are walking normally on farmland and half slabs for me.
I've also noticed that when the golems
Is first summoned, it will immediately harvest, but after that it can take quite a while before noticing that another crop is fully grown, even if there are several.

commented

They are walking normally on farmland and half slabs for me.

Okay good, so I'll consider that issue (which is what this thread is for) to be fixed.

Is first summoned, it will immediately harvest, but after that it can take quite a while before noticing that another crop is fully grown, even if there are several.

This I've noticed, and I believe its simply down to the wandering AI task executing before they have a chance to find a crop.

Now I do like them wandering but I would like it to last less long. I'll investigate ways to improve that after I finish porting to fabric :)

commented

Like I said in my last comment, I removed all the half-slabs from my farm to see if that was the problem or not. It didn't help.

I just redownloaded the file you provided on June 16 at 2am MDT with this link, to make triply sure:
https://drive.google.com/file/d/1-M07pNtq61W43A4phJUeCeYzkFeiQZ1T/view?usp=sharing

Little guy is now holding onto a potato, sitting on top of the block I put above the water square, and staring into the distance. (I think the poor thing has PTSD from his difficult past being gnawed on by filthy rats.)

After I pushed him, he went to deposit the tato in the chest nearby. Now he's standing on top of the chest and again staring into the distance. I want to give him a hug and a cigarette.

So in my game at least, the little guy doesn't deposit unless he's pushed to do so. Might have to do with being on top of the block, not sure.

commented

The next build will have the ability to set a priority chest.

This issue doesn't seem to occur at all on latest builds anymore, either.

So I'm considering the issue closed. Keep an eye for the next release, there's a lot of new stuff :)

commented

Hello, I've noticed that if there is a chest in the ground (surrounded by farmland on all 4 sides), the golem will walk up to the chest, but then get stuck holding the item.