Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Building an AI engine


Recommended Posts

Basically I want to do an engine like the tiny chao garden. Has anyone done something like this before? What I want to know is is it possible to have your pet move around the screen at random intervals? Does that make sense?

Link to comment
Share on other sites

Yep I just came back here to edit my post to mention that XD You reply too fast

I was talking about MMF

I know how to make a counter display a random number, I Just need it to display a random number at a random set of time :P

Link to comment
Share on other sites

You could just use a timer countdown.

You would have two counters for this. The first counts down and the second decides what action the chao shall take.

Whenever the first counter's value is 0, it sets the second counter AND itself to a random value. The second counter is set so that a new action can take place. Why is the first set to a random value too though? This counter will count down from its value back to 0, in which a new action can take place again, and by setting it up to a random amount, the chao can actually randomize action at random time intervals!

Here's an example. Let's name the first counter Duration and the second counter Action.

If "Duration" = 0;

Set "Action" to: random( *number of actions here* )

Set "Duration" to: random( 120 ) + 30

If your game runs at 60fps, adding 30 will always have each action last for half a second minimum and the random 120 will allow each action to last roughly 2 seconds max above the minimum.

Always;

Set "Duration" to: "Duration" - 1

I realize it's not EXACTLY Multimedia Fusion 2 syntax, but it should be close enough for you to understand what's going on and be able to adapt it to your own needs. Also remember, setting the duration to your fps is the same as it taking 1 second to count down.

  • Like 1
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...