Author Topic: NEAT or rtNEAT could it be aplicable in NWN?  (Read 420 times)

Legacy_Dark Ruler

  • Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
NEAT or rtNEAT could it be aplicable in NWN?
« on: February 19, 2011, 11:42:08 pm »


                So guys, I've read through all the topics and saw an interesting one: "Suggestions on a Good Monster AI?"

And I remenbered NEAT (NeuroEvolution of Augmenting Topologies)! So does anyone about about this genetic algothm?

It basically creates an artificial neural network, and the computer really evolves! 

All this so I can ask you guys (who are much more able to answer this question) this, do you think this could be of any use to create a more intelligent AI for NWN?


Thanks in advance for your time, hope you like the topic '<img'>
               
               

               
            

Legacy_Dark Ruler

  • Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
NEAT or rtNEAT could it be aplicable in NWN?
« Reply #1 on: February 20, 2011, 09:49:30 am »


               Well here I was thinking, you guys would love the topic, and not even one response in 10 hours ;p...

Could it be that you guys want me to explain NEAT a little bit more so you can then comment?

Well let us try...



NeuroEvolution of Augmenting Topologies (NEAT): is a genetic algorithm for the generation of evolving artificial neural networks (a neuroevolution technique) developed by Ken Stanley in 2002.

It is based on applying three key techniques: tracking genes with history markers to allow crossover among topologies, applying speciation (the evolution of species) to preserve innovations, and developing topologies incrementally from simple initial structures ("complexifying").

The NEAT approach begins with a perceptron-like feed-forward network of only input neurons and output neurons. As evolution progresses through discrete steps, the complexity of the network's topology may grow, either by inserting a new neuron into a connection path, or by creating a new connection between (formerly unconnected) neurons.



An extension of NEAT was devised in 2003 (rtNEAT) by Stanley that allows evolution to occur in real time, the basic idea is to put the population under constant evaluation with a "lifetime" timer on each individual in the population. When a network's timer expires its current fitness measure is examined to see whether it falls near the bottom of the population, and if so it is discarded and replaced by a new network bred from two high-fitness parents. A timer is set for the new network and it is placed in the population to participate in the ongoing evaluations.



The first application of rtNEAT is a video game called Neuro-Evolving Robotic Operatives, or NERO. In the first phase of the game, individual players deploy robots in a 'sandbox' and train them to some desired tactical doctrine. Once a collection of robots has been trained, a second phase of play allows players to pit their robots in a battle against robots trained by some other player, to see how well their training regimens prepared their robots for battle.



HyperNEAT: is specialized to evolve large scale structures. It was originally based on the CPPN theory and is an active field of research.



Content-Generating NEAT (cgNEAT): evolves custom video game content based on user preferences. The first video game to implement cgNEAT is Galactic Arms Race, a space-shooter game in which unique particle system weapons are evolved based player usage statistics.[3] Each particle system weapon in the game is controlled by an evolved CPPN, similarly to the evolution technique in the NEAT Particles interactive art program.



Implementations: Stanley's original (link: http://nn.cs.utexas....ew.php?SoftID=4 ) and rtNEAT (link: http://www.cs.utexas.../keyword?rtneat ) for C++



All this content was pasted from the wiki here's the link: http://en.wikipedia....ting_topologies



