Wednesday, October 24, 2007

From Robots to God

Yesterday I watch a show called robots on TV. It shows all type of different robots, from the simpler ones that you can program and help disabled people to walk, to the fun ones for research or recreational use. One example of a fun robot is a bot been developed in Japanese university that will move like a monkey and try to jump and grab from wire to wire (in a very controlled environment, where the wires are evenly spaced).

The fun bots, no matter it is for jumping/rolling/crawling, sort of struck me. I just realized that we bot writers who write bots for online/off line games are also design robots, in a very similar way. The only difference is our bots works in a simulated environment. We can call our bots poor man's robot, or virtual robots. There are advantages and disadvantages compare our bot to the real machine robots. Our bots run in a virtual world and there are no mechanical parts, so it is cheaper, easier to maintain (you don't need to worry about hardware limits/changes/costs), but what information available is limited (only what can be extracted from the games, while the real bots can have censors where they want). Both the virtual bots and real bots need to have some real time abilities (been real time means needs to response to real time events, been to coordinate all hardware movements to be able to grab a wire, or respond to mobs fast enough to keep alive).

We virtual bot creators are a level higher than the bots created for fun. The reason been is that we work on an abstract level, that we don't need to deal with feet dragging hardware. This way we focus more on the core part of robot design, that i design robot logic (or AI). The real mech bots creators are limited by hardware, and I don't see any machines that can surpass humans or animals in combination of efficiency and agility soon (machines might excel in a specific area, but will never be as flexible and efficient as humans. )

And before the end of this passage. I just want to say, I don't believe in AI (artificial intelligence). I remember I had this thought ever since I was young, I can't figure out how to design true intelligence. All we can do is design fake intelligence, that is something that looks intelligent, but if you fool around with it you will realize it is just a bot (and that is why it is so hard to make the bots looks truly human even in an online environment, even though only limited actions are available).

I first got this thought when I thought about how to make true random numbers in a computer. The final conclusion is there is no way to make a truly random generator unless you rely on hardware. There is just no way you can design a computer to be self aware, to have true feelings. It is this believe that draws me to the conclusion that there must be a GOD, or a spiritual world must exists that could use this physical world to manifest itself.

So in another sense, I don't believe we could live in multiple levels of virtual worlds (one real world designed a virtual world that has its own intelligence that then designed another virtual world, and possibly this virtual world which is designed by a virtual world would design another level of virtual world and so on), but I do believe that one spiritual world that could manifest itself onto different levels of physical world (for example, each tiny atom could be an solar system, and each of those tiny virtual solar systems are combined by even tinnier atoms and they are also tiny tiny solar systems, and all of them could have a spiritual manifestation, meaning truly intelligence life.

Tuesday, October 16, 2007

Bot improvements

During the weekend, I was boting and trying to farm some valuables. The area is populated but I was watching my toon while watching TV. During the commericals I noticed a hunter which is also a bot (It was very easy to tell, that is why never bot unattended in populated areas). From time to time we both tag on the same mob and dependend on who shoot first, one of us is not getting the loot.

The problem is his gun was faster and more than 50% of the time he tags first and my toon is there assisting him! That was very annoying so I decided to implement something to fix that (if a mob is targeting some other npc, give up).

Initially I thought it is an easy fix. I will just check with javascript (so no binary recompiles) after first attack and if mob is not targeting me, abort. However my gun was more powerfull and usually even he tags first, I could end up drawing argo after the first attack.

Eventually I have to recompile, implement a call back during my spell channeling to call the javascript function processMessages (I am lazy), with a state of "inChannel". That is good for any casters, so when you channel your spell, you will find out if someone has taged your mob and abort.

Most likely I will release it after some more testing. For now I will need to find a good place to farm some herbs. My current farming place is too hard, a lot of mobs and I die too much, with all the repair bill I might just buy stuff off AH.

Thursday, October 11, 2007

Bot crash on javascript

Wake up early this morning so I setup the bot to farm something and go back to sleep.

When I am ready for work, I found the bot has crashed. Curious about what caused it, I

did a trace and found it crashed inside the javascript engine, some assertion about

something variable in the stack frame that should be NULL but is not.

A bit more digging around the code, I found the javascript stock frame is actually

created on local stock. The global context frame is temporarily replaced by it, and

restored back upon execution exit.

Now it is clear. If something happends that prevented the restore of the original stock

frame, the global context frame will be pointed to non-exist space. That something is

usually exceptions raised upon native code (C++ code). It could be that because network

either on Blizzard's side or my side, connection is closed and native C++ raised

