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