Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upFarming parts #13376
Conversation
epsilon-phase
added some commits
Aug 13, 2015
epsilon-phase
added some commits
Aug 23, 2015
This comment has been minimized.
This comment has been minimized.
|
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.
|
This comment has been minimized.
This comment has been minimized.
|
Yeah, farming equipment tends to draw directly off the engine's power On Sun, Aug 23, 2015 at 10:23 PM Kevin Granade notifications@github.com
|
This comment has been minimized.
This comment has been minimized.
|
That's done. |
This comment has been minimized.
This comment has been minimized.
|
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. |
kevingranade
reviewed
Aug 23, 2015
| @@ -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.
This comment has been minimized.
kevingranade
Aug 23, 2015
Member
Ideally return these to they way they were originally so they don't appear in the diff at all.
kevingranade
reviewed
Aug 23, 2015
| @@ -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.
This comment has been minimized.
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.
kevingranade
reviewed
Aug 23, 2015
| "item" : "v_plow_item", | ||
| "difficulty" : 4, | ||
| "location" : "under", | ||
| "bonus": 1500, |
This comment has been minimized.
This comment has been minimized.
kevingranade
reviewed
Aug 23, 2015
| {"item": "plastic_chunk", "count": [1, 2]} | ||
| ] | ||
| },{ | ||
| "type" : "vehicle_part", |
This comment has been minimized.
This comment has been minimized.
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.
This comment has been minimized.
This comment has been minimized.
|
I can't test right now, but this seems likely to do the right thing, we probably just need some number tweaking now. |
This comment has been minimized.
This comment has been minimized.
|
Seed drills and reapers are generally actuated by their motion across the On Sun, Aug 23, 2015 at 6:20 PM, Kevin Granade notifications@github.com
|
epsilon-phase
added some commits
Aug 24, 2015
kevingranade
reviewed
Aug 25, 2015
| @@ -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.
This comment has been minimized.
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.
This comment has been minimized.
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.
This comment has been minimized.
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.
This comment has been minimized.
kevingranade
via email
Aug 26, 2015
Member
This comment has been minimized.
This comment has been minimized.
epsilon-phase
added some commits
Aug 25, 2015
This comment has been minimized.
This comment has been minimized.
|
Is it still WiP or should be ready for testing+merging? |
This comment has been minimized.
This comment has been minimized.
|
It should be good to go for testing and merging. On Sun, Aug 30, 2015, 8:35 AM Coolthulhu notifications@github.com wrote:
|
epsilon-phase
changed the title
[wip] [CR] Farming parts
Farming parts
Aug 31, 2015
This comment has been minimized.
This comment has been minimized.
|
Merged after more additions and bugfixes in #13467 |
epsilon-phase commentedAug 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?