Plows, harvesters, fertilizer sprayers: Farm equipment

Hi there all. The paint on my last pull request still hasn’t dried completely, and I keep on finding myself utterly bored with other games. (I’m looking at you Star Ruler 2). I find myself looking at the lack of farm equipment in the future.

Looking through the backstory and finding nothing about about the “Farm Manual Labor Act of 2024”, I decided that we needed more work on farm equipment.

Now I know that plows are generally not also used to sow the seeds, but do you care? Do you think that I should add yet another (mostly) unnecessary function to the vehicle class, or should I consolidate the two machines into a single part with a single function? Planting seeds and plowing the earth at the same time.

I’m not about accuracy here, but I know that some people are fans of simulation in the community. And there’s something about realism in the game design documentation. What do you all think about this?

I thought about plows when reviewing your sweep PR.

They aren’t all that simple. The basic mechanics - “make a mound of earth when moving over stuff” - may sound simple, but then:

[ul][li]It needs to penalize movement heavily.[/li]
[li]Decision of allowing easily craftable plows that could be attached to wooden frames or only “high-tech” plows that require an electric motor to build, but can be lifted from controls[/li]
[li]Pulling plows by hand[/li][/ul]

So if you intend to make a sowing machine, it should probably be separate from the plow and almost certainly in a separate PR.

But you should probably get the two PRs of yours (pet carrier and sweep) to mergeability before PRing the third one. Pet carrier one needs to be “de-pokemonized” (it can be used to capture hostile hulks and tanks at the moment), sweep one needs to stop picking up stuff at the other end of the vehicle.

Okay. I suppose I can do that. In any case, I decided that plows shouldn’t cost epower. That doesn’t make sense for a piece of metal pushing through the earth.

Of course they aren’t in my street sweeper branch. That would be the sort of thing that makes the pet carrier PR so annoying to deal with, the additional functions make it more intrusive.

They’re in my farming_parts branch. Which is working wonderfully right now, but as you have put it, the sowing machine is not the plow. So I’ll have to add an additional flag and function for that. Though it’s weird. It actually makes farming work. The quantities that it produces seem more reasonable to me, though… I doubt that it works so well in real life.

Regardless, the way I implemented it, it does not limit speed. They instead end up skipping over spaces, as one might expect, if you move really fast, just as a plow moved too quickly would do in real life, entering the earth before being pushed out by the resistance and bounced out…

Actually that part is due to lazyiness, but I’ll figure out a way to apply a penalty for plows being applied. Do you suppose that users might object to forcing the cruise control speed down to 10mph if the plows are active?
Though, I did find this when looking for the fastest that someone might expect to plow a field.

That looks like the average survivor if my play style is representative on speed, so what do you think?

Sounds like a good way to run into problems. You’d have to handle not just cruise control, but cruise-less movement, pushing the vehicle (including from collisions), enabling the plow after accelerating and possibly few other cases where the vehicle would look weird if it started plowing.

Just limiting the speed would also make it so that attaching a huge plow to a bicycle would not slow it down much, while at the same time shutting down a 3 V12 monstrosity.

Skipping also sounds like you’re only invoking it on vehicle processing rather than movement. The actual plowing (changing terrain to mounds) should be in map::vehproceed, not in vehicle code.
ctrl+f “dirtmound” in map.cpp and you’ll have an example on how it should be done, except you’ll want to have “plows_on” instead of “valid_wheel_config” and limit self to only digging up those tiles that have plows on them.

As for the speed: you’ll want to increase friction and possibly mass penalty.
For friction, edit k_friction and add some value to the divisor. Currently it looks like: 1000/wheel_area, you want it to be 1000/(wheel_area + plow_penalty)
I’m not sure what to do with mass and is it needed.

Finally, if you want the plow to be pullable by hand, that would require extra code to make it work and then take extra move points in game::plmove

Okay, I’ll just move it there. That’s where that code is. It’d be okay if I added a function called from there to do things like this, right?
I’d rather keep the amount I have to mess around with the map function to a minimum and keep the vehicle system flags inside the vehicle class.

If I’m not mistaken, it’s t_dirtmound. At least, that’s what currently works in my code. It’s also what is applied to terrain in the hoe function in iuse.cpp.

Anyway, I’m imagining the plow being used is one you’d attach to a motor vehicle. Not one that you’d use by hand. Besides, I think that the k_friction should be used while determining if the survivor is pulling it. I don’t know if pulling a shopping cart changes the speed the survivor moves at, but that should be the case even without plow.

I don’t know about that. I think it’s more likely that a plow pulled by a survivor would end up producing a message that should be interpreted as “You try to pull the plow, but fail. Despite everything, you are still not an ox.”

