Menu

Better Brains, Explosions, Splash Damage

Version 0.2.3 of Trilobots has a couple of obvious changes. Missiles now explode and do splash damage to nearby Trilobots. In the next release, I'll try to remember to make the area of effect widen for more powerful missiles. Splash damage is always as weak as a red laser, and shields do protect against it. You are immune to splash damage from your own missiles, and the trilobots are immune to their splash damage as well (at least for now)

I experimented with having missiles do chain-reactions by exploding each other, but it made missiles too useless. I'm trying to make sure it makes sense to have both missiles and lasers.

Another thing you'll notice is that Trilobots turn red and fade out when you shoot them. This is a little effect done in ActionScript. Trilobots will turn green or blue if you destroy them with a more powerful weapon.

What you won't likely notice is the total overhaul of their brain code. Now the trilobots compile their array of strings into a datastructure called a ProgNode. This node adheres to the tree stucture of the trilobots programming language. In fact, it's now strictly a binary tree. This should make computation run faster. I also added some more math and logic abilities to their brain, but I commented out the trigonometry functions because it appeared they were slowing the program down.

I also converted all the boolean logic to use numbers (<=0 for false, and >0 for true, boolean operators return 0 for false and 1 for true). That way boolean and numerical nodes can freely exchange input and output, which cut down on a lot of annoying code in the compiler function.

Also, the way actions were evaluated before didn't allow them to return a variable based on their success. Now that is changed! For example, a trilobot can try to use the function attached to their body (arm lasers, jump, cloak, etc). It will fail if their body type has no function (like the armored body or the "termite" body), or if their cooldown status won't allow them to use that part just yet. Now it will return 0 if it tries and fails, and return 1 of it tries and succeeds. A good program could use that information to decide to do something else.

I expect to be fixing bugs in the compiler code and the mutation and sexual reproduction code for a while to come. My output messages tell me that the genes don't always end up as compilable code.

Posted by Joe Rheaume 2007-06-04

Log in to post a comment.