merlinlikethewizard / Mastermine

A fully automated strip mining network for ComputerCraft turtles!
MIT License
83 stars 20 forks source link

Turtles looping forever and problems setting up #35

Closed DVD-DAVIDE closed 2 years ago

DVD-DAVIDE commented 2 years ago

Since I've given a look at actually open issues, and found nothing similar, I'll just make a new one.

I have installed the hub on the pc, set up gps system, repeater, monitor and disk, just as by the tutorial. No problem there.

But when it came to the turtles, there started the problems. (Just so you know: I have tried to wipe the fs and reinstall the turtle.lua file again) The turtle.lua file works and it installs everything. The turtle calibrates, finding its direction. Then they receive a go_to_home directive and the weird things happen. They hover at ground level until they find a hole (which in my case was a river, more than 16 blocks from the mine entrance), and park themselves in there. When I try to start the mine, they start going back and forth from their parking spot to a block which is on ground level (again, the parking spot is at y -1) and three blocks away from the mine entrance.

In config.lua, the mine entrance coords are correct, both on the disk and the root of the pc. GPS works fine.

I don't know if that means anything, but the turtles have files named config.lua in their root dir, but they're empty.

I'm running Minecraft 1.16.5, with FML 36.2.20

Mod list (Those I think might be relevant are first):

merlinlikethewizard commented 2 years ago

Hmm, I'm not immediately sure what might be going on... usually I'd say the coords may be wrong, such as the mine entrance being one block too low in the y direction (should be player foot height). But if that's correct then I'd wonder what state the turtles are in when the mine is off (park?), and then what states they're switching between while going in loops and what they are printing on their screens in each of the tabs. Hopefully it's something small and can be fixed easily, I doubt another mod is causing issues.

DVD-DAVIDE commented 2 years ago

I'll make a few screenshots as soon as I can.

DVD-DAVIDE commented 2 years ago

This is the setup I have. 2022-04-10_18 58 20 The turtles go there. (note: there's only one block between them) 2022-04-10_18 58 29 These are the turtles mastermine tabs. They don't seem to report anything on the other tabs. In this moment, they are reported as parked. (mining turtle) 2022-04-10_18 58 53 (chunky turtle) 2022-04-10_18 59 25 Now I have turned the mine on, and they are both marked as idle. 2022-04-10_19 00 50 2022-04-10_18 58 29 Extra: I left the world (singleplayer), then got in again and the turtles were both set in halt state. I tried with reset (from the main monitor), but they either went halt > idle > halt (mining) or halt > lost > idle > halt (chunky) Rebbot did nothing. With return they did one loop, near the exit/entrance and then back. They are now halted.

2022-04-10_19 17 41

I think I'll try with a clear world, to see if it happens because of something in this one.

DVD-DAVIDE commented 2 years ago

It actually seems to work on a new world. Maybe it was because of somthing I had done on the other one. Still, I had a bit of trouble when I left the world and then rejoined, with the turtles being lost and going around the perimeter of the control area. After removing those two and placing new ones it was all good. Is there a state of the mine I should get to before leaving? (I mean, should I first turn off the mine or can I just quit?)

merlinlikethewizard commented 2 years ago

Glad you got it working eventually. Now that I see what they were doing I'm pretty sure that one way or another they thought they were 1 block higher than they were. When turtles are parking they try to find the end of the line of turtles (to park in back), so that's why they went until they hit the river, they thought the grass blocks beneath them were other turtles.

To answer your question, in theory the only problem with leaving the world is that if your turtles are too far away they won't turn on when you reload the game. Otherwise they should be able to start from wherever and pick up where they left off. I suppose in the control room they could get lost on their way back, they aren't the smartest about that but usually they find their way. Because of the chunk loading problem I always turn the system off and wait for them all to park before turning off my game.

DVD-DAVIDE commented 2 years ago

To answer your question, in theory the only problem with leaving the world is that if your turtles are too far away they won't turn on when you reload the game. Otherwise they should be able to start from wherever and pick up where they left off. I suppose in the control room they could get lost on their way back, they aren't the smartest about that but usually they find their way. Because of the chunk loading problem I always turn the system off and wait for them all to park before turning off my game.

Thanks.

Anyways, I noticed that sometimes turtles leave a block on the level above (when tunneling). It's generally not a problem, but once I got the chunky turtle returning first, so they got stuck. Is it a bug in code or something else? Is there an easy fix to prevent that? (Btw, should I make another issue for this?)

merlinlikethewizard commented 2 years ago

Ah, my old friend. This is a bug that I have been aware of and that unfortunately does not have an easy fix. I've tried incorporating some timing and other strategies so that it happens as little as possible, but it has to do with trade-offs in turtle behavior. Hopefully it doesn't happen too much, but if it becomes a problem feel free to post an issue so that it's something I'll remember to take another look at.

DVD-DAVIDE commented 2 years ago

Okay. I think this little compromise is acceptable. Thanks for everything.