Unless they have the cattle mutations. But I don’t feel like tackling that. I’ll see about getting around to seeing how it works with the survivor pulling it later on.

You could just have (successful) pulling disengage the plow with a message about it happening.

If you’re limiting it to motor vehicles, you should probably also make it prevent very weak engines from pulling the vehicle.
Something like, changing the vehicle::acceleration function to check if plows are on and if they are and acceleration is lower than some x, just return 0.

Eh, I don’t see why someone couldn’t in principle attach a smaller plow to a bike. But a large plow, tilling four squares of soil at once, no, that’s a huge amount of work involved over each square moved. I mean, the hoe does the work in about 3 normal moves, assuming a speed of 100, I think… Yeah, that’s right, right there on iuse::makemound… That’s really quick actually.

Yeah, your suggestion about altering map::vehproceed was good. It took me a while to find the relevant parts, but it did end up making the plow work… Maybe more realistically. Yeah, I can accept that.

Anyway, there seems to be the issue now that it does not apply enough friction to the vehicle. If I increase the friction much more, I think it will affect the speed of the vehicle rather precipitously. More so than normal… Do you have any idea how wide a tile should be? If it’s around a meter, and the mound of dirt is around a foot deep(the average depth recommended for tilling soil for growing crops)…
That comes out to about three cubic feet of soil being turned. That’s nearly .11 cubic yards.

NIST says that a cubic yard of soil masses about 120 pounds per cubic yard. That’s nearly 13 pounds per plow per tile… That’s not bad at all. I suppose that if it was determined solely by mass, then the plow should by all means be operable attached to a bike.

Unless you hit a tree root, given the strength of wood that would likely send you flying if you were moving at a decent rate. It would probably bring you to a complete stop at the very least if you were bracing yourself on the bike.

If it’s operable by bike, it should also be operable by hand. By making it require a heavy engine, you could skip the questions like “why can’t I pull the plow by hand but a volume 1 electric engine (like from a desk fan) can do it?”

Slowing it down heavily should be OK. Tractor engines IRL are quite powerful, a car shouldn’t be able to pull a plow without slowing down to a crawl.

In reality a simple-row plow has a huuuuge amount of drag. keep in mind also, you’re not dealing with just horsepower, but also torque and traction. Don’t be afraid of making large numbers of ordinary vehicles unable to use the thing, they shouldn’t be able to. It should mostly be restricted to heavy vehicles.

Most cars, by my estimation should be able to do it. The density is actually not very high. Normal plows rely on breaking up by pulling though, but then there are roto-tillers which can operate with much lower torque loads. A car can likely pull a small plow without being too powerful.

Supporting that, I’ve found this, which says that it takes about 30 horsepower per bottom, I don’t know the terminology specifically, but I’m going to assume that it refers to the number of elements of the plow that stick into the ground.

That link doesn’t remotely support your position :stuck_out_tongue:

  1. They’re talking about tractors, where everything about the vehicle from wheel selection, to hitch position, to engine location, to ballast holders is designed to efficiently turn horsepower into ability to pull things on soft ground. With a car it’s not going to be the engine that’s the limitation, but the wheels and transmission.
  2. They’re mostly talking about re-plowing fields rather than breaking in new ones, which has a dramatic effect on how hard it is.
  3. If most cars can pull plows, why do most farms (pretty much all of them) use tractors? Hint, in reality most cars can’t even drive on farmland, they’ll get stuck in the soft soil.

Replowing versus plowing, doesn’t seem to be feasible to track in the game. Also I’m unclear as to whether or not cars with speeds of under ten mph move at all, if so then this is much less of an issue for me.

Damn cruise control for not having finer tuning… I should add that actually if the lower speeds work as well.

In any case, I only skimmed that link for the information I was cherry picking. So I stopped reading there.

So I’ll fix that. After looking a little bit more anyway, the amount of force required to break different sort of dirt for the first time varies considerably, and accounts for a much greater deal of resistance than I was imagining for the game. All that math I figured out turned out to be incorrect anyway.

I’m also looking at combine harvesters, those are going to be a bit difficult to represent realistically because they have so many moving parts.

As it turns out, however, seed drills are exactly as complex as the street sweeper scoop, or similarly so. Therefore they can be assembled by the sort of survivor who is halfway to being able to install nuclear reactors in their vehicles.

Best of all, I think that they don’t take nearly as much torque to run. Farming is and always will be about massive amounts of torque.

Also it looks like some of them don’t even need the soil to be tilled before operation. I’m not going to implement that sort because it would make the plows unnecessary.

Also those look about thirty times harder to build from metal sheets and pipes, so probably not survivor expedient.

Sorry for a double post, but I need some input on balancing for the harvester part.

