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

URF-seeder support #16

Open
DeckerMMIV opened this issue Aug 6, 2014 · 9 comments
Open

URF-seeder support #16

DeckerMMIV opened this issue Aug 6, 2014 · 9 comments

Comments

@DeckerMMIV
Copy link
Owner

Commit @13885d720bb99b29a765509546eb188f0fcb6d22 contains "some" support for URF-seeders.

The requirement is that the URF-seeder script must send an augmented fill-type to SprayerAreaEvent.

The augment is to add +128 to the fill-type value, as then a different SoilMod spray-sub-function (of the 3 fertilizer-types) will be used, which does not check for crop's first-growth-state.

Example, where using hardcoded fill-type "fertilizer":

SprayerAreaEvent.runLocally(sprayingAreasSend, Fillable.FILLTYPE_FERTILIZER + 128);
g_server:broadcastEvent(SprayerAreaEvent:new(sprayingAreasSend, Fillable.FILLTYPE_FERTILIZER + 128));
@webalizer-gt
Copy link
Contributor

Thank you! Will test tomorrow.
Does it matter which fertilizer type i load = different types for different fruits like normal in soilmod?

@DeckerMMIV
Copy link
Owner Author

Yes it matters. - If a crop 'likes' FILLTYPE_FERTILIZER3, then you will not get any synthetic fertilizer boost at harvest, if URF-seeder was spraying a different fertilizer type, and there were no other synthetic fertilizer sprayed during the crop's later grow phases.

So yes, "different [synthetic fertilizer] types for different fruits like normal in SoilMod".

@webalizer-gt
Copy link
Contributor

Ok. The good news is: it works.
But I should have done more testing with soilmod. I've assumed that there are also several levels of synthetic fertilizing like the organic one have. IRL you would never achieve 100% fertilization with under root fertilization. It´s only a initial nutrition, let´s say 25%. In this case, the function for URF-seeders would be just as unrealistic as in the vanilla game.
I guess there is no (simple) possibility to control the percentage of synthetic fertilizer?

@DeckerMMIV
Copy link
Owner Author

Unfortunately no. The synthetic fertilizer (and herbicide) has only one level; it can be 'set' or 'not-set', at any given point in the foliage-layer.
I am currently using all available 16 bits (channels) of a foliage-multi-layer, so it will be difficult to add "levels" to synthetic fertilizer:

    layer-name      num-of-channels     possible-valueset
    =====================================================
    fmc_manure                2               0-3 (manure density)
    fmc_slurry                1               0-1
    fmc_lime                  1               0-1
    fmc_weed                  3               0-7 (1-3=withered, 4-7=alive)
    fmc_fertilizerOrganic     2               0-3 (level)
    fmc_fertilizerSynthetic   2               0-3 (1=typeA, 2=typeB, 3=typeC)
    fmc_herbicide             2               0-3 (1=typeA, 2=typeB, 3=typeC)
    fmc_soil_pH               3               0-7 (calculated into pH range)

@webalizer-gt
Copy link
Contributor

I let my brain work and came to two possible solutions.
Fist option:
Remove one type of fmc_fertilizerSynthetic and fmc_herbicide. Then change fmc_fertilizerOrganic to ONE combined layer for total fertilization, like the pH layer. In my opinion this seems realistic, since one IRL can hardly detect the difference between organic and synthetic fertilizers when applied to ground. You can measure NPK values in the soil but not from what kind of fertilizer they come from. You could control the intensity of fertilization with different fertilizers and/or litersPerSecond applied?
Would remain free a channel, if I counted correctly.

Second option / question:
Is there a limit for multi-layers? You could for example separate visible and invisible layers to two multilayers.

In the end it is your mod and it is solely up to you whether you want to make such extensive changes for the "stupid" URF-Seeder ;-) I would be delighted if you consider my first proposal, because in my opinion it would be a principle clearer solution for the SoilMod and not only a possibility to integrate URF.

Regards
Tom

@DeckerMMIV
Copy link
Owner Author

  1. It is not possible for me to control the intensity as such. - The problem lies in how the setDensity../addDensity... functions work towards the foliage-layers and how often they are called for the same area (e.g. cuttingArea or likewise.)

Example: Using addDensity... to add +1 at the foliage-layer for an 'area' a sprayer-tool defines. At the next frame-update the sprayer may have moved just a little bit, and the new 'area' will most likely overlap the previous one, so calling addDensity... will now add +1 to some of the previous area-parts (making it +2). This will quickly "add up", so the foliage-layer's values (bits/channels) reach the maximum value - which is probably not always what you want.

That is why I use a one-bit (one channel) for the slurry and lime layers, so the vehicles/tools can spread as much as they want at the same 'area' - it will never reach a value higher than '1'.
Then later, during either cultivator/plough or growth-cycle, I can control how much (intensity) to add to the "levels" in a different foliage-layer.

  1. I do not know what the limit is, if there is one, regarding the number of foliage-multi-layers.
    I have noticed, that the usual way map-authors add layers, is by adding a containing only one - maybe it is because most map-authors do not know the technical details regarding additional foliage-sub-layers.

Also there would be a resource situation to consider, as "just adding more" will eventually cause other problems for players.

But yes, adding more "information storage" (i.e. more layers) would give additional possibilities.

@webalizer-gt
Copy link
Contributor

Sure. Forget about the intensity. But a leveled system as used with organic and pH should be possible?

@DeckerMMIV
Copy link
Owner Author

I think it could, but I have no good ideas for how to actually make it, with the limitations of the foliage-layers. - It will not be implemented in this current major version of SoilMod.

Even if there was to be a "leveled system", what effect - or "rule set" - should it provide? The easy thing right now, is to have it only affect the "yield during harvest", but could there be even more possibilities?

The base game does not have any notion of "quality of crops", but I imagine there could be some other "fill-types" or meta-data for them, that would add something like:

  • low-grade crops; too moist, harvested too early, contains herbicides, etc.
  • medium-grade crops; good for most parts, but one or two properties not within required thresholds.
  • high-grade crops; excellent quality for all attributes/thresholds.

Unfortunately such a thing would require an almost total-conversion of the base scripts, which is too big a job to do.

@webalizer-gt
Copy link
Contributor

Other than my problems with choppedStraw the urfSeeder is working good now. Added the additional fertilizer types with their hud.
If mp/server tests go well it´s ready to be released when the SoilMod with the needed functionality goes official.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants