Choose Your Language

Monday 21 March 2011

Creature AI

It's been three weeks since I last posted and during that time I have been drifting from topic to topic with respect to the module. I have spent some time writing more to the manual, some time giving older scripts a rewrite and lastly, some time investigating monster artificial intelligence (AI) related scripts. Unfortunately, I have to confess that in all this I have not been very productive, as I have been hampered by my health more than usual. I would start to look at something, but poor concentration would prevent me from doing much.

At the start of the month, I looked at scripts by Shaughn relating to oozes. I had reached a stage in my module where I wanted to start working with monsters and this seemed a good place to start. Something I did not expect, however, was to find myself wanting to rework much of the way monsters worked in NWN. The reason: I learned that creature AI in NWN2 is far from straightforward to set up. (Perhaps it's just me.) During my pondering, I ventured into new territory and had the pleasure of learning a little more about the subject from "Pain", who has provided some extensive information at the Neverwinter Citadel Project. (When I see the kind of work people like Pain do, I realise just how slow I am.) He is currently reworking the entire AI system for NWN2 (among other projects he has underway), which I am keeping an eye on for possible future use. In the meanwhile, I have learned enough to know how to tweak monster AI in ways that will be useful for my own modules without having to "reinvent the wheel". One such area I have already covered is monster auras - which may not be the most difficult of AI to work on, but is good to have sorted. As I continue to add the various monsters to the modules, I will look at a creature's individual AI as it comes along.

The Manual

Between trying to get to grips with creature AI, I have also been doing more to the manual. Thankfully, this is a much easier task as I am able to copy and paste much of its content from material I have already written somewhere else in the past. I have had to change the sentence structure and make the odd correction/update to how I finally had a system work, but the main content remains unchanged. If people are interested, I may upload a few more pages in another blog.

Scripts Rewrite

It seems to me that every now and then (normally when I try to add a new aspect to the module, like monsters this time around) that I encounter an area of code that I have not looked at for a while that raises its head in such a way that forces me to look at it again and often rewrite it. For example, while looking at some code that had NPC's react to a PC's actions, I realised I had two scripts that were similar, but had subtle differences according to whether the PC was bashing an item or casting a spell upon it. The problem was, in one, I had "fixed" an aspect that checked for certain conditions of the PC, while in the other, it remained much more generic. The problem had come about because I had obviously recognised an issue when testing one aspect of the game (bashing the object), but not another (casting a spell on the object). The bottom line is, some good has come from this, as it meant I could take the best from both scripts and amalgamate them into one function, which then made the whole thing run more efficiently. It's just annoying that I did not have them like this in the first place!

The Crafting Poll

The poll asking the player's crafting preferences came to an end and here are the results.

I was surprised at the relatively low number of votes compared to traffic reported on the site stats, but am grateful to those that did take the time to vote. I think the only real information I can take from this is that:

  1. The majority of those that voted will craft anyway.
  2. The new system I am working on does look like it will encourage some to try.

Even the one vote that was not so into crafting had left a comment saying that they still felt that they may be encouraged to try the new system if its results were worthwhile.

That's it for this week's post. Not too much to report really, as much of what I have done is going over old stuff, or trying to understand other stuff that I have yet to put to use. Hopefully, in the coming weeks, I will be more productive and have more to report.

1 comment:

Lance Botelle (Bard of Althéa) said...

Hello Steve,

Thank you for your invite. I will drop by from time to time.

Lance.