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

  • 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...


    I briefly tried using IC2 exp build 746 with no other mods (though for the sake of my eyes, I did use a couple of resource packs), and starting with the "sugar cane" item, I put them in a checkerboard pattern (except for the center, which had water). Once they grew, I set up crossbreeding. I mostly got reed, but on the first try, I got 1 pumpkin crop and 1 stickreed crop. I crossed the stickreed with reed, and got something that started like wheat. It might have been Hops instead, but I wasn't interested enough in proving you wrong on this point to continue. If you can provide more specific steps to reproduce in-game, I'm willing to try further, though.


    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)


    I think you're misinterpreting the decompiled code. It looks to me more like a binary search for the crop with a result range that includes the number returned from the random number generator. So technically yes, it initially skips the first half of the crop list, but then depending on the ratios and the random number it got, it can go forward or back for the next crop to check.


  • Do you not see the mistake?

  • I see no mistake there, except possibly in your understanding of what the code is doing. The previous loop (which you didn't include) made sure that the values in pointArray are non-decreasing as the array index increases. On each iteration, depending on the value previously obtained for "randomNumber" and the value in the middle of the currently-searched array section, either the first half or the second half of the array section currently being searched is excluded from further search. What are you seeing as a mistake?

  • I did not include everything before or after that, because that code is ok,


    Min and Max have to be the same number and based on that number he picks the new crop.
    from the array.


    So my problem is that this system skips a lot of possebilities right in the begining
    because 0 + 24 / 2 = 12. If that crop ID is not that he is searching for he put the min on to 13,
    then he starts over again 13 + 24 = 37 / 18,5 (rounded up because int 19)
    if 19 is not the crop he is searching for then he put min to 20,
    start over again 20 + 24 / 2 = 22


    And and and. It is not the pointgeneration that is broken it is where he search for a crop to pick that is broken...

  • That's wrong on at least two points:
    1. Since the array is size 24 when not using other mods that add crops, it starts with (0+23)/2, which equals 11 (integer division truncates, it doesn't round, at least for positive integers - behavior of dividing negative integers can vary between programming languages). This one's a minor nitpick, though.
    2. you seem to be missing the point of the if statement - sometimes it increases the min (technically to 12 for the first iteration) and searches higher next (index 17), but other times it decreases max instead and searches lower next (index 5 for the second iteration in that case).

  • That's wrong on at least two points:
    1. Since the array is size 24 when not using other mods that add crops, it starts with (0+23)/2, which equals 11 (integer division truncates, it doesn't round, at least for positive integers - behavior of dividing negative integers can vary between programming languages). This one's a minor nitpick, though.
    2. you seem to be missing the point of the if statement - sometimes it increases the min (technically to 12 for the first iteration) and searches higher next (index 17), but other times it decreases max instead and searches lower next (index 5 for the second iteration in that case).


    Ok some part i did misscalculate (the 0-23 part) thanks for correting me.
    But i am aware of it that he decreases the Number of the max, and yeah he can decrease the total number with that, but only to a certan point... and so some results are not possible or are very rare to get... (even if it should be a high chance),
    why not instead adding a few extra points to the total number and let a Random pick the a number and then which one is the closest to it... That would be way easier and also handle all crops... (that have points)


    Edit: I saw before that you can decrease the Max number but did not realize his effect...

  • why not instead adding a few extra points to the total number and let a Random pick the a number and then which one is the closest to it... That would be way easier and also handle all crops... (that have points)


    I don't really understand what you're suggesting, but the current code is an application of the standard binary search algorithm, so I'm fairly sure it already handles all crops, and will generally have better performance than the sequential search that was used in builds 677 and earlier.

  • I don't really understand what you're suggesting, but the current code is an application of the standard binary search algorithm, so I'm fairly sure it already handles all crops, and will generally have better performance than the sequential search that was used in builds 677 and earlier.


    Well i think both ways taking the same average time... But personally i like the old one more (only the picking part), but the world is sadly not a Wishing spot... xD

  • Just so you know. IC2 Classic will be released this weekend.
    With that also this crop plugin.. Ill update the Exp calculator before the release to the latest Exp version (if something did change)
    ^^" It is close xD

  • Quote from xkcd.com

    BTC 1FhCLQK2ZXtCUQDtG98p6fVH7S6mxAsEey
    We did not invent the algorithm. The algorithm consistently finds Jesus. The algorithm killed Jeeves.
    The algorithm is banned in China. The algorithm is from Jersey. The algorithm constantly finds Jesus.
    This is not the algorithm. This is close.


    Sorry, couldn't stop myself.


    Anyways, thanks for the hard work, I appreciate it. If i manage to find some time, which is rather scarce as of now for me, I'll check this out for sure!

    Iff yu find misstaks, you may keep them! (Or tell me if neccessary...)

  • Sorry, couldn't stop myself.


    Anyways, thanks for the hard work, I appreciate it. If i manage to find some time, which is rather scarce as of now for me, I'll check this out for sure!


    But that is only 1.7.10 and not 1.6.4...
    ^^" Got merged by IC2 Classic...

  • I'm using MultiMC most of the time, so I don't have any problem with setting up a new pack for testing and stuff :D

    Iff yu find misstaks, you may keep them! (Or tell me if neccessary...)

  • Are there Gregtech crops shown too in your Mod ?
    If not i would suggest it ;)


    Special Textures&Special Icons nope... I have an API which he can use..
    I told him already about that... (Before i made this post here i think even)


    But Chance calculation is default supporting every mod that is using the IC2 Crop API.

  • Update:


    Changelog:


    A simple Pre classic Update.
    There will be a quick update after Classic gets released. I just added Prepairing&Compatiblity with the API with this update


    -Updated: IC2 Classic API. Some adjustments to the new Classic Update (Pre update)
    -Added: Tea compatiblity.

    • Official Post

    It could be Minecraft Buggy Block System, but I doubt it's that ;)

    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.