MineMaarten / PneumaticCraft

PneumaticCraft source
Other
84 stars 50 forks source link

drone not smart when filling a 1x1 hole #756

Closed Lorenzo77 closed 8 years ago

Lorenzo77 commented 8 years ago

hello MineMaarten, just found a funny behavior from a drone. i use a very basic program just to fill a 1x1 hole from the bottom, no variables, no globals, just GPS coordinate. when the drone start, he go to the bottom, place a first bloc below him and place another above him and he is stuck ^^ so he need to teleport but there's an hole on is position.

i put a beautiful glass tower to check is work and this is the result for the testing (O=air / 1 = bloc): 10110110110111 11011011011011 i see it like a Gruyère (cheese with holes) ^^

the teleport take a lot of time (and air) and the drone's work is not good at all ... no problem with a 2x2 hole (or more) unless i add more drones

MineMaarten commented 8 years ago

Yeah, I can see this happening. Basically the drone places down a block below, and then tries to place a block above it. It realizes it can't, because there's an entity in the way (itself). And then tries to place the next block instead, above the drone, which it can do.

Lorenzo77 commented 8 years ago

maybe there is a solution to fix this : when he is in place bloc mode, always save the position for the last bloc added and if the next is on the same line (x/y/z), just move the drone before on the same vector and then add the bloc.

have a record the the last bloc added and maybe the following for each drone can help improve work between them (for place bloc mode) ?

MineMaarten commented 8 years ago

I now basically excluded the drone from the 'are there entities in the way'-check, and made sure that works smoothly.