[project1dev] Re: Project1 - SVN Update 397

  • From: Alan Wolfe <alan.wolfe@xxxxxxxxx>
  • To: project1dev@xxxxxxxxxxxxx
  • Date: Fri, 24 Jul 2009 11:01:52 -0700

In fact, depending on how things go, we might make the state logic stuff be
built into mobs so you can easily define states and requirements for them
being able to enter different states and the game engine handles all that
stuff under the hood, and just calls the mob functions defined.

not sure yet though since we are still just playin around with that stuff
obviously hehe :P
On Fri, Jul 24, 2009 at 10:59 AM, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:

> hey kent
>
> you can do it however you want but you should seriously consider doing
> state based logic.
>
> ie have a "CurrentState" variable to keep track of the current state, and
> in your tick do seperate logic based on what CurrentState is.
>
> the logic might work like this (for example)
>
> ==Wander (starting behavior)==
>
> Walk in a direction for 0.5 to 2 seconds.
> If near the player during any of this time, have a 25% chance to enter
> MeowLook state
> if near another cat during any of this time, have a 25% chance to enter
> the Playing state
> if you reach the end of the wander timer, there is a 33% chance to enter
> the Cleaning state, else start the Wander state again
>
> ==MeowLook==
>
> Orient the cat towards the player, play the animation of the cat sitting
> down and meowing.  play mew sound effect at correct position in animation
>
> After animation is finished, enter the wander state
>
> ==Playing==
>
> for 1-3 seconds, face the other cat and hop around.  When finished, enter
> the wander state.
>
> ==Cleaning==
>
> Play the animation of the cat getting ready to start cleaning itself.  For
> 5-10 seconds, play the cat cleaning itself animation.
>
> When done, enter the wander state
>
> ===================================
>
> see how that works?
>
> it's a pretty simple state machine but thats how basically i envision our
> NPCs and other AI working.
>
> With AI they might have their own variables (such as how afraid, how
> confident, how drunk etc they are) and those will influence what states they
> can or can't enter or how often they enter them, but the above shows the
> basic idea.
>
> On Fri, Jul 24, 2009 at 10:44 AM, Apache User <
> dhapache@xxxxxxxxxxxxxxxxxxx> wrote:
>
>> User:korgath
>>
>> Message: updated kitties. they now run away slower. they now walk around a
>> little slower too. the kitties now only face the player when hes close.
>> otherwise they sort of look wherever.
>>
>> I plan on updating them to face the direction they are walking and maybe
>> having them pause so they dont wander all the time
>>
>> Alan - I increased the play range to show you what I'm talking about
>> sometimes the kitties dont bounce with each other.
>>
>> <Files Changed>
>> U   Scripts/Enemies/kitty.lua
>> U   Scripts/Personal/Kent/kenttest.lua
>>
>>
>>
>

Other related posts: