• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

Archived

This topic is now archived and is closed to further replies.

Ingenu

RPG NPC AI, Scheduling and Needs...

56 posts in this topic

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. *-
0

Share this post


Link to post
Share on other sites
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
0

Share this post


Link to post
Share on other sites
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 ?
0

Share this post


Link to post
Share on other sites
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
0

Share this post


Link to post
Share on other sites
Not to criticize but ... seems to me like an awfully complicated way to describe Petri Nets.

Ok, I wanted to criticize
0

Share this post


Link to post
Share on other sites
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. *-
0

Share this post


Link to post
Share on other sites
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
0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites
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
0

Share this post


Link to post
Share on other sites
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

0

Share this post


Link to post
Share on other sites
again.

About the elves and goblins not liking each other, maybe that''s just a stereotype(int he game) and once they get to know each other that will change?


About npc''s and food. (I''m basing my thoughts on final fantasy type games) Maybe it''s not that person that has the food, but the house that has the food, so people living in the same house can split chores, such as wife gets this, husband gets that, while the kids just play all day, who they play with and where they shop (if multiple shops) is determined by the rating of the shop?

Well i''m not gonna post till i see good or bad replys...bye
0

Share this post


Link to post
Share on other sites
I love the idea (expressed earlier) of NPCs being scheduled, and if anyone cares to hear my opinion, I have another interesting idea regarding messaging between NPCs. I''d say one would just want to represent speech as a universal communication that is recieved by all nearby NPCs and the player: An NPC who wanted to buy bread or whatever, would walk into a bread shop, and approach the counter and say, "I''d like to buy some raisin bread." Which would be broadcast to nearby players and NPCs.

The baker would respond via speech, such as, "That''ll be 4 gil," or "Sorry, I sold the last raisin bread a little while ago," or whatever, and the hungry NPC would get the idea and give money to him, upon which the baker would give him the bread. With messages and transactions being broadcast that way, NPCs could react to things happening around them. If another NPC is just outside and the door is open, she may hear the man buying bread and think, "Hmm, now that you mention it, I could really go for a loaf of bread right about now." Essentially my thought is that we need to make NPCs react more *visibly* to one another than just passing silent messages and objects from one NPC to another with little more than perhaps a "hungryman buys a loaf of bread."

Think of it this way: you don''t just walk into a bakery, hand some money to the guy behind the counter, and take a loaf of bread. (at least, I don''t.) More often, you walk in and if there''s not many people there, he says, "Hi, how can I help you?" Or if the room is packed, he might not even notice until you come to the end of the line. It''s always a dialogue rather than a plain old exchange, and if you tell the baker "gee, my dog died and I''m really depressed," someone else may overhear you and comment on it or be affected by it.

I doubt this makes any sense really, because I''m not sure what I''m saying myself, but owell. O;.


+------------------------------------------------
| Thp :: Threep2742@worldnet.att.net
| "Nature uses only the longest threads to
| weave her patterns, so each small piece
| of her fabric reveals the organization of
| the entire tapestry." -- Richard P. Feynman

0

Share this post


Link to post
Share on other sites
ok first, you can join our mailing list:*

If anyone wants to subscribe to the mailing list then NPCAI-subscribe@egroups.com is the address to send to. The main page for the group is http://www.egroups.com/group/NPCAI/ and to post you send to NPCAI@egroups.com.

second : gosh ! I forgot the children...
That''s not really a problem but this make me think we''ll need to have modular/configurable NPCs.

I think the idea of writing dialogs on screen are optionnal, so the system will propose some kind of dialogs but it''ll be up to the programmer to choose if he wants the dialogs to be visible on screen.

About the idea of the house containing food...
Good idea.
I''ll note that somewhere

Rating the shop and keeping everyone status to each other is something interesting.
And yes something like that is included in the porject.
see : http://www.multimania.com/ingenu/IAModule.txt this text file for more informations on what is or isn''t included

NPC have 5 senses like us real humans.
So they are able to hear any message send near them.
Maybe this message can change his task...
I''ll talk about that in the mailing list.


Please remember the NPC are for a RPG, not a sim''s like game






-* So many things to do, so little time to spend. *-
0

Share this post


Link to post
Share on other sites
My thoughts on basic AI for an RPG are as follows:

Firstly shouldnt everything by based upon Stimuli and associated Responses? Stimuli can be external (man sees a bear), or internal (man becomes hungry).
Each response (corresponding to a stimulus based upon choices) is then broken up into goals. Hunger could be broken up into 3 high level goals. Find Food. Prepare Food. Eat Food.
Find food could then be broken down into sub-goals and so on. Goals would have relationships assigned to them (could be simple AND/OR/XOR operations).
Using this method, goals can be reused for different stimuli.
Plus new associations between Stimuli and responses can be made (based on viewing stimuli and responses from other entities) which creates learning.
And this all lends itself nicely to OOP.

