Author Topic: NPC behavior language other than nwscript  (Read 475 times)

Legacy_Jonesg

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
NPC behavior language other than nwscript
« on: March 06, 2011, 09:41:32 pm »


               Hello

First time posting so i hope i don't offend anyone by asking this. tl;dr below.

As part of a university project my group and I are working on making NPC behavior seem less static by extending the static behavior formalism Behavior Trees (aigamedev.com/open/articles/bt-overview/). We have previously worked on using behavior trees in RPG games, namely Starcraft Broodwars, using a combination of BWAPI (a C++ library for Starcraft), Chaoslauncher (DLL injector for Starcraft BroodWars) and bwapi-mono-bridge (allowing the use of mono/.NET code for AI behavior).

Moving onto working with NPC behavior an RPG game seems the most logical and our initial interested was sparked by Neverwinter Nights 1. However working with NWscript for a while and even NeverWinter Nights Extender for allowing more complex datastructures (the tree structure of behavior trees) to be made we have run into a "dead-end".

What we are looking for is a way to easily interface with an NPC from a, prefferably, OOP environment such as python, c++, .NET/Mono etc. like what we used with Starcraft Broodwars. NWNX almost supplies this but lacks the ability to access information about the game environment without having to send it in the request.

tl;dr
Is it possible to use another language that NWscript for creating NPC behavior in Neverwinter nights 1?
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NPC behavior language other than nwscript
« Reply #1 on: March 07, 2011, 10:33:17 am »


               Just a shot in the dark, but does c++ not allow the use of Threading?
Why not make a perma loop thread, that continuously queries the environment of nwn, and use that to get the information you require.

eg

while(true)
{
//Do this

Thread.Sleep(iDelay) //Delay for a duration until the next loop
}


This is the standard type of loop that is generally used for sever -> client applications, but can be used in other scenarios too.
               
               

               
            

Legacy_Jonesg

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
NPC behavior language other than nwscript
« Reply #2 on: March 08, 2011, 01:23:02 pm »


               As of what I understand of NWNX the only thing it is able to do is read local variables prexifed with "NWNX!" in their name. This you cannot in the c++ part which is NWNX query the game environment. You have to in NWscript tell NWNX what state the world is in. This can be a quite tedious task to maintain.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
NPC behavior language other than nwscript
« Reply #3 on: March 08, 2011, 01:44:20 pm »


               As far as I remember there have been in past very similar project. They made it so their AI used external AI instructions in Lisp(not sure but it wasnt nwscript naither c++) language. The problem is that they never share this with NWN community neither with NWNX community, so why they was doing it anyway? I don't like such projects...

Well there will be somewhere at NWNX forum showcase from them or at least some message, but I couldn't find it its a long time ago...