This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
McLeopold's profile picture

Bee Breeding With Attributes (Credit To Direwolf20 For Idea)

Started by McLeopold, 19 July 2013 - 06:45 PM
McLeopold #1
Posted 19 July 2013 - 08:45 PM
NEW VERSION! \o/

Head over to Bee Breeding with OpenPeripherals to check it out!

Installation

Download the installer first with:

pastebin get 2jKRTN8y bee-install
Then run the installer with:

bee-install


github: https://github.com/Forte40/bee

Bee Breeding with Attributes



Use Direwolf20's setup (http://www.youtube.com/watch?v=cqDehqzUwOI) of an Turtle facing an apiary, with a Bee Analyzer (MiscPeripherals) on the left, and an Analyzer behind and a chest below. This code will take a princess and 1 or more drones and breed them up the line to the best species. You'll need liquid honey piped to the analyzer and chocolate (or oblivion) frames speed up the process a lot.

The expensive parts are 2 diamonds for the beealyzers (4 diamonds and an eye of ender for the interactive sorter no longer needed as of MC1.5.2!).

The turtle will continue to breed until it has produced purebred bees.

The additions are that it will choose bees with the best attributes as well, so you can inject a rocky drone into the system for the tolerances and you will end up with those good attributes in the next generations.

The program can also be told to stick to a list of species, so that you can control which mutations you want.

http://pastebin.com/2jKRTN8y (FTB Unleashed / MC 1.5.2)

I've been able to place in a forest princess with a meadows drone, walk away and come back to a purebred Imperial. I've also been able to place Industrious and Imperial princesses without any tolerances into the system with rocky drones, walk away, and come back to purebreds with perfect features.

Sample Run

In the second table, you can see the turtle choose a common over a cultivated because it provides a chance to breed to a diligent or nobel, otherwise you might get stuck with purebred cultivated bees.

Spoiler

Clearing system...
Ditching excess product...
scanning bees..
analyzing bees...
waiting for bees...***
Ditching excess product...
scanning bees.....
analyzing bees...

typ species f spd d n f c tmp hmd score
-|-|-------|-|---|-|-|-|-|---|---|-----
1 P For:For 2 0.6				
2 d Cul:Com 2 1.2					 4
3 d For:Com 2 0.6					 4
4 d For:Mea 2 0.3					 2
5 d For:Mea 2 0.3					 2
waiting for bees.....***
Ditching excess product...
scanning bees......
analyzing bees...

typ species f spd d n f c tmp hmd score
-|-|-------|-|---|-|-|-|-|---|---|-----
1 P Cul:For 2 0.6				
2 d For:Com 2 0.6					 8
3 d Cul:For 2 0.6					 4
4 d For:Mea 2 0.3					 4
5 d For:Mea 2 0.3					 4
6 d For:Cul 2 0.6					 4
waiting for bees.....***
Ditching excess product...
scanning bees.......
analyzing bees...

typ species f spd d n f c tmp hmd score
-|-|-------|-|---|-|-|-|-|---|---|-----
1 P Com:For 2 0.6				
2 d Com:Dil 2 0.6					16
3 d Cul:For 2 0.6					 8
4 d For:Cul 2 0.6					 8
5 d For:Mea 2 0.3					 4
6 d For:Mea 2 0.3					 4
7 d For:For 2 0.6					 4
waiting for bees....................................................***
Ditching excess product...
scanning bees........
analyzing bees...

typ species f spd d n f c tmp hmd score
-|-|-------|-|---|-|-|-|-|---|---|-----
1 P Gro:Dil 2 0.3				
2 d Gro:Com 3 0.6					16
3 d Cul:For 2 0.6					16
4 d For:Cul 2 0.6					16
5 d For:For 2 0.6					16
6 d Com:Dil 2 0.6					16
7 d For:Mea 2 0.3					16
8 d For:Mea 2 0.3					16
waiting for bees.............***
Ditching excess product...
scanning bees.........
analyzing bees...

This version uses the older scoring system and will not be updated or maintained:
http://pastebin.com/dEdTNP64 (FTB Ultimate / MC 1.4.7)

UPDATE 4.3:

Improved the scoring system a bit. The link is now an installer that you need to run to get the bee program from github. You can use it to get updates.

UPDATE 4.2:

This is a complete rewrite for the better. I've changed simple scoring of species names to a graph of what combinations produce which bees. Magic Bees is included with the newer changes to Forestry and Extra Bees as well. The turtle can now make smarter decisions about which bees to choose. It will now keep 6 extra drones in it's inventory to make sure good drones stay in the system. It will choose the best combination of princess and drone by score possible outcomes. (This means not getting stuck and purebred cultivated by losing the common trait needed to advance.)

UPDATE 4.1:

SpoilerThe code was broken in the new FTB packs. The call to suckSneaky wasn't pulling bees out of the analyzer. That's the bad news. The good news is the fix is here and you no longer need the inventory module to get the system working. That makes the whole setup 4 diamonds cheaper!

Also, I'm going to work on getting the magic bees in the system a bit later, along with the bee species progression (mundane->common->cultivated->noble->etc), so stay tuned for updates. You can always edit the code in the meantime.
Edited on 25 March 2014 - 07:19 AM
McLeopold #2
Posted 25 July 2013 - 08:11 PM
Here is a sample run of starting with a meadows and forest bee and breeding up to cultivated. It's able to pick the faster producers and keep the flying attribute in the mix. This is the output displayed by the turtle:

Spoiler

waiting for bees.
analyzing 2 bees...

typ species f spd n f c tmp hmd score
-|-|-------|-|---|-|-|-|---|---|-----
1 d Mea:Mea 2 0.3                   1 *
2 P For:For 3 0.3   f               0 
breeding princess (2) with drone (1)

waiting for bees........................
waiting for bees.........
analyzing 4 bees...

typ species f spd n f c tmp hmd score
-|-|-------|-|---|-|-|-|---|---|-----
1 d For:Mea 2 0.3                   1 *
2 d Mea:For 2 0.3   f               1 *
3 d Com:For 2 0.6                   1 *
4 P Mea:For 2 0.3                   0 
breeding princess (4) with drone (3)

waiting for bees............
analyzing 3 bees...

typ species f spd n f c tmp hmd score
-|-|-------|-|---|-|-|-|---|---|-----
1 d Mea:For 3 0.3   f               1 *
2 d Mea:Cul 2 1.2                   2 *
3 P Mea:Com 2 0.6                   0 
breeding princess (3) with drone (2)

waiting for bees............
analyzing 3 bees...

typ species f spd n f c tmp hmd score
-|-|-------|-|---|-|-|-|---|---|-----
1 d Mea:Cul 2 0.3                   2 *
2 d Cul:Cul 2 1.2                   3 *
3 P Mea:Cul 2 0.6                   0 
breeding princess (3) with drone (2)

waiting for bees.............................
analyzing 3 bees...

typ species f spd n f c tmp hmd score
-|-|-------|-|---|-|-|-|---|---|-----
1 d Cul:Cul 2 1.2                   3 *
2 d Mea:Cul 2 0.6                   2 
3 P Cul:Cul 2 1.2   f               0 
breeding princess (3) with drone (1)

waiting for bees.........
waiting for bees...
analyzing 3 bees...

typ species f spd n f c tmp hmd score
-|-|-------|-|---|-|-|-|---|---|-----
1 d Cul:Cul 2 1.2                   3 *
2 d Cul:Cul 2 1.2   f               3 *
3 P Cul:Cul 2 1.2                   0 
breeding princess (3) with drone (2)

waiting for bees....
waiting for bees........
analyzing 3 bees...

typ species f spd n f c tmp hmd score
-|-|-------|-|---|-|-|-|---|---|-----
1 d Cul:Cul 2 1.2   f               3 *
2 d Cul:Cul 2 0.6   f               3 
3 P Cul:Cul 2 1.2   f               0 
breeding princess (3) with drone (1)

waiting for bees.........................
xInDiGo #3
Posted 28 July 2013 - 07:03 PM
could you explain this a little more? or maybe a link to the setup you're talking about. direwolf20 seems to have lots of content
NuBSMcGee #4
Posted 29 July 2013 - 03:14 AM
Found the video where Direwolf20 sets it up.

https://www.youtube.com/watch?v=cqDehqzUwOI

@ 20:00
MrBlackCreep #5
Posted 29 July 2013 - 05:48 AM
Hey,
I currently have the problem that after the bees die off and were analyzed they dont get sucked back into the turtle. The turtle just sits there with an empty table.

EDIT: Apperently suckSneaky is the problem. I tried to pull bees out of the analyzer in lua with all possible sides. Everytime it returns false.
dzdz #6
Posted 30 July 2013 - 05:28 AM
i even get an attempt to call nill in line 638
xInDiGo #7
Posted 30 July 2013 - 02:06 PM
i was able to get this working using a wireless inventory turtle, and the setup direwolf used in the link above.
McLeopold #8
Posted 30 July 2013 - 05:20 PM
Hey,
I currently have the problem that after the bees die off and were analyzed they dont get sucked back into the turtle. The turtle just sits there with an empty table.

