Advertisement

Im God

Started by July 09, 2002 04:51 PM
19 comments, last by ImMortal Soulz 22 years, 7 months ago
My idea Ok the idea came from playing rpgs were the smithy stays at the job 24/7 no food or water and everyone else walks back and forth from point a to b so i was thinking that if you came up with diff reactions to the diff actions and behavior (like to eat you need money-for money you need a job so you can go to the store and buy it...etc) but i dont have a clue where to begin and have little time to think about it and/or work on it so if any one knows of a gooing plan for a project in this area ited be helpfull Thx Sorry i cant spell so therefore i dont try unless i have to The best RPG has yet to come into being (only ''cause I cant do it all [edited by - ImMortal Soulz on July 9, 2002 6:14:22 PM]
The best RPG has yet to come into being (only ''cause I cant do it all :)
quote:
Original post by ImMortal Soulz
...
The best RPG has yet to come into being (only ''cause I cant do it all

Wrong, the best RPG is Real Life(tm) =-)
All we need is for those quantum processors IBM is working on to come out so we can turn it into the best CRPG =-)
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
Advertisement
Well, I''m no AI expert, but for what you want all you really need is a timer, a rand() function (assuming C/C++), and a State Machine.

If your unfamilure with state machine''s look into them, they make quite a few game programming problems easier to manage, plus they are very easy to implement.

I''ll use your smithy example, throw in rand()''s wherever you want to give a more "human" look.

Smithy starts his day sleeping (state == SMITHY_SLEEPING)
At 8:00am he gets up and walks around his room, to look like he is getting ready for work (state == SMITHY_MORNING)
After a certain amount of time (random or preset) he leaves for work (or breakfast) (state is changed to SMITHY_TO_WORK)
In this state he should walk one of several set paths to either his job or a place for food.

Once he gets to work change his state to SMITHY_WORKING
If you want to get slick, set a break (as in lunch time) variable that decraments every tick that will count down till it is time to go to lunch then change state to SMITHY_LUNCH. You can even decrament the variable more if he has to work harder, that way the harder he works the sooner he goes to lunch and the more often he will break.

I think you get the idea, you break up each set up actions into a state, then define the actions in the state. Thats all. Here some psudocode (spelling?)

update_smithy(int nState)
{
switch(nState)
case SMITHY_SLEEPING:
if( it''s after 8am)
SetState(SMITHY_MORNING);
break;
case SMITHY_MORNING:
do_morning_stuff();
break;
.
.
.


you get the idea....I hope.



Jason Mickela
ICQ : 873518
Excuse my speling.

The V-Town Have-Nots
"The paths of glory lead but to the grave." - Thomas GrayMy Stupid BlogMy Online Photo Gallery
This was actually done very well in the 80s with one of the Ultimas... I believe it was 4 or 5. All of the townspeople had schedules that they followed involving sleep, work, eating at the pub, etc.

Dave Mark
President and Lead Designer
Intrinsic Algorithm Development

"Reducing the world to mathematical equations!"

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Not to mention "The Legend of Zelda: Majora''s Mask" (though not an RPG, the concept you are talking about is used).

--------------------
Matthew Calabrese
Realtime 3D Orchestra:
Programmer, Composer,
and 3D Artist/Animator
"I can see the music..."






The mentioned state machine would look better, but it is still simply scripted, as you say "STATE_MORNING" at 7:00 am, and so on.

I would *LOVE* to see a game where the smithy wakes in the morning, notices he''s hungry, tries to get some food, then takes care for his shop. And this UNSCRIPTED, please.

It surly still would need some kind of script, simply to tell when it is morning and so, but keep it more general.
Perhaps a fuzzy state machine would do well...
(Fuzzy State Machines are described in Game Programming Gems 2, if I am wrong it was 1).
-----The scheduled downtime is omitted cause of technical problems.
Advertisement
Well, considering The Sims is dedicated to this sort of emotional and physiological stuff, and considering The Sims can''t do much else at the same time, that might be a tall order to do in an RPG.

Dave Mark
President and Lead Designer
Intrinsic Algorithm Development

"Reducing the world to mathematical equations!"

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

quote:
Original post by OmniBrain
The mentioned state machine would look better, but it is still simply scripted, as you say "STATE_MORNING" at 7:00 am, and so on.

I would *LOVE* to see a game where the smithy wakes in the morning, notices he''s hungry, tries to get some food, then takes care for his shop. And this UNSCRIPTED, please.

It surly still would need some kind of script, simply to tell when it is morning and so, but keep it more general.
Perhaps a fuzzy state machine would do well...
(Fuzzy State Machines are described in Game Programming Gems 2, if I am wrong it was 1).









Eh, why replace a simple-to-program script with hard-and-tedious-to-program AI? It doesn''t seem like it would make much of a difference from the player''s POV.



Don''t listen to me. I''ve had too much coffee.
the trick to hreat ai in a game is to only make it appear their is great and dynamic ai. if the focus of the game is not to watch some ppl go through their daily routine, then attempting to use complex algorithms with expensive math ops is silly.

ai in its simplest form is a large varible scripted system of reactions to a cause.

time= 7:00am +- someRandTime then smithy gets up.
if smithy hungry then go eat
smithy is hungry is hunger level is above a certain threshold
this vaule increase over time when smithy is not eating
even faster if doing labour
if food store is close to empty then smithy goes to market
if smithy buys enough food for x meals a day for x days
if smithy does not have enouhg money for that he reduces the amount he buys so he can afford it
smithy sells completed works (ie weapons, etc)
ppl go to smothy to buy items.
items sold increase smithy's money level
smithy only leaves the store when it is closed
if smithys hunger level is very high and food store very low, then close shop early to buy food
blah blah blah

you see? no matter how you look at it, most ai will become a state machine. even if it is a complex one. what you want is quite difficult to do purly via ai, instead you have scripts that are run for particular events. having some fancy ai in which smith has to even find the store is going a bit overboard when the player will see it a few times and go somewhere else.

everyone praises gta3 for its city simulation. the "simulation" is actually quite simple. only deal with cars on the screen. cars can come from offscreen to onscreen, but the idea is that if the player cant see the car, why bother handling ai for it.

EDIT: to genralize, chencge smithy to "some genric npc" and change specific job stuff to "generic npc work", etc.



[edited by - a person on July 10, 2002 1:45:42 PM]
Also, keep in mind that people don''t buy games for the NPCs.
Haveing townspeople that act "real" is nice, but if you notice, very few retail RPG games even worry about this.

You could probably even get away with running a whole town on a clock, so everyone does the same thing at the same time every day.

How''s the player going to know, they don''t have an in game watch (do they?). Plus, if they are watching the NPCs for several days str8 then there is something wrong with your game.

Although it would be funny to watch smithy walk all over town trying to find somewhere to go eat if everything is closed.
HE would even close shop and not work because of it.

Jason Mickela
ICQ : 873518
Excuse my speling.

The V-Town Have-Nots
"The paths of glory lead but to the grave." - Thomas GrayMy Stupid BlogMy Online Photo Gallery

This topic is closed to new replies.

Advertisement