Home   Help Search Login Register  

Author Topic: Tracking  (Read 1099 times)

0 Members and 2 Guests are viewing this topic.

Offline Pathy

  • Former Staff
  • ****
  • I'm not a F***in llama!
    • Volcbat.
Tracking
« on: 02 Feb 2004, 11:13:36 »
How plausable is it to make a realistic tracking script. Im talking, the ability of AI to "hunt" a player, follow his trail, but also the ability of the player to evade them (ie the tracking script doesnt automatically just guide the AI to the player, they instead follow the path of a player.)

Im thinking, maybe something to do with markers. Would it be possible to create markers at the players location every, say, minute, these markers dissapear after say, 10 minutes. The ai follows the markers, in order, and when it reaches one, thats deleted and goes onto the next one.

But id also like something more advanced than that, the AI predicting the players path and trying to cut them off, ect.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Tracking
« Reply #1 on: 02 Feb 2004, 12:07:49 »
Footprints (both left and right) are available in Kegetys editor addon ... not sure if they explicit objects available in the mission editor, but general barron's new editor addon certainly makes them so.    You could write a script that made the quarry leave a permant footprint every now and then.    The quarry would be able to leave false trails, and could leave them facing in the wrong direction by walking backwards.

Footprints made by a unit in the game fade after a few seconds, so permantent ones must have been made by the quarry.

To make the AI follow them you'll need something more complicated.    If the AI get close to a footprint give them a probablilty of spotting it and random time while they look at it and then a probability of interpreting it correctly and setting off in the right direction.

Predictive stuff is going to be much harder.   I'd fake it by giving them a small probability of "super-interpret".  Instead of interpreting the footprint correctly and setting off in the direction of the next footprint, they make a correct prediction and set off directly for the most recent footprint made by the player.   Or even the player's ultimate destination, for example his exfil point.

So in your "found footprint" script you'd have something like (this is not a script, its just a sketch)

_rand = random 10

? 0 < _rand < 1: hunter1 Move getpos player
?1 <= _rand < 2:  hunter1 move getmarkerpos "exfil"
? 2 <= _rand < 3: start script that makes huntergroup mill around for a bit then set off in a random direction and then a bit later brings them back to this or another footprint so that they can get back on the player's trail
? 3 <= _rand <= 10: hunter1 move getpos next footprint
Plenty of reviewed ArmA missions for you to play

Offline Pathy

  • Former Staff
  • ****
  • I'm not a F***in llama!
    • Volcbat.
Re:Tracking
« Reply #2 on: 02 Feb 2004, 14:56:22 »
Cheers man, thats some very useful imput. Ill look into it further, im pretty much one of those noobs with almost no scripting ability but alot of ideas  ;)

Well, thats not entirely true, i know enough to understand whats possible and whats not :D but not enough to DO it without alot of help :)

Ahh well, if i get this working, plenty of good E&E missions will be possible 8)

deaddog

  • Guest
Re:Tracking
« Reply #3 on: 02 Feb 2004, 15:29:12 »
I don't think you need specific objects to be placed.  You can have a global array which stores the quarry's locations.  Basically, you have one script which monitors the quarry, every time they move 20 or so meters you can add their location and maybe direction to the array.  The lowest entries, and thus the oldest, will be where the quarry starts.

The tracking script will look at this array and make its decisions about where to look for the next "footprint" (array entry).

It would be nice if you could determine the different types of terrain the quarry is walking on.  Obviously, walking on rocks would not leave a footprint, which could throw off the pursuit.  You could do this by placing triggers over the rocky areas and doing a simple "(leader groupname) in list triggername".  If he is in the trigger then don't update the array.

You could do the path prediction based on the last 5-10 values in the array, using linear regression or something like that.

If the tracking group loses the trail then you could have the units fan out for a couple of hundred meters.  If one gets near one of the locations stored in the array (not one they have already been to), then the rest of the group joins him and they start tracking again.

Just some thoughts.  I think it can get rather complicated but might be worth it.

Offline Pathy

  • Former Staff
  • ****
  • I'm not a F***in llama!
    • Volcbat.