EDIT: Apperently suckSneaky is the problem. I tried to pull bees out of the analyzer in lua with all possible sides. Everytime it returns false.

The turtle needs to have the inventory module from misc peripherals added to it. That way it can pull from the analyzer as if it was pulling from the bottom. If you don't add the module, then the turtle would need to move below the analyzer and you'd have to provide it fuel to run constantly.
McLeopold #9
Posted 30 July 2013 - 05:22 PM
i even get an attempt to call nill in line 638

This is also a lack of the inventory module being added.
Horriblefate #10
Posted 31 July 2013 - 12:13 PM
When using this program for some reason it stops randomly with purebred bees

example of my most recent attempt

B2 (name of the program) industrious

if then says that it's "Targeting Industrious Species" but it eventually spat out two meadows bees saying they're purebred and then stopped working


am i using this incorrectly?
McLeopold #11
Posted 01 August 2013 - 12:51 AM
When using this program for some reason it stops randomly with purebred bees

example of my most recent attempt

B2 (name of the program) industrious

if then says that it's "Targeting Industrious Species" but it eventually spat out two meadows bees saying they're purebred and then stopped working


am i using this incorrectly?

Yes, you are using it wrong, assuming you didn't start with an industrious or the combination to produce them (Unweary princess, Diligent drone)

If you have purebred bees, you have a drone and princess with the same attributes. No amount of breeding will produce a new species, so the program will stop to prevent wasting all that liquid honey.

If you target a species, such as industrious, it will score only industrious bees and every other bee type will be scored as a zero. (Attribute tie-breaks will still be active.) It doesn't score the bees previous in the line. (Maybe this is a feature I could add?) So you can't just throw in a forest and meadows and target industrious. Targeting is more for making sure you keep a species and don't loose it. For instance if you wanted to breed perfect cultivated bees by tossing in a good rocky or common, but wanted to drop out any noble or diligent drones that got created.

To get industrious, put in a forest and meadows and just let it run its course without targeting.
xInDiGo #12
Posted 01 August 2013 - 05:50 PM
any chance we can get this updated for FTB unleashed? There are tons of new bees with the new modpack.
Horriblefate #13
Posted 01 August 2013 - 09:27 PM
When using this program for some reason it stops randomly with purebred bees

example of my most recent attempt

B2 (name of the program) industrious

if then says that it's "Targeting Industrious Species" but it eventually spat out two meadows bees saying they're purebred and then stopped working


am i using this incorrectly?

Yes, you are using it wrong, assuming you didn't start with an industrious or the combination to produce them (Unweary princess, Diligent drone)

If you have purebred bees, you have a drone and princess with the same attributes. No amount of breeding will produce a new species, so the program will stop to prevent wasting all that liquid honey.

If you target a species, such as industrious, it will score only industrious bees and every other bee type will be scored as a zero. (Attribute tie-breaks will still be active.) It doesn't score the bees previous in the line. (Maybe this is a feature I could add?) So you can't just throw in a forest and meadows and target industrious. Targeting is more for making sure you keep a species and don't loose it. For instance if you wanted to breed perfect cultivated bees by tossing in a good rocky or common, but wanted to drop out any noble or diligent drones that got created.

To get industrious, put in a forest and meadows and just let it run its course without targeting.

That'd be really cool to have.. a turtle that auto makes/breeds stuff up to a designated species, i'd totally use it
xInDiGo #14
Posted 02 August 2013 - 07:00 PM
i can't seem to get this working with FTB Unleashed. dog gamnit!

tried it with plain forest and meadows and after it puts the bees in the analyzer it just hangs there.
Kamefrede #15
Posted 03 August 2013 - 09:00 AM
Hm might try it in the near future seems like a good program, just for curiosity ppl seem to cant get it working so does it works on 1.5 packs or only in 1.4.7 packs?
lifewcody #16
Posted 03 August 2013 - 11:36 AM
I LOVE IT GREAT IDEA!!!!
McLeopold #17
Posted 03 August 2013 - 11:29 PM
Hm might try it in the near future seems like a good program, just for curiosity ppl seem to cant get it working so does it works on 1.5 packs or only in 1.4.7 packs?

Yes, it was broken in the new packs. There is an updated link in the original post. http://pastebin.com/2jKRTN8y
xInDiGo #18
Posted 05 August 2013 - 03:30 PM
i'm super excited to for this program! :)/> when do you think you might get the magic bees added in?

also, i think this program might take off a bit more if you repost it in the turtle programs sub section!
McLeopold #19
Posted 07 August 2013 - 11:21 PM
i'm super excited to for this program! :)/> when do you think you might get the magic bees added in?

also, i think this program might take off a bit more if you repost it in the turtle programs sub section!

Magic Bees is in. Also, a new super awesome scoring system to prevent stagnating at a level and the ability to keep extra drones in the system for more breeding combos. Targeting has changed as well, it will work like you think it should. If you target Industrious, it will include all the bees the lead up the that species.
Horriblefate #20
Posted 08 August 2013 - 12:04 PM
This is exciting! i can't wait to play with it some more!
tuxtux #21
Posted 09 August 2013 - 07:20 PM
This script looks absolutely great. I've tested it today on a FTB unleashed and had some problems with the bee analyzer.

analyzer.analyze() returns the table with some informations about the bee. A lot of stuff like "flyer", "range", "fertility" and much more is in there, but the species name is actually missing. Everything else is there. Because of this missing information sour script dies all the time.

Any idea what could be the problem?
enLighteN #22
Posted 10 August 2013 - 06:57 AM
Hello

Im a big fan of this, so thanks for sharing. Would you be able to explain were we now enter the specific bee we are after in the coding. In the previous version, it was at the top of the code just under the programm info, however i cant seem to find anywere to enter it in the new program
McLeopold #23
Posted 10 August 2013 - 12:23 PM
Hello

Im a big fan of this, so thanks for sharing. Would you be able to explain were we now enter the specific bee we are after in the coding. In the previous version, it was at the top of the code just under the programm info, however i cant seem to find anywere to enter it in the new program

If you use the new installer , your program will be named "bee". Type in "bee Industrious Imperial" to target both of those species and all the species that come before. There is no need to modify the program. It will now list all the species that it is targeting if successful.
McLeopold #24
Posted 10 August 2013 - 12:27 PM
This script looks absolutely great. I've tested it today on a FTB unleashed and had some problems with the bee analyzer.

analyzer.analyze() returns the table with some informations about the bee. A lot of stuff like "flyer", "range", "fertility" and much more is in there, but the species name is actually missing. Everything else is there. Because of this missing information sour script dies all the time.

Any idea what could be the problem?

I haven't seen that before. Paste in you bee.log file. If that doesn't tell us I can add a debug feature.

Did the bee get analyzed properly. Is there enough liquid honey? Is it a species not in the table. Also post your version of MC, forestry, extra bees and magic bees.
tuxtux #25
Posted 11 August 2013 - 09:01 AM
This script looks absolutely great. I've tested it today on a FTB unleashed and had some problems with the bee analyzer.

analyzer.analyze() returns the table with some informations about the bee. A lot of stuff like "flyer", "range", "fertility" and much more is in there, but the species name is actually missing. Everything else is there. Because of this missing information sour script dies all the time.

Any idea what could be the problem?
I haven't seen that before. Paste in you bee.log file. If that doesn't tell us I can add a debug feature.

Did the bee get analyzed properly. Is there enough liquid honey? Is it a species not in the table. Also post your version of MC, forestry, extra bees and magic bees.

I'm quite sure that's a problem with the itself Analyzer, not within your script.

Ok, first the stuff you've asked for. Here you see how it behaves with a Common princess and a Diligent drone. Both are pure and analyzed, the Beealyzer shows all their properties.

There is no need to check the paste bin log. It only shows the first few lines you see here.

So i went a bit deeper and took this bee:


Put it in the Analyzer and tried to write some lua myself:

As you can see it get's all the properties of the bee, except for the species. This is why I believe there is some kind of strange problem with the Analyzer itself. Does the Analyzer (the one with one single slot for a single bee) maybe need any kind of power?

Thanks…

Btw. This is on FTB Unleashed v1.1.2 with gregtech and extrabiomesXL.
McLeopold #26
Posted 11 August 2013 - 12:03 PM
Yeah, that is either a cc issue with the analyzer or a cc to forestry incompatibility. The effect being "forestry.NONE" is suspicious too.

Line 449 is where the program fixes incorrect species names and it got a nil instead os a string because there was no table entry.

