[IC2 Exp|IC2 Classic][1.7.10] Crop Nei Plugin

  • I started weeks befor i made the Crop Helper Question thread on a Nei Crop plugin.
    Because i was bothered that almost everyone outside of the IC2 wiki said that IC2 Crops are totally random and hard,
    And said Agricraft is the better solution for it.


    But now lets talk about the Plugin:


    Features:


    -Basic Usage/Crafting key support. (Shows how to get and in what combos you can use the crop)
    -Point info (how many points which combo gains)
    -Adv Crop info. (If a crop needs special terrain or something)
    -Custom calculator (Creative & Survival) (allows to test combinations and see what results comming)
    -Basic Addon support (as long they use the API right they will be added to the calculator)
    -API for adv Crop Info (I can not support addons by default)


    I will make some pictures of it and put them in here too soon but for now i hope thats a start^^"


    To prevent the question: There is no set Release date for it yet.
    planned is the same date as the IC2 Classic update. (Reasons)


    Which IC2 Versions get supportet?
    It was planned as Classic only Plugin.
    (Before i started) decided it should be supporting Exp and Classic.


    And at the moment it is supporting IC2 Exp and My Classic Version.
    Immibis version is not supportet, simple reason. He does not support the API Right.
    So the plugin will not load with Immibis Classic.


    Also another thing: It is a Forced Client Only Plugin.
    Client Sided everything will work (included singleplayer worlds)
    Server sided means Crash.


    Why forced Client?


    For some features i needed to Decide do i make a forced Client Only version or Server & Client Required.
    ^^" Result is Client only.


    Since this mod is still in testing and not released yet i am open for Ideas^^"


    API is out: ClickMe


    Here is the release: ClickMe


    I hope you like the idea.

  • Here are some pictures of the Features...


    First: Nei Plugin itself which shows which combo result into what (quick view simply)..
    Second: Crop Breeding Calculator Survival (uses crops from the Player), which tells you the result by manually adding them.
    (Modular Version of the Nei Plugin)
    Third: Crop Breeding Calculator Creative. Same as the Surivial but provides all Loaded Crop Plants...
    Last: The additions to IC2.

  • Meeeh.. Random is the best way to go, there was once such nei plug-in and it was counter productive. I'll try it out, but I doubt it is that much useful.
    Also, can you render the items dropped by the crop instead of showing crop bags? Perhaps a bag of redwheat would be swapped for a piece of Redstone named "redwheat" (or at least hovering the mouse over it would show "redwheat" instead of redstone).
    I assume it would be a pain to do so for gt crops as it is hard to obtain the id names for them (you gotta look them up in game) so I propose adding your own coal dust for example, not registered in the ore dictionary and impossible to obtain, it would just be used to showcase the withereed.

    Quote

    Java script, which happens to be the language in which minecraft is coded

  • Also, can you render the items dropped by the crop instead of showing crop bags?


    Nope i can not do "Dropping items" from the crop as Rederring because that would require a Fake Crop Tile which would be hard to create...
    What i can do is hardcode Items for the Crops (as you said Redstone as Redwheat and so on). Only thing is that would go into Adv Support,
    So IC2 Addons need to use the API (Which i need to create xD) to provide Display Items & Extra Informations... (ill try to spread it out as far as possible)


    Meeeh.. Random is the best way to go, there was once such nei plug-in and it was counter productive. I'll try it out, but I doubt it is that much useful.


    First as you saw in the Nei Plugin Picture it showed what would be the result and how many points are to them... That is only a indicator which combination "can" create what,
    what he picks from all possible things is 100% random...
    Second this plugin is only a assistent to tell you which crop combinations give you the best chance (or even a chance) to get what you want.
    Simply it tells you: Crop A + Crop B can be Crop C if you are really unlucky it takes a long time or if you are lucky you gain it the first time.


    And could you throw me a link to the other Nei Plugin i want to see the difference and see what it did^^?

    • Official Post

    And could you throw me a link to the other Nei Plugin i want to see the difference and see what it did^^?

    He is probably talking about immibis's. It was a simpler addon that showed you pages of text (via NEI) like this:
    "Stickreed + Stickreed = 9.8% Ferru" [Not actual value]

  • He is probably talking about immibis's. It was a simpler addon that showed you pages of text (via NEI) like this:
    "Stickreed + Stickreed = 9.8% Ferru" [Not actual value]


    ok... He can not calculate a percent chance for CropBreeding that is impossible, unless he can see the Future... xD

  • ok... He can not calculate a percent chance for CropBreeding that is impossible, unless he can see the Future... xD


    If you mean that Ferru has a 0% chance of appearing when breeding Stickreed x Stickreed, you could be right, but if you mean that the chance can't be calculated, I have to disagree: all the plugin would have to do is calculate the weights for each possible result, then add them up and divide each weight by the total to get a percentage chance. I wrote myself a small program to do that back around November or December of 2014, but I deleted it.


    What I've been doing lately is breeding my existing crops to get more of them, and if I happen to get something different (other than a weed), I let it grow, and then try to transplant it into a separate field for that crop type.

  • If you mean that Ferru has a 0% chance of appearing when breeding Stickreed x Stickreed, you could be right, but if you mean that the chance can't be calculated, I have to disagree:


    Then you are wrong... Because the Percentage chance changes every time he tries to breed!
    Why? Simply he collect all possible points together (which would make the 100%) and then pick a random number between 0 and that max number.
    Then he loops through the Possible Crops (based on how they got registered in IC2) and pick the first one that has a higher points then the random generated number.
    (if it is lower it decreases the random number by the points the crop had).
    How can you calculate that? Because every time he tries it you gain another result...

  • Then you are wrong... Because the Percentage chance changes every time he tries to breed!
    Why? Simply he collect all possible points together (which would make the 100%) and then pick a random number between 0 and that max number.
    Then he loops through the Possible Crops (based on how they got registered in IC2) and pick the first one that has a higher points then the random generated number.
    (if it is lower it decreases the random number by the points the crop had).
    How can you calculate that? Because every time he tries it you gain another result...


    That's how a weighted random selection works. It only picks the random number once (outside the loop through the possible crops), and for a given pair of parent crops, the weights of the results are always the same, right? The random number generator has a flat distribution (unless you use nextGaussian or something), so you can determine probabilities.

  • the weights of the results are always the same, right?


    Yeah. Thats true. Else it would be impossible to even generate a point system...


    It only picks the random number once


    Partly True. It picks the Number once for every breeding try. Also it get Modified for every crop that is to low on points.


    The random number generator has a flat distribution (unless you use nextGaussian or something), so you can determine probabilities.


    I do not think so. At least i can not imagine how you can calculate a which crop generates which number... because it is always changing... Else you would gain not a random one...


  • I do not think so. At least i can not imagine how you can calculate a which crop generates which number... because it is always changing... Else you would gain not a random one...


    I beg to differ:


    public int nextInt(int bound)


    Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence. The general contract of nextInt is that one int value in the specified range is pseudorandomly generated and returned. All bound possible int values are produced with (approximately) equal probability.


    As a simplified example, if you have only 3 possible results for a certain crossbreeding combination: crop A with 20 points (by your system), crop B with 10 points, and crop C with 5 points, you can know that there's a 57% chance of getting crop A, a 29% chance of getting crop B, and 14% chance of getting crop C.


    Partly True. It picks the Number once for every breeding try. Also it get Modified for every crop that is to low on points.


    That's different from calling the random function again. Each possible result from the initial call to the random number generator can be mapped to a specific crop.

  • As a simplified example, if you have only 3 possible results for a certain crossbreeding combination: crop A with 20 points (by your system), crop B with 10 points, and crop C with 5 points, you can know that there's a 57% chance of getting crop A, a 29% chance of getting crop B, and 14% chance of getting crop C.


    Good start for explaining. So you gain almost the same results out of the nextInt function in random (range of numbers is now totally not nessesary to tell)...
    But your explaining is wrong.


    (I am using your Explaining and Modify it, no Chance because it is not possible) Ok lets start:


    We are using 2 Crops To breed something (and say we gain only 3 Possible Results):
    The Breeding Crops are: Pumpkin, and Wheat.
    The Results are: Hops, Cocoa and Reed.
    (Important)
    They are registered in this Order: Hops, Pumpkin, Cocoa, Wheat, Reed.


    So lets calculate:
    Lets say Hops has 35 points, Cocoa has 10 points, reed has 20 points, Wheat and Pumpkin have 500 (static Rule!)


    So we have a total of 1065 points (max). According to your calculation i tell you the Fake Chances:
    Hops with 3,2%
    Cocoa with 0,94%
    Reed with 1,9% (or 2%)
    and Wheat and Pumpkin each with 47% Chance.


    Well i used a random generator (random.org) to gain a random number and got 544 out: Now we are at a point where you can not calculate something.
    So we have the 544 base and run through the crop list.
    is 544 smaller then 35 points of the hops? Nope
    So now we remove the 35 points from the 544.
    New value is 509
    now we check on pumpkin.
    Is 509 then the 500 points of pumpkin? no.
    Now we remove the 500 points of the pumpkin.
    let are 9 points.
    Next is cocoa.
    Is 9 points smaller then the 10 points of the Cocoa? yes
    so we pick this crop.
    Cocoa is the result.


    Do you think it is still calculateable?


    That's different from calling the random function again. Each possible result from the initial call to the random number generator can be mapped to a specific crop.


    Jup thats true but that makes it so impossible to make a percent chance out of it...


    Little Note: I referece now only classic and Exp (675 or lower)
    Edit: After Exp 678 it is no longer possible to breed crops corretly together (Plugin works after that version no longer correctly waiting for IC2 to fix it, i gave that to the IC2 Team...)


  • Emphatically Yes!


    Going by your description above, when the random number generator gives 0-34, the result will be Hops.
    For 35-534, the result will be Pumpkin.
    For 535-544, the result will be Cocoa.
    For 545-1044, the result will be Wheat.
    For 1045-1064, the result will be Reed.


    And since each possible int from the random number generate has equal probability (or at least close enough for most purposes, and assuming you don't have prior knowledge of the exact state of the random number generator), you can divide the weights by the total weight to get a percent chance.



    Jup thats true but that makes it so impossible to make a percent chance out of it...


    How exactly does that make it impossible? I say that's what makes it possible.


    Edit: After Exp 678 it is no longer possible to breed crops corretly together (Plugin works after that version no longer correctly waiting for IC2 to fix it, i gave that to the IC2 Team...)


    The crop breeding itself works as of about build 688, though for all I know the changes in build 679 might have broken Immibis's plugin.


  • Yeah i do not have the knowlege about that. But can you calculate that really fast? I mean it takes for a 4x crop breeding (4 crops in a breed) about 16-32 seconds to calculate all possebilies(with a Extra Thread) and that is still very much time... And i do not want to increase it moew because the loading of it starts almost when MC has finished loading..


    The crop breeding itself works as of about build 688, though for all I know the changes in build 679 might have broken Immibis's plugin.


    I meant not corretly. To explain: The Current Crop Breeding Skips about 75% (+-20%) of the Crops while Breeding. The First Crops (Wheat, pumpkin, melon, the colorflowers, reed and Sticky Reed) are not even breedable because of that bug... My Nei Plugin says something differend here because i hardcoded the Exp Breeding Code into it... and that part that is causing that is after the Point Calculation...

  • Yeah i do not have the knowlege about that. But can you calculate that really fast? I mean it takes for a 4x crop breeding (4 crops in a breed) about 16-32 seconds to calculate all possebilies(with a Extra Thread) and that is still very much time... And i do not want to increase it moew because the loading of it starts almost when MC has finished loading..


    Sorry, this might be where the confusion came from: I was talking about simple 2-crop crossing, which I presume is all that Immibis's mod covered. I'll grant you that 4-way crop breeding is too complicated for calculating percentages to be practical (especially since iirc, there are even probabilities involved in determining which parent crops to include in the weight calculations, while with 2-way breeding it's either both included or wait for another attempt).


    I meant not corretly. To explain: The Current Crop Breeding Skips about 75% (+-20%) of the Crops while Breeding. The First Crops (Wheat, pumpkin, melon, the colorflowers, reed and Sticky Reed) are not even breedable because of that bug... My Nei Plugin says something differend here because i hardcoded the Exp Breeding Code into it... and that part that is causing that is after the Point Calculation...


    I have personal experience that contradicts that: I've successfully bred stickreed (both as a result and as parent crops) and several of the others you listed (though mostly as results) in more recent builds. I'll admit I've been using GT5u, but I don't think it changes the underlying functionality of crop breeding.

  • Sorry, this might be where the confusion came from: I was talking about simple 2-crop crossing, which I presume is all that Immibis's mod covered. I'll grant you that 4-way crop breeding is too complicated for calculating percentages to be practical (especially since iirc, there are even probabilities involved in determining which parent crops to include in the weight calculations, while with 2-way breeding it's either both included or wait for another attempt).


    Well the 4x Breeding is not more Complex because it is the same way as with 2 but with 2 extra Iterations... The Points calculation is simply a Comparing system thats it... And i added to the config a option where you can choose how many crops beeing used in the Nei Plugin. And in the Calculator picture you see that you have 4 Slots in the middle so people can also decide that how many they use..


    I have personal experience that contradicts that: I've successfully bred stickreed (both as a result and as parent crops) and several of the others you listed (though mostly as results) in more recent builds. I'll admit I've been using GT5u, but I don't think it changes the underlying functionality of crop breeding.


    Well since it is sortet first by ModName and then Crop name it does effect it really because a G comes before a I so the list which you are using is completly differend then i told. Try it out with Vanilla IC2 Exp...

    • Official Post

    Getting wheat from cross breading 2 wheat plants is almost impossible with IC2 right now. The lower tier crop values are all concentrated so getting the one you want (or even expect) is very hard.

    145 Mods isn't too many. 9 types of copper and 8 types of tin aren't too many. 3 types of coffee though?

    I know that you believe that you understood what you think I said, but I am not sure you realise that what you read was not what I meant.


    ---- Minecraft Crash Report ----
    // I just don't know what went wrong :(


    I see this too much.

  • Getting wheat from cross breading 2 wheat plants is almost impossible with IC2 right now. The lower tier crop values are all concentrated so getting the one you want (or even expect) is very hard.


    Well not almost it is impossible. IC2 Has 24 crops. the first 12 he is skipping. If the 13th is not the one you are searching for then he skips a couple others...


    Also addition. As long this bug exists i block every version of IC2 Exp that will be higher then 677. (Until it get fixed)