DeckerMMIV / FS13_SoilManagement

A mod for Farming Simulator 2013 that adds additional abilities of field and soil management
7 stars 8 forks source link

Yield & mr-mod #26

Closed webalizer-gt closed 10 years ago

webalizer-gt commented 10 years ago

I experienced a very high yield when using SoilMod together with moreRealistic. My test scenario was wheat on a field with organic fertilization, 100% synthetic and optimal soil pH. I got 28472 liter per ha! With only mr it should be 18750 liter per ha (calculated) It´s almost exactly 1.5 times more with SoilMod. Is it possible this comes from OverrideCutterAreaEvent.lua in mr?

local volume, area, spraySum = Utils.cutFruitArea(fruitType, x, z, x1, z1, x2, z2, true, true);
if volume > 0 then
--DURAL -> less difference between no fertilized and fertilized fields  
  local multi = 1.5;
  if spraySum > 0 then                                    
        multi = 2;                  
  end;
  volumeSum = volumeSum + volume*multi;
  areaSum = areaSum + area;
  end;
end;
return volumeSum, areaSum;

If so, how could this be solved? Change SoilMod or MR?

Edit: A side effect of this high volume is that combines can drive only very slow while harvesting.

DeckerMMIV commented 10 years ago

1.5 times more seems to be correct, when the values are optimal for organic fertilizer (adds x1), synthetic fertilizer (adds x0.5) and soil pH (penality).

However I was not aware of MoreRealistic's multi = 1.5 multiplier, which kind of defeats my purpose with SoilMod. - (And I even use MR, but apparently I haven't had the time to take a good long play-through with both MR and SoilMod.)

Though I did notice that the higher volume value caused MR Combines to slow-down more often.

Hmm... This is going to be difficult to "fix", as with the current arguments that cutFruitArea is called with, there is no indication of the "vehicle"-object that calls the function. So can not detect if it is a MR-vehicle or Normal-vehicle that calls cutFruitArea (or the other functions.)

I am annoyed at the way GIANTS coded the CutterAreaEvent, with local variables for the multiplier and just testing for if spraySum > 0 then multi = 2;. - That is the reason why SoilMod always return zero for the spraySum in cutFruitArea, and multiplies the volume instead... with the unintentional side-effect when using MR-equipment.

webalizer-gt commented 10 years ago

Then better mr should check if SoilMod is present and not change the volume i guess?

DeckerMMIV commented 10 years ago

Just got a strange idea:

That should solve the problem I think, as both MR and the normal game will then always multiply volume by 2, thereby producing the intended volume from SoilMod.

webalizer-gt commented 10 years ago

Genius!

webalizer-gt commented 10 years ago

Is this important for this issue? RealisticUtils.lua

    -- actual yield will be twice as much as the standard yield with manure or fertilizer. not quite realistic, but its a game, and we want to do some transport too (who wants to thresh for 2 hours to do a field and fill only one small tipper ?)
    return found, RealisticGlobalListener.priceBalancing*RealisticGlobalListener.seedPriceBalancing*seedPrice, usage, yield*0.75;   -- considering the "2" factor when fertilized, that means 50% more yield than actual figures
DeckerMMIV commented 10 years ago

I did a test, with the fix @1fc68de27e6e69ab9c55d08fa35801780c801ab6. - Have set up a field with barley, organic-fertilizer 1 level, synthetic-fertilizer 100% of correct type, soil pH at 7.4 (Slight alkalinity). Then positioned combine beside field, and saved the game.

Used this savegame for each of four test-runs, where I removed/added mods. And these are the yield results:

  1. Vanilla + sprayed field: 16408
  2. Vanilla+SoilMod + field as specified: 23379 (x1.42)
  3. MoreRealistic+MoreRealisticDLC + sprayed field: 11846
  4. MoreRealistic+MoreRealisticDLC+SoilMod + field as specified: 16881 (x1.42)

Vanilla (16408) vs MoreRealistic (11846) is x0.72 - very close to the 0.75 multiplier in RealisticUtils.LUA. - So that is not an issue I would say.

SoilMod's synthetic-fertilizer is the reason for the extra +0.5 multiplier in both cases (2 & 4), and then the 95% penalty from soil pH 7.4, which is the reason it is "only" a factor x1.42 in the tests where SoilMod is included in the mods.

I can't really say that it is "a bug", that SoilMod can give up to x1.5 more yield (or as low as x0.0) compared to when SoilMod is not used. - SoilMod introduces three variables (soil pH, organic- & synthetic-fertilizer, and a fourth variable; weed plants), compared to the vanilla one variable (sprayed). Depending on how the player(s) tend their fields, the yields from season to season could vary more when using SoilMod.

DeckerMMIV commented 10 years ago

Just finished a fifth test, that did NOT contain the fix - to have something to compare it against:

  1. MoreRealistic+MoreRealisticDLC+SoilMod_without_fix + field as specified: 25315 (x2.13)

That was just horrendous. I'm amazed that I haven't discovered this earlier, with such a huge yield. But it also illustrates that the fix @1fc68de27e6e69ab9c55d08fa35801780c801ab6 works as intended.