Maybe it is due to how gregtech was added? There are gregtech bees and that code path may not be well tested? Try backing up your world and disabling it to see if it works.
HoneycakePlay #27
Posted 12 August 2013 - 05:09 AM
I occoured to a error after running the program on line 630

http://filesupload.f...12_11.04.39.png

~ Edit: got it myself i had 2 princess in the turtle
McLeopold #28
Posted 12 August 2013 - 12:31 PM
I occoured to a error after running the program on line 630

http://filesupload.f...12_11.04.39.png

~ Edit: got it myself i had 2 princess in the turtle

I added an extra check to make sure the program doesn't stop if this occurs. I might add multiple princess support later. For now, it will just skip the second princess when sorting. It might ping-pong back and forth between the 2 princesses depending on the order bees are pulled out of the apiary.
tuxtux #29
Posted 12 August 2013 - 04:28 PM
Yeah, that is either a cc issue with the analyzer or a cc to forestry incompatibility. The effect being "forestry.NONE" is suspicious too.

Line 449 is where the program fixes incorrect species names and it got a nil instead os a string because there was no table entry.

Maybe it is due to how gregtech was added? There are gregtech bees and that code path may not be well tested? Try backing up your world and disabling it to see if it works.

Hmm… too bad. Playing on a server, so can't disable it. Thanks, I'll hope it's fixed with the next update ;-)
Moosolini #30
Posted 14 August 2013 - 05:16 PM
Great program. I've gotten it to work in single-player and it works amazingly.
dn_nb #31
Posted 14 August 2013 - 06:09 PM
Yeah, that is either a cc issue with the analyzer or a cc to forestry incompatibility. The effect being "forestry.NONE" is suspicious too.

Line 449 is where the program fixes incorrect species names and it got a nil instead os a string because there was no table entry.

Maybe it is due to how gregtech was added? There are gregtech bees and that code path may not be well tested? Try backing up your world and disabling it to see if it works.

Hmm… too bad. Playing on a server, so can't disable it. Thanks, I'll hope it's fixed with the next update ;-)

I'm also having this issue, playing on Unleashed with GT installed. It works fine in single player, but not on the server I play on. The Bee Analyzer does not seem to return the species at all, or only one half of the genome, 90% of the time and I can't figure out why.

A couple people on my server suggested it might have something to do with MCPC. Not sure.
Mitchfizz05 #32
Posted 17 August 2013 - 05:34 AM
I don't really understand bees, never have.
I'm good at just about everything else in FTB, Applied enegistics, power armour, MFFS, computercraft, RedPower2, IC2, ThermalExpansion and everything else (except the new Mystcraft), yet I still don't understand bees or tree breeding!
McLeopold #33
Posted 17 August 2013 - 05:24 PM
I don't really understand bees, never have.
I'm good at just about everything else in FTB, Applied enegistics, power armour, MFFS, computercraft, RedPower2, IC2, ThermalExpansion and everything else (except the new Mystcraft), yet I still don't understand bees or tree breeding!

"Don't understand" as in not good at breeding nor know how to do it well, or as in don't know why someone would bother because it seems useless?

I breed bees to make platinum to spin into iridium ( in ultimate ) and in unleashed I will do it to produce thaumcraft shards with magic bees. I am also going to breed them for their effects such as edenic ( free xp ) and others.

As for how to breed and doing it well, you now have my program to take care of the mundane work. :)/>
dronf #34
Posted 19 August 2013 - 09:03 PM
McLeopold:

This program looks great, and I'm really hoping it works out for me. I'm running the newest version of the unleashed pack (1.1.3, on MC 1.5.2), with biomes o plenty enabled. This is also in SMP. I have it all setup like in the pic in the first post. I install, then run bee with a forest princess and a meadows drone in the turtle. I get the following output:

Clearing system…
ditching product…
scanning bees…
analyzing bees…
Bee 1 not correctly analyzed
Bee 2 not correctly analyzed

Waiting for bees…….


At this point it hangs forever. The bees were properly scanned, and I can see their attributes now when I shift click. I believe the turtle found and used the bee analyzer, since it turns that direction and spits them out, then back in.

Any idea on how I can get this running?

EDIT: I've confirmed this works in single player on the same client. I believe this is also an MCPC+ server, someone above mentioned this might be a problem.

I checked with the server owner and he is using mcpc+ build 635. I tried this on my own server with both MCPC+ 635 and the newest one, 638, and it worked on both. Is there a debug mode where I can see what the problem is? Or is there a local log written somewhere?

I ran the lua from a post above that outputs the analyzer data, and got similar output to tuxtux, but using a forest bee. FYI gregtech is NOT installed on this server.




Thanks!
nottah #35
Posted 21 August 2013 - 02:36 PM
Same error as dronf. We are running the ftb unleashed 1.1.3 on our server.

I tried ssp and it worked beautifully, dont know why we are getting the not correctly analyzed message. Hope to see a fix soon :)/> keep up the awesome work.
McLeopold #36
Posted 21 August 2013 - 08:39 PM
Same error as dronf. We are running the ftb unleashed 1.1.3 on our server.

I tried ssp and it worked beautifully, dont know why we are getting the not correctly analyzed message. Hope to see a fix soon :)/> keep up the awesome work.

Is it an MCPC+ server? That seems to be the common thread. If so try and ask for the bukkit mods that are installed to help us track down the incompatibility.

Unfortunately I can't do anything about the missing data. My code calls .analyze() and expects a proper table back with the correct values. I'm not sure if this is a MiscPeripherals bug or if the MCPC+ installation is corrupting it somehow.

I could allow the program to ignore the species data and just breed bees with good attributes. It would be up you to monitor any mutations that occur.
nottah #37
Posted 21 August 2013 - 11:57 PM
Thanks for the reply! Yes we are an mcpc plus server, we recently installed tick threading (awesome server mod) so not to sure if that is what is causing the problem. I'll see about the plugin list.

Allowing to program to ignore the species as an option would be very helpful. But dont do any major rewrites on our behalf. The program does do what it says in the right enviroment. :)/> Ill bee looking for your next update!

Nottah
dronf #38
Posted 22 August 2013 - 12:15 PM
FYI this started working for me last night, after the server admin took the server down for some work. I wasn't online at the same time as him, but I'm strongly guessing he updated some plugins. I'll see if I can get the list from him. Pretty sure this is a plugin related issue, as I was unable to recreate on my own with several versions of mcpc+ with no plugins.


by the way…..the program is great! :D/>
McLeopold #39
Posted 22 August 2013 - 08:31 PM
by the way…..the program is great! :D/>/>

Thanks!

The next feature will be multiple princess support. I'm waiting for the chest turtle to be functional so I can swap the bee inventory.
dybukk #40
Posted 26 August 2013 - 09:47 PM
Greetings,

I started to play with bees for the first time today. Took me hours too just get up to Imperial and Industrious with pure blood. Wow painful.

Shockingly enough I started searching for ways to automate it. Thank god for this thread. Really nice work. I went straight to a test world, did the set up, whipped out some nova frames and typed the following:

bees Industrious

All was going well. It was getting the mutations and pushing down the correct line. Until all of a sudden it had a pure drone and princess for industrious (Yes!). However, instead of exiting or breeding them it started breeding the pure princess with dirty mixed blood mongrel Dilligent and then Unweary's. I thought it must be some extra attributes that its trying to pull in, but it went on indefinitely.

I tweaked the code to reverse the score table, to make sure I could see the scorings of the princess and the drone (damn those tiny turtle screens). I noticed that the unpure Unweary-Industrious and Diligent-Industrious drones got the same score as the pure drones so I started looking at the Scoring Function.

First of all I noticed this :


score = max(bees[combo[1]].score, bees[combo[2]].score)


It didn't take into account if one of the combo's might not a targeted drone. So I changed it to :


local s1

if bees[combo[1]].targeted then

s1 = bees[combo[1]].score

else

s1 = 0

end

local s2

if bees[combo[2]].targeted then

s2 = bees[combo[2]].score

else

s2 = 0

end

score = max(s1, s2)


(Damn lua and its lack of a turnery operator.)

This wasn't the problem though. It seems that the code scores everything the same that has the potential to make a particular type of bee. So all the following have the same score :

Industrious - Industrious
Unweary - Industrious
Dilligent - Industrious
Unweary - Dilligent


There was nothing really modifying the score based around the probability of getting that particular type of drone. Maybe there should be a percentage taken off to give the pure drone higher ranking? I'm not sure.

I slapped in the below after the previous bit of code mentioned :


– pure drone boost in score

if combo[1] == combo[2] then

score = score + 1

end


I reran from my test world and the rankings were adjusted and it started selecting the pure drones. I didn't re-run from the beginning to see how this would affect the full process. Thought I seek other peoples thoughts on a better solution.

Eventually I got the pure princess back and it started pairing with the pure drone. However it didn't exit as I suspected it should from looking at the code.

To get it to exit I had to change the following line :


