Forum

I want to test swarm-like behaviour in Quake some day ...

Discuss Artificial Intelligence and Bot programming.

Moderator: InsideQC Admins

I want to test swarm-like behaviour in Quake some day ...

Postby daemonicky » Thu May 05, 2011 11:43 pm

You can read about swarms on wiki. They can be used to model clouds, flock of birds ... Flocking is pretty interesting http://www.red3d.com/cwr/steer/ , one can model even cars I guess. So I thought that I will try to implement it in Quake, it might be easy ...

I just love how the rules for behaviour are simple. It reminds me of fractal rules, like the one to make Mandelbrot set ...

I wonder if one can use this to make moster AI. It may be used to make brawling like in God Of War http://www.gamasutra.com/view/feature/3 ... awling.php . But its purpose is to model groups not single monsters ...

I am just musing. Maybe someone tried some interesting things with it. If so, how it was?
User avatar
daemonicky
 
Posts: 185
Joined: Wed Apr 13, 2011 1:34 pm

Postby goldenboy » Fri May 06, 2011 6:17 pm

There is a mod that does swarm behaviour in quake. Search idgames2.
User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Postby MauveBib » Wed May 25, 2011 12:04 pm

I made a swarming test mod once too.
Apathy Now!
User avatar
MauveBib
 
Posts: 634
Joined: Thu Nov 04, 2004 1:22 am

Postby tZork » Tue Jun 21, 2011 9:12 pm

Basically what you do push/pull for every member in the group/swarm/flock. I wrote some code for this in nexuiz, heres the relevant part:

Code: Select all
vector steerlib_repell(vector point,float maximal_distance)
{
    float distance;
    vector direction;

    distance = bound(0.001,vlen(self.origin - point),maximal_distance);
    direction = normalize(self.origin - point);

    return  direction * (1-(distance / maximal_distance));
}

vector steerlib_arrive(vector point,float maximal_distance)
{
    float distance;
    vector direction;

    distance = bound(0.001,vlen(self.origin - point),maximal_distance);
    direction = normalize(point - self.origin);
    return  direction * (distance / maximal_distance);
}

.float flock_id;
vector steerlib_flock(float radius, float standoff,float separation_force,float flock_force)
{
    entity flock_member;
    vector push,pull;
    float ccount;

    flock_member = findradius(self.origin,radius);
    while(flock_member)
    {
        if(flock_member != self)
        if(flock_member.flock_id == self.flock_id)
        {
            ++ccount;
            push = push + (steerlib_repell(flock_member.origin,standoff) * separation_force);
            pull = pull + (steerlib_arrive(flock_member.origin + flock_member.velocity,radius) * flock_force);
        }
        flock_member = flock_member.chain;
    }
    return push + (pull* (1 / ccount));
}
tZork
 
Posts: 2
Joined: Tue Jun 21, 2011 8:59 pm


Return to Artificial Intelligence

Who is online

Users browsing this forum: No registered users and 1 guest