RPG NPC AI, Scheduling and Needs...

Started by
55 comments, last by Ingenu 23 years, 3 months ago
Here''s a new threads following the idea of the NPC AI in RPG (2. The topic begin to be too long to me Here''s a summary of the system: Base Schedule for any NPC. Schedule overriden by the need based system. Need system can be extended to reflect a little more than needs. (Or solutions to suppress them) AI Module written in C++. (So OO) Module since it might be used to create a DLL, or to be integrated in a game code. I''ll do the list of the basic needs. (I know I must do it since some days now ) -* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
Advertisement
As a slight augmentation to a simple schedule, which would generally be fairly restrictive. How about a list of tasks and an associated heuristic as to when they should be carried out. Each task in a standard schedule has a list of actions which are necessary for it''s completion. For a baker a list of tasks might be something like, obtain wood, obtain ingredients, bake bread, go to pub, buy personal groceries from market etc. Each of these tasks being split up into ordered actions i.e. bake bread consists of, light wood in oven, mix dough, place dough in oven, let cook for 20 minutes.
The tasks could be ordered by a heuristic that places a value on carrying out each task, the lower the number the loaves in the shop the higher the heuristic for baking more loaves, the less food in the bakers larder the more likely they are to go to the market.
Some tasks can be more definately ordered by overriding areas of the heuristic. If it''s 5 am bake bread, if it''s past 3pm don''t.

As long as you keep it simple you can''t go wrong.
(HA)

Mike
I repeat what I just posted on the previous thread : try not to lock yourself into DLLs.

Another thing is that you might not want to do everything in C++ in the first place. You might prefer prototyping in Java first. And I would definitely prefer using a garbage collector.

Anyway, there is a need for an Agent and a Message construct. In my opinion, it could look a bit like :

Message is

  • A priority
  • A "too late" delay, possibly infinite, for forgettable messages
  • A "thinking thread" id, for grouping messages
  • An id
  • An emitter
  • A range of receivers (a base class in a semantic network ?)
  • Some kind of type information
  • A message-dependent content of variable type (void* ?)


Agent can

  • Receive messages (invoked by the event thread)
  • Post messages (invoked by itself)
  • Think (invoked by itself, or by some kind of time-sharing facility)


What else ?
After reading Mikes post I was thinking about how you would go about constructing a task based approach. With pre-requisites for other tasks, you could create a threaded list that requires a lower thread to have been completed before it can be started. This way the NPC could be able to switch between different threads (and different tasks) making it appear like they are multitasking.

The NPC might have a thread like so:
Buy grain -> make flour -> "flour" flag is set
Get urn -> Get Water [in urn] -> get bowl -> pour water in bowl -> "water" flag is set

flour\____> pour flour in bowl -> Make bread
water/

This kind of is threaded both ways (I realised this after starting the example). The flour and the water tasks are BOTH required to make the bread. I am not sure how this could be programmed, but Linked Lists do come to mind . Basically, the NPC might "decide" to go and get an urn, then go and get some water, then take a detour and buy some grain and then go and make some flour, go get a bowl, pour the water and the flour in the bowl. Make the bread.

Just some more food for though.


-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
and our eGroup:
http://www.egroups.com/group/dwarfsoft
Not to criticize but ... seems to me like an awfully complicated way to describe Petri Nets.

Ok, I wanted to criticize
Many threads...many problems

I do think there must be an easier way to do the trick.
Don''t forget we''ll need to manage dozens to thousands of NPC with that system, so that must be fast and efficient.

And easy to programm and debug

Will think about the design...

-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
I am not a bitter man, and criticism does tend to offer better results in the long run, provided it is constructive .

Personally, I have not touched Neural Networks or Genetic Algorithms. I have heard of some very interesting stuff about them. Do you know of any good sites on the net that could be useful?

Anyways, I am sure there has to be an easier way. But we don''t really need to be considering thousands of NPC''s just yet. One NPC would be an achievement. Diablo II keeps chunking up too much with NPC''s running around the screen (and getting killed ) so I rather not use them . I guess I am a hard man to please when it comes to NPC''s.

I am thinking of posting up a summary of our Posts on my site. Just a thought at the moment, but I need some material on my site. What do you think?


-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
and our eGroup:
http://www.egroups.com/group/dwarfsoft
http://www.gameai.com

( How concise can i get )


Give me one more medicated peaceful moment.
~ (V)^|) |<é!t|-| ~
ERROR: Your beta-version of Life1.0 has expired. Please upgrade to the full version. All important social functions will be disabled from now on.
It's only funny 'till someone gets hurt.And then it's just hilarious.Unless it's you.
Here are some pointers to academic sites that might be of interest:

Autonomous Agents:
http://www.ai-center.com/links/applications/agents.html

Planning:
http://www.ai-center.com/links/applications/planning.html

Scheduling:
http://www.ai-center.com/links/applications/scheduling.html

A game AI research project that covers it all:
http://www.ai-center.com/projects/excalibur/

Best,
Alex

Edited by - Alexander Nareyek on July 11, 2000 11:39:41 AM
Alexander Nareyekhttp://www.ai-center.com/home/alex/
are you people actually programming this stuff yet? or just theorizing? i''d love to play anything you guys have!


anyways
new, just read some posts.
dos: stay forever!

scheduling. I never played the sims or anything but i guess this is sorta like it
what about npc emotion? And dialogue? I mean depending ont he type of game and setting, what if I(the player) wants to keep an npc?(join party, whatever) how are npc''s gonna remember stuff?

I remember the goblin and dwarves thing somebody mentioned.

I was playing with a sims type game but never made it(no skills)
where all the npc''s had ratings of everybody and thought good or bad of somebody in specific area, like trust, love, and some others and dialogue would be by events, npc''s remembered events
and passed (told,gossiped) them along to others

heard, seen, experienced.
who what where when idea. and that also affected ratings and their todo list. they had priority as in they wouldn''t go do something for the player unless his rating met the requirments...

I wish i could but now that i see these posts it makes me think my idea wasn''t as dumb.

just offering ideas that''s all

This topic is closed to new replies.

Advertisement