if value ~= droneData[key] and key ~= "territory" and key ~= "type" then


to



if value ~= droneData[key] and key ~= "territory" and key ~= "type" and key ~= "slot" then

as the slot was always going to be different.

I'm guessing this program is usually run to target all bee's rather than just a particular one.

A pastebin of these changes are here: http://pastebin.com/WNBY7eHa

Thanks for all the hard work on this program and for sharing it :)/>

Dybukk
McLeopold #41
Posted 27 August 2013 - 12:08 PM
Thanks for finding the problem and reporting it.

First of all I noticed this :

score = max(bees[combo[1]].score, bees[combo[2]].score)


It didn't take into account if one of the combo's might not a targeted drone. So I changed it to :

No it doesn't at that point, but there is a guard on line 640 that checks if either the primary or secondary species is not targeted, it will exit and return a score of 0. So by the time it hits that line of code, you know both will be targeted.

This wasn't the problem though. It seems that the code scores everything the same that has the potential to make a particular type of bee. So all the following have the same score :

Industrious - Industrious
Unweary - Industrious
Dilligent - Industrious
Unweary - Dilligent

That is almost correct, but not quite. For a princess and a drone there are 4 combinations of primary and secondary that could happen. I score each of those combinations as if they had a 100% chance of succeeding in a mutation, which is simplified and not correct. So an Industrious:Industrious princess bred with an Industrious:Industrious drone will score each combination as Industrious and add them up. An Unweary:Unweary princess bred with a Diligent:Diligent drone will score 4 combinations (all being Unweary-Diligent) as Industrious and add them up the same. (I honestly don't know how the bee code is written, so this could be totally off. But it makes sense from a mendelian inheritance perspective.)

There was nothing really modifying the score based around the probability of getting that particular type of drone. Maybe there should be a percentage taken off to give the pure drone higher ranking? I'm not sure.

Your guess is right. I think what is really needed is to account for the fact that a mutation has a chance of succeeding and to take that percentage and multiply it by the difference in the base score and the potential score. This way the Industrious-Industrious (100% chance of Industrious) combo will score higher than the Unweary-Diligent (8% chance) combo.

Or more simply, I could deduct one for each actual species attribute that doesn't match the potential attribute. Then I don't need to add percent mutation data to the program. This is almost the fix you did, but you boosted a drone for matching instead of deducting from a drone that didn't match. I think deducting is better because it maps to the potential outcome better.

Eventually I got the pure princess back and it started pairing with the pure drone. However it didn't exit as I suspected it should from looking at the code.

At that point the program is trying to stabalize the attributes of the bees. This is used so that you can breed in flyer and nocternal and other attributes. I think I should add an option to the program to specify if you don't care about purifying attributes.

BTW

bees[combo[1]].targeted and bees[combo[1]].score or 0

That is almost a ternary operator. It can break down if the second value is nil.
dybukk #42
Posted 27 August 2013 - 12:36 PM
No it doesn't at that point, but there is a guard on line 640 that checks if either the primary or secondary species is not targeted, it will exit and return a score of 0. So by the time it hits that line of code, you know both will be targeted.

For some reason I read it as an "and". My bad. Although maybe it should get a score if it has at least one of the parts you are looking for.

Your guess is right. I think what is really needed is to account for the fact that a mutation has a chance of succeeding and to take that percentage and multiply it by the difference in the base score and the potential score. This way the Industrious-Industrious (100% chance of Industrious) combo will score higher than the Unweary-Diligent (8% chance) combo.

Or more simply, I could deduct one for each actual species attribute that doesn't match the potential attribute. Then I don't need to add percent mutation data to the program. This is almost the fix you did, but you boosted a drone for matching instead of deducting from a drone that didn't match. I think deducting is better because it maps to the potential outcome better.

I suspect you are right in that deducting would be better. I just wasn't quite sure what maths was best :)/>

At that point the program is trying to stabalize the attributes of the bees. This is used so that you can breed in flyer and nocternal and other attributes. I think I should add an option to the program to specify if you don't care about purifying attributes.

It was breeding "like for like" bees at this point. It was already stable. It was caring on as it needed "slot" to be the same in bosh hashes, which was always going to be 1 and 2.

BTW

bees[combo[1]].targeted and bees[combo[1]].score or 0

That is almost a ternary operator. It can break down if the second value is nil.

Ahhhh should have thought of that.

Thanks again :)/>

Dybukk
McLeopold #43
Posted 27 August 2013 - 02:33 PM
Although maybe it should get a score if it has at least one of the parts you are looking for.
-snip–
It was caring on as it needed "slot" to be the same in bosh hashes, which was always going to be 1 and 2.

I don't think it should still score if one of the species is not targeted. You don't want to "taint" the princess, the whole issue you had at the beginning. This is especially frustrating when trying to just breed in attributes from a species you don't care about.

As for the slot, oops. I see what your saying now. I forgot that I put the slot attribute in there. I only ended up using it to print the bee table.

Both issues are fixed and the bee-install program will update for you.
wavern #44
Posted 30 August 2013 - 02:17 PM
Although maybe it should get a score if it has at least one of the parts you are looking for.
-snip–
It was caring on as it needed "slot" to be the same in bosh hashes, which was always going to be 1 and 2.

I don't think it should still score if one of the species is not targeted. You don't want to "taint" the princess, the whole issue you had at the beginning. This is especially frustrating when trying to just breed in attributes from a species you don't care about.

As for the slot, oops. I see what your saying now. I forgot that I put the slot attribute in there. I only ended up using it to print the bee table.

Both issues are fixed and the bee-install program will update for you.

Since this last update it seems the turtle is way too happy to make pure-bred bees and stop on the way to the target.

"bee Imperial", for example, made pure bred Cultivated. The previous version, while never actually detecting pure bred bees, would at least progress to the target.
McLeopold #45
Posted 30 August 2013 - 04:17 PM
Since this last update it seems the turtle is way too happy to make pure-bred bees and stop on the way to the target.

"bee Imperial", for example, made pure bred Cultivated. The previous version, while never actually detecting pure bred bees, would at least progress to the target.

Can you post the bee.log of that run? If you've run the program again, it would have been replaced. If not, we can look at the data and see what decisions it made.
dybukk #46
Posted 31 August 2013 - 02:47 AM
Since this last update it seems the turtle is way too happy to make pure-bred bees and stop on the way to the target.

"bee Imperial", for example, made pure bred Cultivated. The previous version, while never actually detecting pure bred bees, would at least progress to the target.