My current version drops items in adjacent storage. This isn’t very representational of the workings of such a part in real life. My concern is that it also makes it much cheaper to implement, while providing the last piece in the game necessary to farm things in such a great quantity that food becomes trivial over the course of a season.

And it does this at the moment for a very, very low initial cost. I was trying to figure out a more accurate(and expensive) mechanism for moving the harvested stuff around.

I was thinking about having the conveyors move the stuff to the first cargo space available, but this turned out to be very complicated to implement(mostly because dealing with adjacent parts is surprisingly annoying), and the code seems like it would be useful in additional situations and I haven’t worked out a more useful way to control how it works.

That’s not the concern here. The concern here is that this gives the survivor the ability to harvest an incredibly massive amount of stuff in a very short time. Combine this with the seed drill and the plow, and suddenly growing food isn’t an issue whatsoever. Everything can be added to a single large automobile and then you have food for years. This is realistic for real life, but only with fertilizers, pesticides, or other soil improvement and pest managing methods.

TLDR; farming is broken.

I don’t think the survivor building anything more complicated than a plow is particularly reasonable. If they instead spawn as existing vehicles, they can be balanced by rarity, over-specialization (generally, very low speed and very large size), and initial damage.
Also I’d think maintenance would be a very frequent issue with industrial machinery, they’re more expected to be maintained and operated by experts rather than being heavily engineered to be fool-proof.
I don’t follow why the layout of the device makes it less expensive, you can make parts arbitrarily expensive, you’re in control of the recipe.
Also if farm tools are mainlined, yields can be adjusted. Currently things are balanced for a survivor being able to support themselves to some extent, if we make farming more efficient we might make yields less so to compensate now that there are alternatives.

Eh, I took the code from somewhere in iexamine. I just put the maximum number of plants produced at the cap in that function. First harvest produced enough for 6000 joints… Not really representative of anything due to the sheer stacking…

I think that there might be some variety of harvester that might be within relatively easy reach of the survivor. That sort is called a reaper, which cuts down the crops, but does not thresh them. That’s an improvement over pressing ‘e’ a thousand times to harvest a whole field.

Also I was asking for advice about how the conveyors should work. I was originally going for a breadth first search, but then put that off to implement the harvesting part, but the process of finding the adjacent parts was annoying to implement. I ended up writing part of it anyway, so I’ll just springboard that.

Alternatively, combining a reaper with a street sweeper looks really promising, as far as stupid hacks go, doesn’t work in real life because the dirt isn’t a surface a street sweeper does well on.

Anyway, there are steps between a reaper and a combine harvester that look slightly more survivor constructable.
Anyway, if a survivor can build a nuclear reactor(okay they can’t), but can put together an atomic battery out of some plutonium and scrap wire, they ought to be able to put together something like a combine harvester. They existed back in the days when people maintained that sort of thing by hand, so I would imagine they might be able to get something working.

I think that the street sweeper might be able to rip the seed information out of plants on the map, I know I didn’t write anything for that. I’ll branch for that tomorrow.

Just FYI, the result of this is either not merging the stuff you’re working on, or reducing crop yields to the point where your new gear doesn’t break the game.
also you’ve been playing really fast and loose with what is craftable, I’m not going to just merge all this stuff if it doesn’t make sense.

Have you looked at my branch? Yeah, I wasn’t going to add a PR until it was ready. That is, until the features work at a level that I’m comfortable showing off, and that the items that I intend to create are craftable.

This is just my work for the moment, nothing that I intend to merge at the moment. Getting the mechanisms in game are secondary in my mind to them working well for the game, so the harvester as is will not be included, it will be replaced with a reaper (a blade running along the ground, cutting down the crops without picking them up or processing them further).

The seed drills work well too, but I’ve not included a recipe in game yet.

I can change the maximum harvest to being based on the reaper’s bonus, which is going to come down a bit from 12 it looks like. Maybe the seeds will also need to be reduced.

I know that you guys have discretion about what you consider acceptable in game. I don’t want to imply that you don’t. I want to meet those standards as they are sensible. After all, I’m the new one here, I have to provide work that is at least somewhat agreeable to the main developers. You among them.

PRing with a [WiP] in name will get you proper reviews faster (WiP = Work in Progress). Until you do it, you’ll just get guesses about what is there.

Plus, it will allow everyone to look at how it will work, make a balancing PR that will bring down hand-harvest results etc.

PRing with a [WiP] in name will get you proper reviews faster (WiP = Work in Progress). Until you do it, you’ll just get guesses about what is there.

Plus, it will allow everyone to look at how it will work, make a balancing PR that will bring down hand-harvest results etc.[/quote]

The hand harvest results are reasonable. I realized that I was playing with a very high level survival character for testing. As it turns out, that affects the yield of the crop.

I’ve made the PR by the way, it’s here