Rob gave me this though, and it did give me hope...
We virtualize a single Update function, along with a couple virtuals for rendering info, physics info, sound info and such...Code:class TrollMonster
{
public:
virtual void Update()
{
if (daylight)
TurnToStone(); // This function is ONLY specific to Trolls and doesn't exist in the base Monster class!
else if (feel_like_dancing)
{
DoTrollDanceOfTrolls();
}
else
DoSomeOtherTrollStuff();
}
protected:
void TurnToStone()
{
// Code to turn trolls to stone
}
void DoTrollDanceOfTrolls()
{
// Code to make troll dance
}
void DoSomeOtherTrollStuff()
{
// Troll stuff
}
};
Basically, the AI is handled in the Update function, or you could add to the virtualizedupdate function based on an AI engine...
We just throw an Update into a loop checking if the new Monster1 exists, if it doesnt, loop ends, no more updating for that monster and monster1 is unregistered and deleted...
I believe this is it what we're trying to do.