Yeah I was worried about things like that :(/>

Maybe we should only do the deduction when dealing with species specified on the command line (So a pure breed the user wants).

Dybukk
wavern #47
Posted 31 August 2013 - 01:52 PM
Since this last update it seems the turtle is way too happy to make pure-bred bees and stop on the way to the target.

"bee Imperial", for example, made pure bred Cultivated. The previous version, while never actually detecting pure bred bees, would at least progress to the target.

Can you post the bee.log of that run? If you've run the program again, it would have been replaced. If not, we can look at the data and see what decisions it made.

Unfortunately I overwrote that run but I did try to get some Distilled bees yesterday and it ended up with Noble purebred.

http://pastebin.com/WkUyim5d
McLeopold #48
Posted 31 August 2013 - 03:19 PM
Since this last update it seems the turtle is way too happy to make pure-bred bees and stop on the way to the target.

"bee Imperial", for example, made pure bred Cultivated. The previous version, while never actually detecting pure bred bees, would at least progress to the target.

Can you post the bee.log of that run? If you've run the program again, it would have been replaced. If not, we can look at the data and see what decisions it made.

Unfortunately I overwrote that run but I did try to get some Distilled bees yesterday and it ended up with Noble purebred.

http://pastebin.com/WkUyim5d

The system only had nobles left in it so there where no chances for mutation. It's good that it stopped then, because you weren't targeting Nobles. You'll need to do a bit more hands on breeding to maintain it's inventory.

If you were going for distilled, then I think you started with the wrong princess and drones. Distilled is pretty high up and needs an oily and industrious, of which you had neither. It would be better to target bees at the top of a line, such as primeval, before trying to cross breed 2 lines that you don't have.

At this point, I don't think the scoring function is flawed, but I still would like to see if simply targeting Industrious or Imperial get's stuck.
wavern #49
Posted 02 September 2013 - 04:53 PM
Since this last update it seems the turtle is way too happy to make pure-bred bees and stop on the way to the target.

"bee Imperial", for example, made pure bred Cultivated. The previous version, while never actually detecting pure bred bees, would at least progress to the target.

Can you post the bee.log of that run? If you've run the program again, it would have been replaced. If not, we can look at the data and see what decisions it made.

Unfortunately I overwrote that run but I did try to get some Distilled bees yesterday and it ended up with Noble purebred.

http://pastebin.com/WkUyim5d

The system only had nobles left in it so there where no chances for mutation. It's good that it stopped then, because you weren't targeting Nobles. You'll need to do a bit more hands on breeding to maintain it's inventory.

If you were going for distilled, then I think you started with the wrong princess and drones. Distilled is pretty high up and needs an oily and industrious, of which you had neither. It would be better to target bees at the top of a line, such as primeval, before trying to cross breed 2 lines that you don't have.

At this point, I don't think the scoring function is flawed, but I still would like to see if simply targeting Industrious or Imperial get's stuck.

Fair enough, I didn't check it's stock very closely before sending it off on it's way. I tried another and I didn't run across the problem so it was likely just a mistake on my part.

BTW, it turns out tolerances can go up to 5 instead of just the 3 you have in your code. Might want to add _4 and _5 to up/down/both tolerances otherwise when you hit those there's a null error.
Firnagzen #50
Posted 15 September 2013 - 03:51 AM
Thank you for this program, it's seriously useful.

But I've found a minor glitch, very minor, and it's this: if the turtle inventory is full (which could happen in turn if the dump chest is full), after the analysis, the sorting fails with a turtle: 18: expected number (I may be remembering the error wrongly). This is relevant mainly for longer runs, and really shouldn't show up very much, but just pointing this out.
duranis #51
Posted 03 October 2013 - 06:47 AM
Did anyone ever figure out the issue with the analyser not working on MCPC servers?
Would really love to use this but it just wont work on the server at the moment.
McLeopold #52
Posted 03 October 2013 - 02:15 PM
Thank you for this program, it's seriously useful.

But I've found a minor glitch, very minor, and it's this: if the turtle inventory is full (which could happen in turn if the dump chest is full), after the analysis, the sorting fails with a turtle: 18: expected number (I may be remembering the error wrongly). This is relevant mainly for longer runs, and really shouldn't show up very much, but just pointing this out.

I think number expected would be the slot number of the free spot to use for swapping bees. I'll take a look at the code. I can probably detect it and show a more useful message, but the end result would be the same, the turtle can't continue without dropping items on the ground. I'm not sure if there would be a more elegant solution.
Dragon53535 #53
Posted 08 October 2013 - 05:26 PM
I'm curious if i'm doing it wrong, i've got the same setup as you, except it's a normal chest below, and for some reason when the turtle says "dropping excess" it doesn't drop the excess bees, is that meant to happen?
apemanzilla #54
Posted 09 October 2013 - 10:31 PM
So when can we expect the crazy multi-turtle open peripheral madness type setup Direwolf is using in FC2? (Just kidding, keep up the good work!)

On a side note, is there any particular source you used for all the data about the species and mutations, or did you enter it manually?
Dragon53535 #55
Posted 10 October 2013 - 06:59 PM
So i broke your program a little bit, if you move a bee out of it while it's working, when it's sorting it will bug out and gives the error bee:615: attempt to index ? (a nil value)
atticusmas #56
Posted 10 October 2013 - 07:50 PM
Hey, I know I must be doing something wrong here but when I run the program and do something like "bee imperial" it does stuff and works fine but then at one point it says something like "bee 1 not correctly analyzed". Then it waits for mor bees. I think the problem is my dumb knolwege of bees and because of this I might not know what to put in. So to get an imperial bee, what would I have to put into the apiary?
duranis #57
Posted 13 October 2013 - 05:56 PM
Hey, I know I must be doing something wrong here but when I run the program and do something like "bee imperial" it does stuff and works fine but then at one point it says something like "bee 1 not correctly analyzed". Then it waits for mor bees. I think the problem is my dumb knolwege of bees and because of this I might not know what to put in. So to get an imperial bee, what would I have to put into the apiary?

Are you on a server? If so its likely running MCPC which is somehow breaking the bee analyser. I would LOVE to have a solution to that but have been unable to find out how to fix it (or even what exactly is causing the problem).
apemanzilla #58
Posted 13 October 2013 - 06:20 PM
I have been using this program, running on two or three turtles on an MCPC+ server without any problems whatsoever.
Tigsen #59
Posted 13 October 2013 - 08:44 PM
Not sure if it is unique to a certain release of MCPC+ but I as well have noticed that the analyzer doesn't return the correct info, in fact the builtin readbee program will not even run correctly with it.
duranis #60
Posted 13 October 2013 - 09:02 PM
I have been using this program, running on two or three turtles on an MCPC+ server without any problems whatsoever.

Could you possibly post what version of MCPC+ you are running? I have been trying to solve this problem for awhile now but don't want to force the poor server admin to mess about with different versions in the hopes of finding the right one that works.
siiikooo0743 #61
Posted 22 October 2013 - 02:55 AM
Pretty cool programm dude :D/>

Could i copy the part with how to make species, for a little different programm?
dronf #62
Posted 22 October 2013 - 11:15 PM
Mcleopold: Do you know if this could be make to work with openperipherals instead of miscperipherals?
McLeopold #63
Posted 23 October 2013 - 01:53 PM
Pretty cool programm dude :D/>

Could i copy the part with how to make species, for a little different programm?

Yep, feel free. Give a little credit.
McLeopold #64
Posted 23 October 2013 - 01:54 PM
Mcleopold: Do you know if this could be make to work with openperipherals instead of miscperipherals?

Yes, Direwolf20 used openperipheral in his latest forgecraft2 series to do automation. I'm thinking of making a version 2 where you put any and all bees in a chest and it would start to breed all species for you.
siiikooo0743 #65
Posted 24 October 2013 - 07:47 AM
Yep, feel free.
Thanks dude!
Give a little credit.
For sure.
TrovadorUrbano #66
Posted 11 November 2013 - 05:14 PM
Making tests in my world with your (awesome) program I noticed that when i tryed to get the industrious branch (> bee Industrious) everything is going nice until i get cultivated purebreed princess and drone then it says "Bees are purebreed" and it stops without making anything else.
Why its not working?
I'm attaching the last log of the turtle.
Spoilertargeting bee species:
Common
Industrious
Unweary
Cultivated
Diligent
Clearing system…
scanning bees…..
analyzing bees…

typ species f spd d n f c tmp hmd score
-|-|——-|-|—|-|-|-|-|—|—|—–
1 P Cul:Cul 2 1.2
2 d Cul:Cul 2 1.2 64
3 d Cul:Cul 2 1.2 64
4 d For:Cul 2 0.6 64
5 d For:Mea 2 0.3 64

Bees are purebred

Edit: Nevermind, i just read the whole first page of the post, its my fault. Tank you anyway
Edited on 11 November 2013 - 04:29 PM
McLeopold #67
Posted 12 November 2013 - 05:13 PM
Making tests in my world with your (awesome) program I noticed that when i tryed to get the industrious branch (> bee Industrious) everything is going nice until i get cultivated purebreed princess and drone then it says "Bees are purebreed" and it stops without making anything else.
Why its not working?
I'm attaching the last log of the turtle.
Spoilertargeting bee species:
Common
Industrious
Unweary
Cultivated
Diligent
Clearing system…
scanning bees…..
analyzing bees…

typ species f spd d n f c tmp hmd score
-|-|——-|-|—|-|-|-|-|—|—|—–
1 P Cul:Cul 2 1.2
2 d Cul:Cul 2 1.2 64
3 d Cul:Cul 2 1.2 64
4 d For:Cul 2 0.6 64
5 d For:Mea 2 0.3 64

Bees are purebred

Edit: Nevermind, i just read the whole first page of the post, its my fault. Tank you anyway

If your turtle hadn't so efficiently bred straight to cultivated and you had a few common drones in the system, it could have continued. You can always toss a few bees into the turtle while it is waiting for the apiary. It will catalog everything for each cycle, so can can hand tune the bees that are being used while it is running.
BeyondMe #68
Posted 23 November 2013 - 12:42 AM
While this looks awesome, I have no idea how to use it.
Can someone confirm/correct what I am doing right/wrong.

Firstly I downloaded the file using the pastebin get …… in my turtle. (I think even my ineptitude got this part right)
In the turtle I typed "bee-install"
to which the turtle responded
install 'bee' …………..skip
Finished
I then tried typing edit bee-install into the turtle where it says name = "bee" I added the word Industrious after bee so it read name = "bee Industrious"
I ran the program again and got a similar message back
install 'bee Industrious' …………..skip
Finished
I have tried all sorts of things but really I am just clueless.

If someone has the patience to explain things to me that would be great.
McLeopold #69
Posted 24 November 2013 - 12:51 PM
While this looks awesome, I have no idea how to use it.
Can someone confirm/correct what I am doing right/wrong.

Firstly I downloaded the file using the pastebin get …… in my turtle. (I think even my ineptitude got this part right)
In the turtle I typed "bee-install"
to which the turtle responded
install 'bee' …………..skip
Finished
I then tried typing edit bee-install into the turtle where it says name = "bee" I added the word Industrious after bee so it read name = "bee Industrious"
I ran the program again and got a similar message back
install 'bee Industrious' …………..skip
Finished
I have tried all sorts of things but really I am just clueless.

If someone has the patience to explain things to me that would be great.

you running the installer program, not the bee program. I'd remove all bee programs and start over. You don't need to edit any files if it working correctly.
Chuckster #70
Posted 28 November 2013 - 01:14 PM
bee imperial
Targeting bee species…
Clearing system…

And then endlessly spins in circles. It never stops spinning.

The turtle has an inventory module. Is that a problem?
apemanzilla #71
Posted 29 November 2013 - 04:25 PM
bee imperial
Targeting bee species…
Clearing system…

And then endlessly spins in circles. It never stops spinning.

The turtle has an inventory module. Is that a problem?

The latest version (4.3) should not require an inventory module. Additionally, make sure that the machines (Analyzer, Misc. p. Analyzer, and Apiary) are placed in the correct places, and that the other side is left empty. Any block being there will throw it off.
Chuckster #72
Posted 29 November 2013 - 09:09 PM
Thank you for your response,
I have an apiary on front of the turtle, a bee analyzer to the left of the turtle (the misc peripherals block), an analyzer (full of honey!) to the rear of the turtle, and an obsidian chest underneath.
The block immediately to the right of the turtle is empty.
There is an oblivion frame in the apiary. The chest has a few bees in it, and they have already been analyzed. The apiary has a few bees in it (left over from the last cycle). The bee analyzer is empty. The analyzer has nothing in it but liquid honey. I am using the latest Mindcrack pack, which has misc peripherals v3.1c.

Are there any other conditions that are required to get this working?
Thanks for your help!
apemanzilla #73
Posted 29 November 2013 - 10:29 PM
Not sure why it wouldn't work then. Try manually pointing it at the apiary with the "turn" program and then running it. Also reinstall the program if it still persists.
Eiktyrner #74
Posted 01 December 2013 - 09:05 AM
I've forked it to use OpenPeripheral instead.
https://github.com/eiktyrner/bee

It's very much untested. I've only done two runs with Imperial and Industrial.
Any bugs/issues are welcome at the github page.
Or if anyone better at Lua wants to improve further. First time using it for me…

And I made a quick video.
http://youtu.be/fJIir2S22WI
Farrk #75
Posted 06 December 2013 - 08:30 AM
Very useful program, I tried some breeding myself but I was unable to get things right… So this one actually saved the day!
Sladex65 #76
Posted 08 December 2013 - 02:28 PM
Thanks for this program McLeopold, it's saving me sooo much time it's crazy. :)/>
I only have one problem with it - when it says "ditching products", it doesn't actually ditch them, so that the bees remain in the inventory, even though there is a chest beneath the turtle. I've tested this on both singleplayer and multiplayer, and it occurs in both situations.

