minetest-mods / digtron

A modular tunnel boring/construction machine mod for Minetest.
https://forum.minetest.net/viewtopic.php?f=9&t=16295
Other
22 stars 29 forks source link

Planting does not work #10

Open gpcf opened 7 years ago

gpcf commented 7 years ago

The building node can't place seeds to plant plants. This would be a cool addition, so the digtron could be used for agricultural purposes.

FaceDeer commented 7 years ago

I totally agree, I've used Digtron for automated tree farming before - planting saplings does work and it's fun to mow down whole forests. But the farming mod's got a ton of weird placement-related code for seeds, so I'm not surprised it didn't work out of the box. I should have tested that before.

I suspect that given the amount of special-case seed-planting-related code there is in the farming mod I may need to make a special-purpose "planter" module to handle it, the builder module's code is already complex enough as it is. I'll crack open the farming mod tonight and see how bad it looks.

numberZero commented 7 years ago

Note that pipeworks’ deployer can plant seeds, but only if it is under the soil and is directed upwards. That looks a bit weird, but works.

FaceDeer commented 7 years ago

Interesting. Pipeworks does its magic by constructing an elaborate "virtual player" that tricks the game into thinking that a player is actually placing the item in question. I might be able to get away with a simplified version of this as a way to trigger the correct seed-planting code.

FaceDeer commented 6 years ago

Current versions of Digtron should be able to handle planting seeds now, though other potential problems have arisen. I've changed Digtron to call the "onplace" methods defined by the nodes it's placing with builders and in some situations (like seeds) that makes things work correctly, but in other situations (like stairs:slab blocks) it messes them up. I'm going to need to build a blacklist/whitelist system to handle this on a case by case basis.

FaceDeer commented 6 years ago

I'd like to close this issue, but since Digtron now relies on a whitelist where I need to enable each farming mod individually it may not yet cover the specific farming mod you're using. Could you let me know if the current version of Digtron works to your satisfaction?

h-v-smacker commented 6 years ago

I found that the issue isn't fully resolved. There are at least 4 items in farming (redo) which the digtron doesn't plant, namely cotton, hemp, barley and wheat seeds. What's worse, these 4 plants yield separate seeds and products, so they are the ideal candidates for use with automatic ejector. Unlike the regular plants, which are both seeds and products, and won't be ejected properly. Further two items (beans and grapes) aren't planted as well, but they aren't planted in a straightforward manner by hand either (they require wooden support structure to be placed on the soil before planting), so I think they are a special case anyway.

EDIT: I was told that seeds work when facing is set to 1 manually. I stand ashamed and corrected. However, I still cannot get the bicomponent plants to get planted (beans/grapes with their respective wooden supports).

FaceDeer commented 6 years ago

I spent a bit of thought trying to figure out how to get the facing to auto-set correctly for seeds back when I first got farming working, but couldn't think of a way to generalize the solution without hard-coding every specific example. I'll spend a bit more time thinking about it and see if any new ideas come up. Maybe something I can add to the "on_place" whitelist.

I haven't tried getting the bicomponent plants to work before, I'll take a look and see whether that's something that can be set up without a lot of special-purpose code as well.

numberZero commented 6 years ago

@h-v-smacker Am I right you don’t have pipeworks on the server? It has better tools for planting. Moreover, they can be fully automated if you have mesecons. screenshot_20160701_231643 screenshot_20160930_153351

gpcf commented 6 years ago

@numberZero Of course pipeworks works well, but it's nowhere near as efficient and scalable as digtrons.

h-v-smacker commented 6 years ago

@numberZero no, we got everything. Point is, a drawback is still a drawback even if there are alternative means. Otherwise, you know, why not just say "if minetest doesn't work to your full satisfaction, why not play minecraft then?"

So far I determined the nodes crashing the mod (and server) on planting were ethereal:wild_onion_plant and farming:strawberry.

numberZero commented 6 years ago

if minetest doesn't work to your full satisfaction, why not play minecraft then?

Because MC doesn’t work either :P (not to mention license difference and, argh, MS)

crashing

That must be fixed, of course.

To clarify: my point is that digtrons are designed to dig and to build, and don’t need to be suitable for anything else. I’m not against features, they should be implemented cleanly. If that’s possible for planting support, that’s not a problem. But if it requires something like per-nodedef configuration, it should be separated from the core code at least IMO.

Of course pipeworks works well, but it's nowhere near as efficient and scalable as digtrons.

So the problem is more about pipeworks’ inefficiency and not digtron’s incompleteness. That may be a problem, yes. But unlike digtrons they can be automated, so you really don’t need large farm. E.g. the farm on my screenshot produced all that cotton (can’t show, converted already ;) and seeds (72 stacks!) in just a few days.

h-v-smacker commented 6 years ago

@numberZero Digtrons offer one unique quality: they are mobile machines. There is nothing quite like the sight of a digtron chugging along into the sunset while paving a highway.

On a less serious note, a mobile planting machine can offer special benefits in some situations.

numberZero commented 6 years ago

a mobile planting machine can offer special benefits in some situations.

Okay, that’s what pipeworks&mesecons really can’t do at all, as digiline movestones weren’t released. (I assume I don’t need to explain what do they do. But among other uses, they may be used to build self-propelling machines. But I saw such nodes on our “Survival in Ethereal” server only).