Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Farming parts #13376

Closed
wants to merge 68 commits into from

Conversation

Projects
None yet
6 participants
@epsilon-phase
Copy link
Contributor

commented Aug 21, 2015

Do you have lots and lots of seeds? Good for you.

Now there are parts that might be used to actually cultivate at reasonable speeds. Plows for tilling, seed drills for sowing, and reapers for reaping.

What more could you need?

epsilon-phase added some commits Aug 13, 2015

Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
…into farming_parts

Conflicts:
	src/vehicle.cpp
	src/vehicle.h
Merged master back into branch. compiles correctly, if nothing else.
Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA
…into farming_parts

Conflicts:
	src/map.cpp
Replaced a rather inaccurate combine harvester with a sublimely simpl…
…e reaper.

Cuts down your crops, picking them up is something for later.
@kevingranade

This comment has been minimized.

Copy link
Member

commented Aug 23, 2015

@narc0tiq

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2015

Yeah, farming equipment tends to draw directly off the engine's power
train, so subtracting engine power directly sounds like the right idea.

On Sun, Aug 23, 2015 at 10:23 PM Kevin Granade notifications@github.com
wrote:

The plow part should add mass as normal for any part.
When active, it should also reduce engine output directly instead of
adjusting vehicle mass and k_whatever.


Reply to this email directly or view it on GitHub
#13376 (comment)
.

@epsilon-phase

This comment has been minimized.

Copy link
Contributor Author

commented Aug 23, 2015

That's done.

@epsilon-phase

This comment has been minimized.

Copy link
Contributor Author

commented Aug 23, 2015

It does seem to leave my semi with a rather high speed, but that seems to be acceptable to me. At any case, you can only plow on a bike at -1 mph.

@@ -3249,7 +3286,7 @@ float vehicle::k_friction() const
{
// calculate safe speed reduction due to wheel friction
float fr0 = 1000.0;
float kf = ( fr0 / (fr0 + wheels_area()) );

This comment has been minimized.

Copy link
@kevingranade

kevingranade Aug 23, 2015

Member

Ideally return these to they way they were originally so they don't appear in the diff at all.

@@ -889,6 +890,7 @@ class vehicle : public JsonSerializer, public JsonDeserializer
int aisle_lights_epower = 0;
int recharger_epower = 0; // total power consumed by rechargers
int camera_epower = 0; // power consumed by camera system
int plow_engine_drag = 0; //The amount of friction applied by plows on the vehicle.

This comment has been minimized.

Copy link
@kevingranade

kevingranade Aug 23, 2015

Member

Perhaps make this a generic "accessory_drag" value, for example when we add trailers the trailer would add drag as well.

"item" : "v_plow_item",
"difficulty" : 4,
"location" : "under",
"bonus": 1500,

This comment has been minimized.

Copy link
@kevingranade

kevingranade Aug 23, 2015

Member

The bonus value and the comment about it are obsolete.

{"item": "plastic_chunk", "count": [1, 2]}
]
},{
"type" : "vehicle_part",

This comment has been minimized.

Copy link
@kevingranade

kevingranade Aug 23, 2015

Member

Seed drills and reapers are also going to be a drag on a vehicle. If I understand correctly, they are either going to be coupled to the vehicle powertrain directly, or they will get power from being drug across the ground (think of the kind of children's toy that is actuated by turning its wheels). Either way, they'll be a drain on power just like plows, perhaps with different values.

@kevingranade

This comment has been minimized.

Copy link
Member

commented Aug 23, 2015

I can't test right now, but this seems likely to do the right thing, we probably just need some number tweaking now.

@epsilon-phase

This comment has been minimized.

Copy link
Contributor Author

commented Aug 24, 2015

Seed drills and reapers are generally actuated by their motion across the
ground, excepting a few very advanced ones that require hydraulic power
from the tractor. So yeah. Hmm. I'll just assume that the powertrain is
what they are tapping from.

On Sun, Aug 23, 2015 at 6:20 PM, Kevin Granade notifications@github.com
wrote:

I can't test right now, but this seems likely to do the right thing, we
probably just need some number tweaking now.


Reply to this email directly or view it on GitHub
#13376 (comment)
.

@@ -4762,6 +4882,9 @@ void vehicle::refresh()
alternator_load = 0;
camera_epower = 0;
has_atomic_lights = false;
plow_engine_drag = 0;

This comment has been minimized.

Copy link
@kevingranade

kevingranade Aug 25, 2015

Member

Instead of special casing them all the same way, add a flag like "POWERED_PART" abd trigger off of that.

This comment has been minimized.

Copy link
@epsilon-phase

epsilon-phase Aug 25, 2015

Author Contributor

Wouldn't that prevent them from being used independently, or being switched off then? That doesn't sound realistic, or am I missing something else?

This comment has been minimized.

Copy link
@Coolthulhu

Coolthulhu Aug 25, 2015

Contributor

Your current solution has 3 different variables that are summed anyway. Just merge them into a single variable like extra_part_drag. Just the drag calculations.
Then add a flag for parts that cause drag, so that you aren't checking has_flag("PLOW") || has_flag("REAPER") || has_flag("PLANTER"), just has_flag("POWERED_PART") for the extra drag calculations. You'd still check for plow/reaper/planter in their exclusive sections (ie. actual plowing etc.).

Though I'd name the flag differently. POWERED_PART be interpreted as electrical power, DRIVETRAIN_POWERED is unambiguous. Or EXTRA_DRAG.

This comment has been minimized.

Copy link
@kevingranade

kevingranade via email Aug 26, 2015

Member

This comment has been minimized.

Copy link
@epsilon-phase

epsilon-phase Aug 29, 2015

Author Contributor

Okay thanks, I'll get on that.

@Coolthulhu

This comment has been minimized.

Copy link
Contributor

commented Aug 30, 2015

Is it still WiP or should be ready for testing+merging?

@epsilon-phase

This comment has been minimized.

Copy link
Contributor Author

commented Aug 30, 2015

It should be good to go for testing and merging.

On Sun, Aug 30, 2015, 8:35 AM Coolthulhu notifications@github.com wrote:

Is it still WiP or should be ready for testing+merging?


Reply to this email directly or view it on GitHub
#13376 (comment)
.

@epsilon-phase epsilon-phase changed the title [wip] [CR] Farming parts Farming parts Aug 31, 2015

@kevingranade kevingranade referenced this pull request Sep 1, 2015

Merged

Sharing plows #13467

3 of 5 tasks complete
@kevingranade

This comment has been minimized.

Copy link
Member

commented Sep 25, 2015

Merged after more additions and bugfixes in #13467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.