General Development

AI development – simon_templar

Simon_Templar

Member

Posts: 330
From: Eau Claire, WI USA
Registered: 10-25-2004
I have begun to delve into the topic of Game AI. I'm particularly interested in developing AI to run NPC's in a role playing game. Have any of you guys dealt with this before, or thought much about it?

------------------
-- All that is gold does not glitter,
Deep roots are not touched by the frost,
The old that is strong does not wither,
Not all those who wander are lost.

goop2

Member

Posts: 1059
From:
Registered: 06-30-2004
uh..... good work ST!

lol, I dont code... YET. ONE DAY I SHALL TAKE OVER THE WORLD WITH MY.... CODE OF..... DOOM.... OR... something.....

------------------
------------------------
Its one of those... Goop... things...
hotmail: Grafitiware@hotmail.com
Yahoo: namerobbedagian

[This message has been edited by goop2 (edited March 14, 2006).]

Lava
Member

Posts: 1905
From:
Registered: 01-26-2005
I have, in fact I found a good enemy-chase-character function in Blitz3D and I hope to implement it by the 3rd Adventure Game demo

------------------

[This message has been edited by lava (edited March 14, 2006).]

firemaker103

Member

Posts: 643
From:
Registered: 07-13-2005
If only we could have a MakeHalfLife2() function..... *sigh*

..

For one thing, AI is just really hard. Just slap some online play instead
(Which, actually is more harder, maybe...)

------------------
"Be nice to the nerds because later on, you'll be working for them" - Bill Gates

Ereon

Member

Posts: 1018
From: Ohio, United States
Registered: 04-12-2005
I have an excellent book on the subject as well as some interesting ideas (genetic game style algorithims anyone ). I have to go to bed soon, but I'll post more on this topic later, AI is a very interesting subject.

------------------

goop2

Member

Posts: 1059
From:
Registered: 06-30-2004
Id rather a Makexbox() function

------------------
------------------------
Its one of those... Goop... things...
hotmail: Grafitiware@hotmail.com
Yahoo: namerobbedagian

Lava
Member

Posts: 1905
From:
Registered: 01-26-2005
here's a freebie that you can plug into your Blitz3d source code, it's the enemy chase thing I wrote.


If entityinview(hero,enemy_cam) Then
PointEntity enemy,hero
Moveentity enemy,0,0,1
End if

------------------

goop2

Member

Posts: 1059
From:
Registered: 06-30-2004
you mean your selling the rest?

------------------
------------------------
Its one of those... Goop... things...
hotmail: Grafitiware@hotmail.com
Yahoo: namerobbedagian

Lava
Member

Posts: 1905
From:
Registered: 01-26-2005
lol, well if I was to go into commerical game writing I would keep the source confidential unless you bought it or something

------------------

Ereon

Member

Posts: 1018
From: Ohio, United States
Registered: 04-12-2005
I'm working on an AI algorithim for Soul Catcher that adjusts the enemies to the player's fighting style working off of the principles of microevolution. Every time you fight and enemy its success is measured via a mathematical equation (how long it survived, how much damage it did to you, ect). Each time an enemy is creating its abilities are randomized to a certain point, and every 5 enemies the "most successful" enemy is used as the base stats for the next set of randomizations for the next "generation". The end result is a constantly evolving set of enemies that adapt to your combat style, the enemies who are the most successful "pass on" their particular mix of abilities to make a generation that is (hopefully) better than the last one. This system of selection continues through the game adapting constantly to your play style. All this is done mathematically with arrays and such in the game and random number generators.

------------------

crazyishone

Member

Posts: 1685
From:
Registered: 08-25-2004
That's a great idea, but you might want to put in some form of checking. If you have the most successful enemy attributes being passed on and getting better, completely unchecked, your player might be fighting a bunch of Agent Smiths by the end of level 3.

------------------
"I bleed black tears"

Will the emo kids be my friends now?

Ereon

Member

Posts: 1018
From: Ohio, United States
Registered: 04-12-2005
Exactly........*lightning flashes in the background as Ereon cackles diabolically*

------------------

crazyishone

Member

Posts: 1685
From:
Registered: 08-25-2004
I look forward to the open beta.

------------------
"I bleed black tears"

Will the emo kids be my friends now?

Jari

Member

Posts: 1471
From: Helsinki, Finland
Registered: 03-11-2005
Yes I have been working with NPC conversation dialogs, but what comes to NPC's movement, there is currently only basic moving from point A to B implemeted because that's all what NPCs in VoHW need.

------------------
Mat 5:6 Blessed are they which do hunger and thirst after righteousness: for they shall be filled.

[VoHW] (Help needed) [Blog] - Truedisciple (mp3)

NileCoder

Junior Member

Posts: 8
From: winter park, fl, 32792
Registered: 03-20-2004
You should do some research in FSM ( finite state machine ), path finding, and depending how complex your game is, neural networks. You can find most of this by searching the web. If you are doing this in C++, I can lead you toward the right direction.

------------------
"Give me chastity and continence, but not just now." Saint Augustine, ca 410 AD.

firemaker103

Member

Posts: 643
From:
Registered: 07-13-2005
A good tutorial:
http://web.archive.org/web/20050319160542/www.blitzcoder.com/cgi-bin/articles/show_article.pl?f=morduun07112003153313.html

------------------
"Be nice to the nerds because later on, you'll be working for them" - Bill Gates

Simon_Templar

Member

Posts: 330
From: Eau Claire, WI USA
Registered: 10-25-2004
I have a basic understanding of finite state machines and basic chase/evade.

I think in an RPG the optimum for me would be to have a blend with the non essential characters being fairly basic if then kind of AI, but with more story important characters having a responsive/evolving AI.

I haven't read much on neural nets as of yet I'll probably check that out next. What I'm really interested in right now is the concept of introducing something to simulate the way people make decisions, based on risk/benefit, but also emotional/ethical values, and sometimes just a good ole bit of randomness.

------------------
-- All that is gold does not glitter,
Deep roots are not touched by the frost,
The old that is strong does not wither,
Not all those who wander are lost.

Ereon

Member

Posts: 1018
From: Ohio, United States
Registered: 04-12-2005
I like the AI system that's being used in Morrowind:Oblivion, its based off of a need system, if a character needs something (like food) it will go get it, and if it doesn't feel that its getting enough it will come up with a way to get more. Its a very simple but very interesting concept, because most humans, unless they choose otherwise, and driven by the system of needs/wants anyway, so its a pretty realistic system.

------------------

Simon_Templar

Member

Posts: 330
From: Eau Claire, WI USA
Registered: 10-25-2004
Thats an interesting concept.

I was thinking of something like that where each NPC may have a list of needs or wants, I'd call it a priority list.. normally the NPC would have a list of items with differing importance, it would include things like food, money, but also staying alive, honor, protecting something (if they are guards). Some of the priorities may increase with time (such as food).
others could remain static, or increase/decrease by trigger events.

To simulate the unpredicatbility of human decisions I'd have the NPC's action be determined by a radnom die roll which is modified by the priority list.


With this you could do something like, you've got an NPC guarding a prisoner.. the NPC who guards at night has conflicting priorities of wanting to do his job, wanting to get a snack, and being tired. The action roll is weighted towards doing his job and staying on guard because thats his highest priority, but as time goes on the chances get better that he may fall asleep, or sneak away to the kitchen for a minute because the value of those two priorities increases.

------------------
-- All that is gold does not glitter,
Deep roots are not touched by the frost,
The old that is strong does not wither,
Not all those who wander are lost.