From experience I can tell you this (I've been looking all over the place for it's implementations, program's that use it and so on...) I've used alot of programs that use rtNEAT (if you want I'll tell you the names, or even send to you the programs I have) and it's a beautifull thing to see believe me, the computer is a little bit slow to implement complex changes but once done, they are the best you can get.

I believe this could only be implemented in NWN not in real time on the servs (it would suck, the computer needs to start with basic things to do first, like approach enemy, or run from enemy) but by training the NPC's/monster's before battle and then putting them on the serv.

Another thing I can think could be done, since NEAT uses sensor's to see how to act, I believe we could use the sensors on a serv in real time, and then when training the NPC's put the things he learned form the sensors so he would learn from them.



Well here's my thought, hope you liked it, sorry if it's too long. ;p



PS: Sorry I don't know how to put link's just by clicking the words...
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
NEAT or rtNEAT could it be aplicable in NWN?
« Reply #2 on: February 20, 2011, 01:11:21 pm »


               What is a learning-able AI for monsters whose only one purpose is to die under player's sword?

Players do not want monsters to be very smart. its true that default AI acts often very stupidly, but custom AIs like Jasperrs were very suitable for me as a builder. After some time, I found out that its a best to make my own AI for each special monster to reach best results, but I wouldnt use such AI for common monsters who should be stupid.
               
               

               
            

Legacy_Dark Ruler

  • Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
NEAT or rtNEAT could it be aplicable in NWN?
« Reply #3 on: February 20, 2011, 02:01:23 pm »


               Why should common monsters be stupid? ok goblins should be stupid, but they should be smart in their pattern, and that is what I'm talking about, you can teach a monster to act the way you want and he'll use always that pattern, and better yet those special monsters will be adaptable to the different players styles...I'm only talking for me, but i enjoy games that are dificult, when i say dificult i don't say impossible, but that make me think about what better strategy to use with this or the other monster, and would even love more, monsters that would adapt to me, making me really think about what to do next, like a real person would if I was playing against it, that's what I always loved about D&D It's always different, if you got a good DM.

Just my opinion ofcourse, and I would really like to know the opinions of others about this, and maybe even ideas on how to do it ;p?!



Thanks for the post ShaDoOoW, please continue posting i like to discuss different opinions '<img'>
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
NEAT or rtNEAT could it be aplicable in NWN?
« Reply #4 on: February 20, 2011, 03:29:17 pm »


               Well being a PnP DnD player since "79". NWN comes a bit close to it but not close. AI is a good thing to have for your creatures.  Every creature has there own way of thinking and in DnD a DM can adjust it by the way they see it. But in NWN it is not like that, well in so many ways. But I would have to agree with both of you two. This is why each module you have out there is a bit different. And the DM in those module can make a world of difference.
               
               

               


                     Modifié par Taino, 20 février 2011 - 03:31 .
                     
                  


            

Legacy_winnersguard

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
NEAT or rtNEAT could it be aplicable in NWN?
« Reply #5 on: March 29, 2011, 03:49:21 am »


               2 papers that discuss rtNEAT research in MUDs:

http://www.cs.utexas.../tr/TR-1969.pdf
and
http://www.cs.utexas.../tr/TR-1975.pdf
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
NEAT or rtNEAT could it be aplicable in NWN?
« Reply #6 on: March 29, 2011, 04:22:35 pm »


               This is never going to be feasible in a nwn module using vanilla nwn.

Neverwinter nights is a single threaded script engine using the Virtual Machine packaged in nwserver.exe.

Basically, the server can only handle a single script at any moment in time.


Something as complex as a Genetic Learning Algorithim, would require multiple threads, data storage functionality etc.

Things that 'might' be possible via nwnx, but definitely not feasible to a playable degree via vanilla nwn.

You might be able to code a single npc to be highly inteligent, and seemingly learn from encounters etc.
But when you start using multiple copies of him, you will have his script/brain, being executed at the same time.

The TMI (Too Many Instructions) error message can be triggered not only by never ending scripts, but by too many objects calling the same script.
eg - the vanilla nwn AI Script could generate a TMI if you spawned 1000 monsters that use that script. Especially in combat.


So, essentially what im saying,

To make incredibly inteligent creatures, you need to make incredibly complex scripts (or have the AI controlled from outside of nwn altogether).
Having complex scripts, increases instruction count.
Having multiple creatures calling the same script, multiplies the instruction count further


On the note of Controlling the nwn AI from outside of nwn, this is potentially feasible, based on my limited understanding of nwnx.
Via hooking, you could potentially hook onto the AI of creatures, and then have multi-threaded AI Calculations carried out, outside, of nwn, in nwnx, and then fed back into nwn, assigning commands to creatures.

eg - it is already possible to make nwnx put actions on the action queue of creatures.
nwnx could be coded to determine strategies, conditions etc, and then assign the relevent commands to the creatures.
Having it mulit-threaded means it would not be blocking, and would be able to cope with as many creatures as needed.