What can I be doing wrong?
McLeopold #77
Posted 09 December 2013 - 12:27 PM
That's odd. So you have bees and combs in the turtles inventory? I know that the turtle might do a breeding cycle if it gets a comb but the queen hasn't died yet. It's never really done any harm so I don't try and detect it.

During that phase, the turtle should turn to the left and put things into the computer craft bee analyzer to see if it a bee or not, the drop it down. Try going into a lua prompt and going through the steps manually. You might spot a problem with your setup or maybe a bee analyzer bug.
Sladex65 #78
Posted 09 December 2013 - 01:00 PM
Well, I gotta correct on this one.
It does put combs and products down the chest below, but not bees (and not always).
Sometimes it does put bees into the chest, sometimes it does not, and get crammed up.
McLeopold #79
Posted 11 December 2013 - 11:56 AM
It should keep as many drones as it can in its inventory to use them for breeding. It needs to have enough space for sorting and getting the new queen and offspring. For a fertility 4 queen, it should be enough. If not you can lower the number at line 753 to less than 9. It's in the dropExcess function.
Sladex65 #80
Posted 11 December 2013 - 02:20 PM
Oh, it's an intentional feature then. It can only mean that your program works the way it should. :)/>

I've noticed something strange a few days ago though - I targeted an Industrious bee, and it bred its way up there, and it eventually got to the situation when only an industrious-industrious princess, unweary-industrious drone and an industrious-industrious drone were present in it's inventory. After calculating the scores, both drones got 4096. It decided to put in the unweary-industrious one, which I did not understand the reason of, because it just basically elongated the breeding process. Not sure if it's an intentional feature too, or just a random decision by the turtle because it couldn't distinguish the drones, but decided to drop this in here, maybe you know the cause.
McLeopold #81
Posted 12 December 2013 - 04:17 AM
Yeah, I've seen that too. It should only happen if the industrious-unweary has some other attribute, like flyer, that the pure one doesn't.
apemanzilla #82
Posted 12 December 2013 - 08:11 AM
Yeah, I've seen that too. It should only happen if the industrious-unweary has some other attribute, like flyer, that the pure one doesn't.
Maybe you could add an option where you run "bee Industrious species-only" or something like that, which causes it to only breed for the species and not the traits.
Landstryder #83
Posted 13 December 2013 - 08:35 PM
I'm using the new openperipheral only version and I'm having an odd problem with this program, It worked fine in my custom 1.6.4 mod pack but I just migrated to Direwolf20's new mod pack for 1.6.4 that has almost all the mods I used (and many more I wanted to add but could not get working), except for Extra Bees/Trees and SGCraft which I added to the pack on my server and client.

I am getting an error when it attempts to analyze the bees.

bee:593: attempt to index ? (a nil value)


	  -- Active values
	  for key, value in pairs (tableData.beeInfo.active) do  -- this line is the problem
		if key == "species" then
		  beeData["speciesPrimary"] = value
		else
		  beeData[key] = value
		end
	  end

Can anyone let me know how to fix this? other than switching mod packs again.

I'm guessing that some mod in DW20's pack is ether behind or ahead of the mods I had loaded before. I was using all the most up to date versions I could find, most were listed as alpha, beta or development and the server was a bit unstable. So I really want to stick with DW20s pack because it is a lot more stable.

Any suggestions are greatly appreciated.
Edited on 13 December 2013 - 07:36 PM
Eiktyrner #84
Posted 15 December 2013 - 10:04 AM
It's a different version of OpenPeripheral.

The returned value from local tableData = beealyzer.getStackInSlot(9) isn't the same. In the DW20 version it doesn't return beeInfo which is the most important table.

If I had more time I would dig around in the code and see what they have done. But at this point there is no fix for this from my side at least.
Landstryder #85
Posted 16 December 2013 - 08:32 AM
I poked around at it for a while and discovered that DW20's pack is using a very out of date version of OpenPeripheral. So I replaced the mod on my server and changed the one in the client to snapshot 107 and now it's all back to working.

thanks for the reply!
torli #86
Posted 17 December 2013 - 05:47 PM
Hey there, I've tried to get this running but get the same error as Landstryder (bee:593: attempt to index ? (a nil value)). I'm using OpenPeripheral-0.2.1-preview8.jar, which one should I be using instead exactly and where can I download it? Thanks in advance.