exception. I am catching the exception but was too far out thus the javascript did not

have a chance to clean up it's stock.

A good solution will be use the try{}finally{} replacement trick I mentioned before in

my blog to make sure the stock frame is restored upon function exit.

Wednesday, October 10, 2007

One Fun Patching Night

Yes, another patch yesterday and another pain. I forget that was Tuesday already, because Monday was a holiday. Come home around 8, lunched WOW after dinner and Blizzard stuck me with an patch. Surely enough most offsets are broken.

The first thing is of course change the offset download page's version to stop bots from running. Good thing is there was another patch last week so I was still warm on offset finding. Process was quick and everything was tested and good to go.

Edit version number, build both releases, uploaded zip files, modify the pages. Thought everything was set. Then remembered DTK's script on player detection. I should have included it in the release some time ago. No big deal. Added in the scripts, re-zip the files, take out the CVS (version control) folders from zips, upload again, then download for testing. That took a good 30+ minutes.

After some testing, found I forget to include Item names. All items names are showing as blank. No big deal, rebuild everything again, changed version number of bots, zip, upload, change web pages, download and test and another 40 minutes.

Some more testing. This time found I forget to get the messages offset. DTK's script is no good unless I fix that. At that time wife is starting to argo, and my tempers are high. Took me half an hour to get wife happy again, then found the offset, zip, upload, change web pages, test ... and found I didn't change module version. So repeat like a robot, upload, tested and went to bed. The whole night gone by like a blast and I didn't get to play a bit.

I was relaxed this morning. Feels free and get up late. Went to setup the toon for farming, and behold found the player's names are incorrect. Fix/zip/upload/download/test... Sometime during that process wife starts to argo, and for a good reason: "You are going to be late!" she said, like I don't know that. I am a bit late for work but now bots are up and running.

There might be one or two not important offsets that is still off, but let me play and have some fun first :-)

Sunday, October 7, 2007

Chinese WOW players

Recently I read a story about a chinese girl dead after playing WOW. I forget the details but looks like she played for 3 days straight, and her friend said she told them she was exhausted after playing.

There might be a culture difference between how Americans and Asians playing this game, where the chinese player take this game more seriously (less the Gold Farmers of course). Each chinese family can only have one child, so they might be spoil the child more as well.

I think it will be a good idea to make a bot for the chinese people, but there are huge problems. I have downloaded the Taiwanese version of the game and it works fine with my bot, but to download the Chinese version, I have to have a valid chinese citizen's card (Impossible for me). There is also no way to accept payment, but that will be fine, if I know my bot can help people, I will let them have it for free. All my previous freewares are free so no big deal.

Thursday, October 4, 2007

My new toy

This is totally unrelated to WOW. Sometime ago I bought a Cannon Rebel XT because my 2 year old digital camera can't shoot clearly in house without a flash. So after a lot of research, I decided to go with a mid range digital camera (Primarily for my wife's brother's new baby, we don't want to use flash on him).

The result is not very satisficatory. Even though the new camera looks good and feels great (I like that "click" sound when shooting, feels great and I got hooked on shooting), we still can't easily shoot non-blurry pictures inside our home most of the time.

After some more research, I found out that good camera heads with smaller aperture values can do well in this situation. So we got a Cannon f1.4. This head can't zoom, but man the picture quality is outstanding. I can't wait to use it on that new born (not so new any more anyway).

Will post more details later.

Wednesday, October 3, 2007

Patch 2.2.2

Yesterday was another patch day. In the morning I logged on thinking about get some herbs for this weekend's run, and to my surprise, another update (Yes I totally forget that was Tuesday).

And it drags on, extended by some hours so I can't do anything. At night I went home late (big release for my company) and had to work 2 hours to get a simple offset update. The biggest reason is I am trying something to send the offsets to users instead of letting them update the software, and that is not going well, just too many of them.

So instead of that, I am only sending a few :-), and that is still causing problems (when there is a parser error of any reason, it crashes because I forget to catch the error).

Anyway, the patched bot is finally out so hope everyone enjoy.

Monday, October 1, 2007

Deadly deadmines

First, interesting post on CNN about forgotten presidents of US.

Second, using a very high level char to help your bodies in very low level dungeons is not a smart idea. I was in dead mines with a full group of level 10s, and guess what happened?

Well, deadlines is one dark place. I could walk by the mobs without noticing them, and they of course, ignores me. However my buddies attracts them like dead meat on flies. No matter how careful I try to be, my buddies often got killed by mobs, often a wipe. It was still worth it because we did have a good laugh together see how long the train of mob was when they were running around.