Saturday, February 28, 2009

Shotgun Grunt: I know what must be done.

So for the last 2 and a half weeks I've been working on getting the AI logic and pathfinding code working. Finally!!

The pathfinding was easy enough, this is 'bout the sixth time i've written it. What I've mostly been spending my time on is what we call planning. Where at any time an ai guy looks at whats going on and makes a plan on what he should do next. If you want to know more check out this guy's site: Jeff Orkin - http://web.media.mit.edu/~jorkin/goap.html.

Its an interesting thing to know how a technique logically works inside out, the reasoning for it and everything about it; but its another thing completely to code it in C++, let alone into a group of other inter-connecting systems like physics/multi-threading/etc. 

The thing with coding any sort of algorithm is that if you know both above pieces then the actual typing of the code into a compiler and running is disguistingly smaller than 2 and 1/2 weeks. Like the pathfinding code which I wrote and tested to a point where it was fully working in 1 day. 

It's 'cause, as most coders know that 80% of time is used debugging. The thing is there's a direct relationship with the amount of time spent on debugging versus the amount of understanding of what is being coded in the first place.

Moral of a post that's subject has changed five times is: Understand the concept, understand how to represent the concept in code, understand how the code will interact with other systems, then code it. 

No comments:

Post a Comment