Just a thought.
0

Share this post


Link to post
Share on other sites
That''s the knid of system we are talking about and trying to programm

-* So many things to do, so little time to spend. *-
0

Share this post


Link to post
Share on other sites
yeah, I like that...

"The road of excess leads to the palace of wisdom." --William Blake

"The road of excess also just ends making me tired because I'm too lazy" --Nazrix
0

Share this post


Link to post
Share on other sites
Have you join our mailing list, Nazrix ??
If you don''t already joined us, I hope you will :o)




-* So many things to do, so little time to spend. *-
0

Share this post


Link to post
Share on other sites
Yes, I have

I haven''t had enough time to read all of them though. I should do that.

One idea I had last night for a more non-linear game:

What if we had a need-based system combined w/ a schedule, and the non-linear plots would only happen when NPCs actually come near each other in the world.

So, say one NPC is scripted to murder another NPC at some point of the game. And, the player is then told to avenge the death of the murdered NPC.

....(lame, but simple)....

Instead of this happening at a set point in the plot, it could only happen when the 1st NPC comes in contact w/ the 2nd NPC. And, since we''re using a need-based w/ a schedule, the NPCs would meet at different times each time you play because they''d probably have different needs each time you play. So, they''d find each other at different times.

This could also work with the NPCs exchanging information like dwarfsoft was speaking of. If the 2nd NPC is scripted to tell a confidential secret to another NPC, (and that''s why he gets killed) then he won''t get killed until he finds the NPC to tell the secret. And THAT would happen at different times in the game too. So, it may be a bit chaotic, but it would seem like the NPCs were more alive.



"The road of excess leads to the palace of wisdom." --William Blake

"The road of excess also just ends making me tired because I'm too lazy" --Nazrix
0

Share this post


Link to post
Share on other sites
Nice idea Nazrix and non-linear game devices as a whole are a good concept to avoid stale FFVIII style adventures. However there is the problem that, in a chaotic world, the situation could turn against the intention of the game designers. What happens if, because of a certain series of unlikely but possible events, the NPC''s don''t bump into each other for days? This leads to a fairly long-winded boring episode for the player.
The less constraints placed upon the plot the more chance there is for circumstance to conspire against the designers and lead away from good, tight game play.
On the other hand the more constraints placed upon the game the more linear the plot development and the more likely you are to end up with a scene-by-scene forced storyline.

I think main plot lines should be more directly scripted in terms of player circumstance (where the player is at a given time, not where an NPC is) leaving the non-linearity to minor plot-lines and less consiquential occurences.

From my point of view I''d love to see a world expand based on the intelligences of the NPC''s and what they decide to do at any given time but unless you want the possibility of a meandering experience then you have to have some form of constrained sequencing to the game.

Just my $0.02.

Mike
0

Share this post


Link to post
Share on other sites
Yes, MikeD, good point. An idea like this would have to be compromised a bit. It couldn''t be too far on the side of chaos.

However, the way that I''m envisioning this, the player wouldn''t be simply waiting for the situation where the 2 NPCs come together. If there are a lot of NPCs then the chance of something happening would pretty good. Furthermore, one situation of 2 NPCs coming in contact may trigger a few other plots w/ it which would keep the player busy.



"The road of excess leads to the palace of wisdom." --William Blake

"The road of excess also just ends making me tired because I'm too lazy" --Nazrix
0

Share this post


Link to post
Share on other sites
On the point of chaos avoidance, here''s a suggestion...

What if the computer told the NPCs involved that due to a scripted plot event (ie. a murder needs to happen in the story), they have a certain amount of time to make this "chance meeting" happen.

One NPC could be at the bakery, while the other is on his way to the barber. Although the barber might be on the other side of the town, the second NPC knows that he needs to perform this scripted plot sequence within a certain amount of time, so he makes a detour to walk past the bakery on his way to the barber.
If it has run out of time to perform the plot sequence, he just goes straight to the bakery for no good reason at all, and hopes that the player won''t think this strange.

Either way, upon reaching the bakery, the other NPC senses this and knows that she must perform her part of the plot sequence...

Not sure how this could be implemented, but it''s an idea...

Samah


"...the grave is no bar to my call..." - The Horn Of Valere
0

Share this post


Link to post
Share on other sites
What about a simple new need : "Kill X NPC" in the system ?

It would be easy to add and will give you the expected result.

Just an idea :p

(Since needs are prioritized, you can give it a low priority to have it done sometime in the future, or a high one to have it done in a few minutes )

-* So many things to do, so little time to spend. *-
0

Share this post


Link to post
Share on other sites
You know, I''ve been reading alot of threads like this about realistic NPC interaction. Ultima 7 did it really well without overdoing it. It''s amazing what those guys accomplished with a 80386 processor and 4MB RAM. The Ultimas invented a while ago the kind of NPC realism we''re trying to accomplish.
0

Share this post


Link to post
Share on other sites