Nvm, after a little search I came across the download page for the most recent OpenPeripheral snaphots (http://www.openmods....OpenPeripheral/). Seems to be working now. :)/>
walkerboh #87
Posted 21 December 2013 - 06:12 PM
[RESOLVED]
Hello.
So I'm hoping someone can just tell me that I am being stupid, because I am really hoping to get this working. I have my setup done as told, shown in screenshot below. There are princesses and drones in the chest below (also tried a Diamond Chest from IronChests, I assume those should work fine as well). When I run 'bee common' the program starts but doesn't say its targeting any species and when it says analyzing bees it doesn't seem to find any bees from the chest as none show up in the analyzers. Am I just setting anything up wrong? Thanks in advance!



EDIT: Ok, so I realized I needed to start with the bees in the turtle. Still not sure if I am calling the program correctly as I still can't get it to say its targeting any specific type.

EDIT x2: Ok so we can chalk up all my problems to me being stupid. Wasn't capitalizing properly. But I am now getting this error : "bee:615: attempt to index ? (a nil value)". Any ideas?

Last edit: We can chalk up all my issues to me just being stupid. All working now. Thanks for the cool program.
Edited on 28 December 2013 - 09:16 AM
lsutigers527 #88
Posted 28 December 2013 - 11:36 AM
When running it in 1.6.4 on the DW20 pack I get
"bee:615: attempt to index ? (a nil value)"
Any ideas on how to fix this?
XiledSniper #89
Posted 03 January 2014 - 11:55 PM
Just curious, especially given the above post. Is this ported to the DW1.6.4 or? (Can it use open peripheral, or does it use misc?)
Eiktyrner #90
Posted 04 January 2014 - 02:59 PM
I'm not sure if the DW20 pack is updated with a newer version of OpenPeripheral. If that is the case it should work fine, otherwise you get the attempt to index null since it doesn't return the bee specific information.

Easy way to test is to run the "beealyzer.getStackInSlot(9)" command and see if it returns the beeInfo table.
walkerboh #91
Posted 04 January 2014 - 11:09 PM
When running it in 1.6.4 on the DW20 pack I get
"bee:615: attempt to index ? (a nil value)"
Any ideas on how to fix this?

I had this problem and it was because I was putting multiple queens in the turtle. Make sure you are only using one.
XiledSniper #92
Posted 06 January 2014 - 04:24 PM
I'm not sure if the DW20 pack is updated with a newer version of OpenPeripheral. If that is the case it should work fine, otherwise you get the attempt to index null since it doesn't return the bee specific information.

Easy way to test is to run the "beealyzer.getStackInSlot(9)" command and see if it returns the beeInfo table.

What version is required for the script?
yinduyun #93
Posted 11 January 2014 - 05:13 PM
I've just checked the files, current Direwolf20 pack uses OpenPeripherals 0.2.1-preview8
I have tried to run the program, and also got a nil value error message on line 599. Since I am very VERY inexperienced with computercraft, could someone please help me with the commands I'd need to get any kind of readout from the table?

edit: tinkered a bit, wrapped the analyzer as a, serialized the response of getStackInSlot(9) with an analyzed bee in there and here's the output:



So, no beeInfo. What can be done?
Edited on 13 January 2014 - 06:16 PM
Bentenmaru #94
Posted 15 January 2014 - 06:40 AM
I've just checked the files, current Direwolf20 pack uses OpenPeripherals 0.2.1-preview8 I have tried to run the program, and also got a nil value error message on line 599. Since I am very VERY inexperienced with computercraft, could someone please help me with the commands I'd need to get any kind of readout from the table? edit: tinkered a bit, wrapped the analyzer as a, serialized the response of getStackInSlot(9) with an analyzed bee in there and here's the output: So, no beeInfo. What can be done?

tried updating OpenPeriphearals? I tried it and apparently the program that tried with at https://github.com/eiktyrner/bee worked after updating OP
Keunic #95
Posted 17 January 2014 - 03:52 PM
I am getting the same error as Yinduyun and as far as I am aware I am using the most updated version of OP - OpenPeripherals 0.2.1-preview8.

bee:599: attempt to index ? (a nil value)

Does anyone know to fix this issue?
Lyqyd #96
Posted 17 January 2014 - 03:55 PM
Update. I don't believe that that is the latest version.
Eiktyrner #97
Posted 18 January 2014 - 06:52 AM
I can confirm that OpenPeripheral-0.2.1-preview8 does NOT work. It was built with minimal mod support because not many mods were updated at that point.

I've been using dev snapshot #112 but it seems the jenkins server is down at the moment. It's usually found over here

So either build it from the source or grab this from dropbox

Note that this is a development build and there may be bugs in it, use at own risk…

PS I might improve the script further, any ideas on what to add? It would be nice to interface with ExtraBees or those other genetic machines…
Edited on 18 January 2014 - 05:57 AM
theoriginalbit #98
Posted 18 January 2014 - 07:46 AM
I've been using dev snapshot #112 but it seems the jenkins server is down at the moment. It's usually found over here
The Jenkins server no longer contains OpenPeripheral, it contains our new format of OpenPeripheral-Core and OpenPeripheral-Addons as such our Jenkins server no longer contains a working version of 'OpenPeripheral'. Please make use of the link that was provided to the Build #112 that I've hosted on my Dropbox.
troslim #99
Posted 18 January 2014 - 12:29 PM
Maybe it's just me being stupid, but wondering what do when you have downloaded the code from github to the turtle. What do I need to do to start breeding?

Got it up and running now in my creative world, but when I try to use in my single player world it gets stuck at waiting for bees. It doesn't put the bees into the apiary. Any solutions for this?
Eiktyrner #100
Posted 19 January 2014 - 03:49 AM
Are you using Open or misc peripherals?

Can you describe step by step how you end up in the situation so I can repeat it?
troslim #101
Posted 19 January 2014 - 04:23 AM
Are you using Open or misc peripherals?

Can you describe step by step how you end up in the situation so I can repeat it?

Thanks for the help, but managed to get it working :)/>
OneNonlyNova #102
Posted 20 January 2014 - 11:57 AM
i'm trying to extend the programs so that the turtle looks for drones and princesses in the drop off chest below itself,
did someone already look into that?
Eiktyrner #103
Posted 22 January 2014 - 01:52 AM
i'm trying to extend the programs so that the turtle looks for drones and princesses in the drop off chest below itself,
did someone already look into that?
If you are breeding with a specific target I don't see the purpose? It will only throw away the ones it doesn't need that are scored the lowest. I guess breeding lines where you need to go "back" to Common for example would be the only case?

But I've been thinking about doing a big sorting system where it keeps all the drones and puts them in specific storage slots for later use. So you could potentially get it to breed everything. I guess it would be kind of the same thing but with more chests.
So when it finds a need for Species X it will look it up in a table of all drones (it will throw extras so the table/storage doesn't get huge) and then go collect it at location Chest Y Slot Z.
McLeopold #104
Posted 22 January 2014 - 11:58 AM
i'm trying to extend the programs so that the turtle looks for drones and princesses in the drop off chest below itself,
did someone already look into that?
If you are breeding with a specific target I don't see the purpose? It will only throw away the ones it doesn't need that are scored the lowest. I guess breeding lines where you need to go "back" to Common for example would be the only case?

The purpose would be to get better results faster, if you have multiple princesses. With only 1, you have to add the right drone and hope for the best mutations. If you have multiple princesses, you can do a few breeding cycles with the difference ones, then pick the best princess from there to continue on.
CaseyRobinson #105
Posted 22 January 2014 - 04:12 PM
Using storage space in a chest might be a better way to keep and extra stash of interesting traits around for use once you hit the target species, but I'm skeptical that it will help you get to a species any sooner.
yinduyun #106
Posted 31 January 2014 - 04:31 AM
Alright, so the program works with openperipherals 112. I've got that working and working fairly well.
Two issues at this time though - for one, the program does not appear to identify the Flyer trait (which, along with nocturnal and faster work speed really should be given higher priority than cave dwelling or longer life span) or if it does, it doesn't show in the list of traits for the various drones currently held by the turtle.
Second issue is a bit more irritating. Maybe I'm using this wrong, but the program works perfectly well when I just run the program but it kinda fails when I try specifying a target species. If, for example, I run "bee industrious" it tags all drones with 0 score and drops all but one apparently randomly chosen one to breed on with.
Am I doing this wrong?
yinduyun #107
Posted 31 January 2014 - 05:53 PM
OK, so apparently what I'd been doing wrong previously was caused by case sensitivity in the program. No big, entirely my stupidity's fault.
Just now DW20 updated once again though and got rid of the severely outdated version of openperipherals, replacing it with these:
OpenMods Lib 0.1-s112
OpenPeripheral Addons 0.1.0-s41
OpenPeripheral Core 0.3.0-s39
This opened up another issue - running the bee program now gives me this error:


That line appears to be part of the score calculation dealing with the speed value. Anyone got a quick fix for that?
Bentenmaru #108
Posted 31 January 2014 - 08:34 PM
I got a different error message than you though…but depends what bee program you are using as i try to use the one from https://github.com/eiktyrner/bee but perhaps some change in the peripheral that are incorrect perhaps so thats why it wont work with the score calculation
CaseyRobinson #109
Posted 03 February 2014 - 03:16 PM
Regarding the flyer issue, there was a bug in OpenPeripherals that was causing flyer to always appear false in the analyzer regardless of the bee's actual trait. I believe that is fixed, but I don't know exactly what version has that fix.

https://github.com/OpenMods/OpenPeripheral/issues/103

With the speed thing, can you post a beealizer screenshot of the specific bee it's choking on? I know I had to add and entry for "" speed because of some weirdness with Magic Bees.
yinduyun #110
Posted 04 February 2014 - 08:23 PM
With the speed thing, can you post a beealizer screenshot of the specific bee it's choking on? I know I had to add and entry for "" speed because of some weirdness with Magic Bees.



Turtle had been facing the wrong way before, that's why the turnRight. Forest Princess and Meadows Drone, both fresh from their respective hives. I had the drone in slot 1, princess in slot 2. The error message popped up after the turtle swapped the princess and drone.
Does anyone maybe have a quick few lines of code I can feed into the turtle to make it display a human-readable version of the beeinfo table?
CaseyRobinson #111
Posted 05 February 2014 - 09:59 AM
Human readable might be a bit generous, but here's what I use for that:

http://pastebin.com/eC7LK02Q
yinduyun #112
Posted 06 February 2014 - 09:58 AM
I just tried that, gave me this error: "textutils: 148: Cannot serialize table with recursive entries"
CaseyRobinson #113
Posted 06 February 2014 - 01:14 PM
Hmm, you must be on a different version of OpenPeripherals. Hmm, try adding ".active" after "beeInfo". You could try ".inactive" as well, but I don't think the script does much with inactive attributes.
huffy2404 #114
Posted 06 February 2014 - 07:48 PM
I tweaked eiktyrner's version to work with Direwolf20 1.6.4-1.0.14. I have only done some limited testing, but this seems to be working.

http://pastebin.com/5f5qNR0A
Slackratchet #115
Posted 06 February 2014 - 11:29 PM
I've been trying to make this work in the .14 version of Direwolf20 and the lack of the MiscPeripherial Bee Analyzer has been a stumbling block. I do have it 99% working but I an curious if anyone else is working on the same solution.
huffy2404 #116
Posted 07 February 2014 - 11:04 AM
I've been trying to make this work in the .14 version of Direwolf20 and the lack of the MiscPeripherial Bee Analyzer has been a stumbling block. I do have it 99% working but I an curious if anyone else is working on the same solution.

See post #74 in this thread for how to use OpenPeripheral instead, and post #114 (the one right above yours) for a modified version of the program that is working with the DW20 1.6.4-1.0.14 pack.
Slackratchet #117
Posted 07 February 2014 - 11:15 PM
Whoops. Sorry, I didn't read your post close enough. Sorry.
xBoom #118
Posted 08 March 2014 - 03:12 AM
i'm trying to extend the programs so that the turtle looks for drones and princesses in the drop off chest below itself,
did someone already look into that?
If you are breeding with a specific target I don't see the purpose? It will only throw away the ones it doesn't need that are scored the lowest. I guess breeding lines where you need to go "back" to Common for example would be the only case?

The purpose would be to get better results faster, if you have multiple princesses. With only 1, you have to add the right drone and hope for the best mutations. If you have multiple princesses, you can do a few breeding cycles with the difference ones, then pick the best princess from there to continue on.

Has anyone succeeded in doing this, I'm really bad at coding so I can't do it, if you did do it can you post the code here or if someone can give me an idea as how to do it
Zixxl #119
Posted 11 March 2014 - 07:27 PM
I tweaked eiktyrner's version to work with Direwolf20 1.6.4-1.0.14. I have only done some limited testing, but this seems to be working.

http://pastebin.com/5f5qNR0A

Thanks, works great!

I made a minor tweak for the sorting algorithm, because the swaps are slow:


	-- bubble sort drones
	print("sorting drones...")
	for i = 2, 16 do
	  if turtle.getItemCount(i) > 0 and droneData[i] then
		droneData[i].score = scoreBee(princessData, droneData[i])
		for j = i - 1, 2, -1 do
		  if droneData[j+1].score > droneData[j].score then
			swapBee(j+1, j, freeSlot)
			droneData[j+1], droneData[j] = droneData[j], droneData[j+1]
		  end
		end
	  end
	end

changed to:


	local highestScore
	-- selection sort drones
	logLine("sorting drones...")
	for i = 2, 16 do
	  highestScore = i
	  if turtle.getItemCount(i) > 0 and droneData[i] then
		droneData[i].score = scoreBee(princessData, droneData[i])
		for j = i + 1, 16 do
		  if turtle.getItemCount(j) > 0 and droneData[j] then
			if not droneData[j].score then
			  droneData[j].score = scoreBee(princessData, droneData[j])
			end
			if droneData[j].score > droneData[highestScore].score then
			  highestScore = j
			end
		  end
		end
		-- swap bees
		if highestScore ~= i then
		  swapBee(i, highestScore, freeSlot)
		  droneData[i], droneData[highestScore] = droneData[highestScore], droneData[i]
		end
	  end
	end

/edit because i am the last poster ;)/>