Re:Tracking
« Reply #4 on: 02 Feb 2004, 16:03:52 »
Linear Regression  ;D Yum.
Ill have to crack out my AS level maths book :) i gave it up for a reason though. (though i did get 70% in my pure 1 paper,i just did shit in mechanics and statistics :P).

So do you think array entries should be created at timed intervals, or vary on the terrain type (ie, on rocky ground, you only leave a few footprints, on sand, you leave one every 2 or 3 seconds)? It'd be good from a players POV to create the footprint objects, that way the player could hunt AI. Might quickly meet object limitations or get laggy though.

So, to sum up so far. A script that tracks the players (or selected units) movements, records them in a global array. The hunters have a random chance to spot the footprints, if not, they carry on searching.....this is where i start thinking "what now"......

Im going to have to sit down and have a long big think about what can be achieved by this and how to achieve it.

The imputs are great though, it really seems its possible.

Offline Pathy

  • Former Staff
  • ****
  • I'm not a F***in llama!
    • Volcbat.
Re:Tracking
« Reply #5 on: 02 Feb 2004, 16:11:25 »
Just another thought, the player could have the option to lay booby traps....you know, like, leave abit of equipment, which would trigger a grenade when disturbed.....you could have it in the action menu, if the AI detects it, it will investigate it, with a random chance it will set it off. Either way, it will delay or incapacitate the pursuers.

deaddog

  • Guest
Re:Tracking
« Reply #6 on: 02 Feb 2004, 16:13:43 »
I think the entries should be base on distance moved, not time.  The script will wait around until the group has moved a set distance from the last recorded position.

If you have the player's group do the hunting then you don't need a tracking script at all :)  That is just for the AI.  The footprints would be the only way the player has to track the enemy (although blood splats would work, too).

The best way to proceed on the tracking script algorithm would be to find out how you (yes, you :) ) would follow someone.  What would you do to find the next footprint?  What would you do if you lose the trail?  etc, etc.

Don't ask me how to actually do the linear regression.  I'm not even sure that would be the right thing anyway, just guessing  ;D

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Tracking
« Reply #7 on: 02 Feb 2004, 16:36:13 »
Linear regression would be as good a way as any for the predictive part.   Don't ask me to do it, obviously, but it's not that difficult.    

I agree it should be on distance.  That will help prevent lag.

Forget about booby traps for the time being.  Adding those on at the end will be easy.  

Your best plan now is to start working on some of the individual bits (one script that lays footprints, another that detects them and works out their orientation) and see if you can get them to work.    Then try and get a really basic tracking script to hang together.  The fancy stuff - prediction, terrain types, booby traps, etc. - can be added later.
Plenty of reviewed ArmA missions for you to play

Offline Chris Death

  • Former Staff
  • ****
  • Finally Death's gonna get ya
    • OFPEC
Re:Tracking
« Reply #8 on: 02 Feb 2004, 17:08:19 »
Only one thing that could make a problem, when calculating
the possible route of the player;

You need to take care about the terrain.

Else it could happen that AI expects the player to appear
somewhere, in the water or elsewhere, where no man would
ever put his feet onto.

Imagine tanks that are trying to climb up a 70 degree slope,
because they expect the player to be there next. It would
become nearly impossible for them, and even tho it could
look very stupid for other players, watching that scenery.

:edit - soz - just saw that Pathy already mentioned the terrain
aspect above  :D

~S~ CD
« Last Edit: 02 Feb 2004, 17:09:45 by Chris Death »
Dont argue with idiots....they will bring you down to their level and beat you there with experience.

How to use Waypoint type Scripted

Offline Pathy

  • Former Staff
  • ****
  • I'm not a F***in llama!
    • Volcbat.
Re:Tracking
« Reply #9 on: 03 Feb 2004, 18:18:12 »
Ok, ill use this thread to update/ report any problems i encounter.....it could get quite long..... :o

Oh and, tanks probably...no, definately...wont be involved....hard to track in a tank!
« Last Edit: 03 Feb 2004, 18:19:51 by Pathy »