Tuesday 1 April 2008

Rant 116 / Generating 100 Grains Of Rice Per Second

After reading the discussion between the few authors of freerice bots in the blog of the guy who wrote a 50-thread bot with Ruby, I found out that the first bot I used, the one written in Python, was actually able to multi-thread too. So I abandoned the newer bots and reinstalled Python.

Now, I have set the number of threads of the bot to 50, so it is now running 50 browers of www.freerice.com at the same time. And it seems that he has improved the bot, making it display the rate of donation per second and the total number of grains can now exceed 100k (it used to reset at 100k).

Also it displays the amount of time the browsers are resting between each question, so that it won't look exactly like a bot. Right now it is resting at the default option of random number of seconds between 3-6. So the result looks as if 50 very smart people are playing it.

As of this moment it is donating at a rate of 105 grains/s, though I've seen it hit 114 just half an hour ago. Probably because all 50 threads are at level 50 now and makes a few mistakes here and there. Those guys at freerice.com actually does input new words now and again. Accuracy of the bot, according to its calculator, is at 87.95%.

Another aspect I like about this bot is that it has a very large vocabulary of over 2.5k words even before I first started it. After starting it, the bot actually learns from its mistakes, but that's just like every other freerice bot I've come across. In addition, it checks with dict.org if its internal dictionary does not provide the right answer. So, at 87.95% accuracy, it means that 12.05% of all the words it has seen so far are not available at dict.org.

Anyway, I can set the number of threads to any number I want. I tried 20 at first and there as no problem. So I tested 50 and went to do something else. I returned after 15mins and checked with my brother to see if I'm using too much bandwidth. I didn't, so I'm going to try to find out my limits gradually. I'll increase the number by 10 every time I turn it on, until it affects my games. If 50 threads can go up to a rate of 114grains/s, imagine how much 100 can do!

Even at 105grains/s, it will generate 378000 grains/hr, and taking a grain of rice to weigh 0.025g each, that is a whopping 9.45kg/hr. If I leave it on for as long as I'm awake, which is at least 14 hours a day, and assuming that it doesn't crash, that is a minimum of 132.3 kg/day!!! I can freaking feed a village or even a town at this rate all by myself!

Of course, nothing is perfect. It turns out that this bot does crash. After generating 110k grains of rice, it finally stopped for reasons I don't understand. By reading where it ended, I guess that it was probably because the website did not reply to one of the answers submitted quick enough, and the bot didn't know what to do, thus it crashed.

To solve this, I'm now trying to increase the minimum amount of time it can rest, from 3-6s to 4-6s. Hope that works. Or else, I can run 100 threads that rest 5-10s. Logically, this would put the same amount of workload, but I'm not exactly a pro in this matter.






Yesterday my bro found a game that combines Heroes of Might and Magic V with MMORPG elements. He tried it for 2 hours, and what he found was that quests take the form of small HOMMV maps with only 1 way to move. Hero has a city that can almost identical to those in HOMMV, but with different graphics. You have one hero, who buys armies in your city that other people cannot access (kinda lame here, coz what's the point of having a fantastic city in a multiplayer game if not to show it off?), and goes for quests. He did not try anymore after finding out this much.

I believe there has to be PVP elements in there, probably a duel between armies or etc. But it really is interesting if there are co-op quests in the game, and how they can be implemented.

The graphics of the armies are almost identical to the originals for some (eg zombies look just the same, except with a really long knife), but quite different for others (skeletons wield only huge swords here). There are also new units, like the lizard archers. Lastly the numbers are quite different in this game, like the fact that skeletons have 20 HP and ballistas have 2500 HP.

Unfortunately, this game is produced by a Chinese company and in beta phase, which means there are no English versions yet. So if I play this game, I will be a really slow player because I take some time to read Chinese words.

The game looks interesting, especially since I have played HOMMV before. Mixing it with a MMO is something I didn't expect. No matter, since my bro has deleted the game and forgot the link to the website. Perhaps someday if it gets popular, I may try it.

No comments:

Post a Comment