I also found a bug with the scoring system. If the princess is a purebred of the targeted bee, all bees are scored with max score e.g.:


sl t species f spd n f c tmp hmd score
--|-|-------|-|---|-|-|-|---|---|------
1 P Ind:Ind 2 0.6 - - -   -   -
2 D Unw:Ind 2 0.6 - - -   -   -  4096
3 D Unw:Ind 2 0.6 - - -   -   -  4096
4 D Unw:Ind 2 0.6 - - -   -   -  4096
5 D Unw:Ind 2 0.6 - - -   -   -  4096
6 D Cul:Dil 2 0.6 - - -   -   -  4096
7 D Mea:Dil 2 0.6 - - -   -   -  4096
8 D Unw:Dil 2 1.2 - - -   -   -  4096
9 D Unw:Dil 2 0.6 - - -   -   -  4096
10 D Ind:Ind 2 0.6 - - -   -   -  4096
11 D Unw:Ind 2 0.6 - - -   -   -  4096
12 D Unw:Ind 2 0.6 - - -   -   -  4096

I changed some code and now they are correctly scored:


sl t species f spd n f c tmp hmd score
--|-|-------|-|---|-|-|-|---|---|------
1 P Ind:Ind 2 0.6 - - -   -   -
2 D Ind:Ind 2 0.6 - - -   -   -   128
3 D Unw:Ind 2 0.6 - - -   -   -   112
4 D Cul:Ind 2 0.6 - - -   -   -   100
5 D Unw:Cul 2 0.6 - - -   -   -	84
6 D Dil:Dil 2 0.6 - - -   -   -	80
7 D Cul:Dil 2 0.6 - - -   -   -	76
8 D Com:Dil 2 1.2 - - -   -   -	74

My latest version can be downloaded here:
http://pastebin.com/8ifxPUkc
Edited on 12 March 2014 - 05:16 PM
Eiktyrner #120
Posted 14 March 2014 - 05:59 PM
Why not send a pull request to my repository? That way people don't need to hunt for the latest pastebin links.

I might not have time to update this very often but I'll gladly accept any PRs to the repo.
Zixxl #121
Posted 15 March 2014 - 11:12 AM
I have finally understood how to use github, PR created.
Horriblefate #122
Posted 30 March 2014 - 04:40 AM
Could a resume on restart be a possible option at all?

say if it were running and the server went down…?
Damaged #123
Posted 30 March 2014 - 08:04 PM
Just did a push on two changes to the program.

The first is a major speed increase, requiring MUCH less drone analyzing than before and cutting two loops of scanning the turtle's inventory.

The second was using a nifty new (read: experimental) part of openperipherals that lets you get all the bee breeding data directly without having to hard-code the table!

If anyone wants to play with it in the meantime, I take no resposibility for any drones, princesses or queens harmed as a result of this code.

http://pastebin.com/emg3SnyY
McLeopold #124
Posted 31 March 2014 - 06:47 PM
Just did a push on two changes to the program.

The first is a major speed increase, requiring MUCH less drone analyzing than before and cutting two loops of scanning the turtle's inventory.

The second was using a nifty new (read: experimental) part of openperipherals that lets you get all the bee breeding data directly without having to hard-code the table!

If anyone wants to play with it in the meantime, I take no resposibility for any drones, princesses or queens harmed as a result of this code.

http://pastebin.com/emg3SnyY
I highly suggest you switch over to the new version without the turtle. It already has these improvements plus more. The turtle is still going to be slower because of having to turn.

Bee Breeding with OpenPeripherals
Eiktyrner #125
Posted 31 March 2014 - 08:26 PM
Looks sweet McLeopold! I had not seen it before but it looks like it will replace the ported version I've been maintaining.
I'm sure the scoring method is better also. Got some weird issues with this one from time to time.

Let me know if you need a hand with anything.
McLeopold #126
Posted 01 April 2014 - 06:22 AM
Looks sweet McLeopold! I had not seen it before but it looks like it will replace the ported version I've been maintaining.
I'm sure the scoring method is better also. Got some weird issues with this one from time to time.

Let me know if you need a hand with anything.

Yes, more testing. A few have had it stall on a species without moving up the lines. Also more ideas and features to be added. But, let's take any new discussion over to the other thread.
SuperZorro #127
Posted 04 April 2014 - 07:06 PM
Wrong topic.. :(/>
Edited on 04 April 2014 - 05:36 PM
CCJJSax #128
Posted 10 August 2016 - 05:16 AM
Mine is saying

openbee:675: Other target not found

It seems to have this issue pulling out of the apiary. I even tried an industrial apiary from gendustry

Edit: I had the chest below the computer like a dummy. However sad day, the computer doesn't push all the industrial's inventory to the chest.
Edited on 10 August 2016 - 03:51 AM
Bomb Bloke #129
Posted 10 August 2016 - 10:04 AM
This script is fairly antiquated. It's unlikely you'll get support for it. I suggest a later bree-breeding script.

http://www.computercraft.info/forums2/index.php?/topic/17658-bee-breeding-with-openperipherals-now-with-bee-matron/

http://www.computercraft.info/forums2/index.php?/topic/27142-bee-breeding-openbee-modular-fork/