Jump to content
johnnyboy

JBOY Dog [v1.5 - updated 12/21/2018]

Recommended Posts

14 minutes ago, zagor64bz said:

NOW....ARE YOU SOMETHING OR WHAT????

 

THANK YOU JBoy!!!!

You never end to amaze me. Couples of questions: how far in time scent will last? Will the dog pick up scent from "target" objects?

There is no time limit on the scent currently.   The scent is recorded by creating an invisible object at prey object's position (spacing them out about 20 meters).  The scent objects have these properties:

  • Drop Time (time created, which allows us to know the order to track from oldest to newest)
  • Duration at position (seconds)
  • Prey Object (Unit who is leaving his scent. Could also be an animal)
  • End of Trail Segment flag (if trail segment ends in water or a vehicle).
  • Dropped Object (sometimes prey drops a small object:  water bottle, can, bandage, tool, etc.

For clean up purposes, I delete scent objects as Dog reaches each one.  This means that only one dog team can follow a scent trail, as trail is systematically eliminated by first dog team that follows it.  That should be fine for 95% of use cases I can think of.

 

Regarding "Will the dog pick up scent from "target" objects?":  While tracking (or just heeling), dog will stop what he is doing if he "smells" or senses enemy units within about 50 meters.  Dog stops, looks in direction of threat, and growls.  This indicates to handler that danger is near, so you don't follow your dog into an ambush.

 

The dog does not smell/detect other objects yet (bombs, drugs, etc.).  But that shouldn't be too hard (probably use same logic that detects enemies).  That is for a future release.

 

Thanks for your support and interest Zagor.

 

  • Like 1

Share this post


Link to post
Share on other sites

As objects, I meant, for instance, clothing from target unit. Example: HVT change uniform to go incognito..dog sniff abandon uniform>pick up trail>track...

Anyway..even the way it is is awesome. I have a team of seals ready to track down a bad boy in the jungle in my wip mini campaign. He better be quick,smart and in good shape...or guess who's gonna bite his ass? HAHAHAHA

  • Like 1

Share this post


Link to post
Share on other sites

To start tracking for any scenario, mission designer has to decide who is being tracked and start the DropScent script on that unit.  So in your case, you script DropScent to start at position of abandoned uniform.  The dog will circle the start point where the uniform is and look good for that scenario.  If player is tracker, your story line will lead them to the trail start position.  Dog will pick up scent from there.

 

Note that tracking currently is supported for only player controlled dog, as once dog indicates they have detected scent, player must give "track" command.  If trail ends because of water or vehicle, player must decide where to look next.

 

I hope to automate that for AI trackers in the future like this:

  • AI with dog is moving through waypoints with dog following in "Heel" mode
  • Dog detects scent
  • AI tracker automatically gives "Track" command
  • Dog follows trail, AI Tracker follows dog
  • If dog detects enemy, AI moves in direction of enemy to attack.
  • If trail ends, AI does something
    • executes a search pattern with hopes of crossing scent trail? 
    • If at a river, cross and search for new scent trail?
    • Resume original waypoints?  That is easiest...
    • If other AI units of same side spot tracked unit, they could direct AI dog team to that position to pick up scent trail again

If I code the above, an Escape/Evade type mission would work pretty well.  Just place more than one AI dog team with random waypoints that patrol your mission's AO and an AI dog team will find the player's scent trail eventually.

 

  • Like 3

Share this post


Link to post
Share on other sites

Hi Johnnyboy,

 

Thanks for releasing this script suite.  I was really impressed with the amount of detail in it (and all the random little things like chicken feathers flying about everywhere when the chickens are killed/land).  

 

It's very cool - well done!

 

Also, on a personal note; I'm a pet-person too so I hope you don't mind me saying that JBoy Dog is a fitting tribute to your Boomer  :)

  • Like 6

Share this post


Link to post
Share on other sites
9 hours ago, das attorney said:

Hi Johnnyboy,

 

Thanks for releasing this script suite.  I was really impressed with the amount of detail in it (and all the random little things like chicken feathers flying about everywhere when the chickens are killed/land).  

 

It's very cool - well done!

 

Also, on a personal note; I'm a pet-person too so I hope you don't mind me saying that JBoy Dog is a fitting tribute to your Boomer  :)

Thanks DA!  And I totally appreciate your sentiment regarding our 4 Legged Friends.  Have a great holiday and New Year buddy.

  • Like 2

Share this post


Link to post
Share on other sites

JBOY Dog Version 1.2 Released!  Get download link at original post.  The original Altis demo mission is now updated with the latest features shown off in the version 1.2 video on Tanoa.

  • Tracking
    • Dogs pick up a scent trail and follow it.
    • Scent trails end when tracked units cross water or get in vehicles.  Trails begin again when tracked unit exits water or vehicles.
    • Via barking, whining and growling, dogs indicate to player if they have found a scent trail, if trail has ended, or if enemy is near.
  • Swimming
    • Dogs follow handler in Heel mode and swim (fixes arma problem where vanilla dogs walk underwater on seabed)
  • SITREP command:  Dog barks once when given this command.  This helps know where your dog is in the dense jungle.

Credits:

  • Nomisum:  I borrowed some code snippets and ideas for using arrow helper objects as a scent trail to track.  Thanks man!
  • Grumpy Old Dude:  For help with the smashed grass trail.
  • Like 8

Share this post


Link to post
Share on other sites

If only this can be a standalone mod so we can add it to any mission via spawn, that would be awesome. Keep up the great work JB!

  • Like 3

Share this post


Link to post
Share on other sites
8 minutes ago, Valken said:

If only this can be a standalone mod so we can add it to any mission via spawn, that would be awesome. Keep up the great work JB!

Nope.....script is fine for me...:thumb:

  • Like 2

Share this post


Link to post
Share on other sites
On 05/11/2016 at 0:59 AM, johnnyboy said:

This script can be used on any map, but its up to a mission designer (anyone using the editor) to take my sample code and add it to a  mission.  Its not a mod that magically works in any mission.

 

Is there any interest or future plan to build this out into a @JBOY_Dog mod, or do you intend to keep it script-only?

 

Looks really good.

Share this post


Link to post
Share on other sites

Hi JB,

 

I read you were having lots of problems trying to get AI to shoot the doggies and found something that worked really well so I thought I'd share if useful.

 

I was trying the "B_TargetSoldier" for example, but none of the (opfor) AI wanted to shoot it and then realised you need to "crew" it (as it's a vehicle).  So if you do something like this, then the AI natively shoot at the target without any further scripting:

 

_thing = createVehicle ["B_TargetSoldier",player modelToWorld [0,3,3],[],0,"can_collide"];
createVehicleCrew _thing;
_thing attachTo [NAME_OF_YOUR_DOGGY,[0,0,0.25]];

 

Hope that helps (unless you knew that already)  :)

 

(random dog clip)

 

 

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, das attorney said:

Hi JB,

 

I read you were having lots of problems trying to get AI to shoot the doggies and found something that worked really well so I thought I'd share if useful.

 

I was trying the "B_TargetSoldier" for example, but none of the (opfor) AI wanted to shoot it and then realised you need to "crew" it (as it's a vehicle).  So if you do something like this, then the AI natively shoot at the target without any further scripting:

 


_thing = createVehicle ["B_TargetSoldier",player modelToWorld [0,3,3],[],0,"can_collide"];
createVehicleCrew _thing;
_thing attachTo [NAME_OF_YOUR_DOGGY,[0,0,0.25]];

 

Hope that helps (unless you knew that already)  :)

 

Hey Das Attorney, that may help alot!  How would I ever think to freakin' crew the freakin' target????   I attached these targets to the dogs, plus tried making real AI units invisible and attaching them, and a million other things.  When my attention gets back to the dog, I'll give it a whirl...it will probably make it much better.  However, my AI is able to kill dogs now...especially if they have an automatic weapon.  But it could still use improving (they suck at engaging dogs at distance, and jerk around alot).

 

Thanks dude!

 

Plus, I love Max's dog and love that movie.  My favorite dog scene was when he had a stick in his mouth, with string tied to it and sawed off trigger, and sawed off pointed at dude in back seat.  Then the dog sees a rabbit in the desert and glances at it.   Priceless.  Queensland Healer may be my next RL dog.  

  • Like 3

Share this post


Link to post
Share on other sites
7 minutes ago, johnnyboy said:

Plus, I love Max's dog and love that movie.  My favorite dog scene was when he had a stick in his mouth, with string tied to it and sawed off trigger, and sawed off pointed at dude in back seat.  Then the dog sees a rabbit in the desert and glances at it.   Priceless.  Queensland Healer may be my next RL dog.  

I LOVE MAD MAX!!!! It started the post-apocalyptic movies trend....epic!

 PS: Queensland Healer are :icon_dj:

  • Like 2

Share this post


Link to post
Share on other sites

I know man, it's really weird.

 

The AI used to be able to attack objects if you set the config parameter "side" to something they hate, but I think BI streamlined it so that AI don't loop through potentially hundreds of possible targets to find something to kill.  The other day it was pissing me off as I didn't know why all my stuff had broke so I went through the configs and checked the "nearTargets" script command for stuff they should have shot and then looked at the Target configs.  I think this is why:

 

class TargetSoldierBase : StaticWeapon {
    author = "Bohemia Interactive";
    mapSize = 1.78;
    _generalMacro = "TargetSoldierBase";
    scope = 0;
    scopeCurator = 0;
    displayName = "Invisible Target Soldier";
    model = "\A3\Structures_F\Training\InvisibleTarget_F.p3d";
    editorSubcategory = "EdSubcat_Targets";
    vehicleClass = "Training";
    cost = 200000;
    accuracy = 0.05;
    destrType = "DestructNo";
    side = 5;
    alwaysTarget = 1;
    armor = 3;
    type = 0;
    class Turrets {
        class MainTurret : NewTurret {
            body = "";
            gun = "";
        };
    };
};
class B_TargetSoldier : TargetSoldierBase {
    author = "Bohemia Interactive";
    class SimpleObject {
        animate[] = {};
        hide[] = {"zasleh"};
        verticalOffset = 0;
    };
    _generalMacro = "B_TargetSoldier";
    scope = 1;
    scopeCurator = 0;
    crew = "B_UAV_AI";
    typicalCargo[] = {"B_UAV_AI"};
    side = 1;
    faction = "BLU_F";
};

 

 

So the base class is derived from "StaticWeapon", and then you can see from the "B_TargetSoldier" that it has a crew entry.  So by spawning the "staticWeapon", they see it as CIV, even though the "side" is 5 (which is ENEMY - everyone hates it).  But then you crew it with the UAV AI and then it becomes BLUFOR so they shoot it.  Bizarre but it seems to work.

 

What was confusing me is there's still some classes you can define as BLUFOR or OPFOR etc in config and the appropriate side will shoot it.  (I defined some tents as BLUFOR and OPFOR would shoot at them for example).  I think maybe it is because the tents are derived from "static" class and the targets are derived from "AllVehicles" which may have different properties for the purposes of recognition.

 

Anyway, see how you get on with it (hope it helps though man)  :)

 

PS - Yes Mad Max 2 was freaking awesomesauce!  I liked the weirdness of the bad guys, with hockey-face burnt-head man and his strange gimpish lackeys!

  • Like 1

Share this post


Link to post
Share on other sites

For one of my WIP mission, I needed Boomer to be paradropped after some event.....

LOL...this is what I come up with:

 

  • Like 2

Share this post


Link to post
Share on other sites

ok..I FEEL DUMB RIGHT NOW...

 

I got it working in a mission, with the escapee leaving the scent trail and whatnot....BUT:

How do I hide the blue arrow pointer trail he's leaving behind?:rofl:

Share this post


Link to post
Share on other sites

Ha-ha.  Who needs a dog to track when there is  a trail of huge blue arrows to follow?

 

Make sure this is set to False in the init.sqf:

JBOY_DEBUG = False;

That should hide the arrows.

  • Like 1

Share this post


Link to post
Share on other sites

Damn...I feel even MORE dumb right now..it was there in plain view!!! Thank you Jboy!

Share this post


Link to post
Share on other sites
On 1/9/2017 at 2:00 PM, zagor64bz said:

For one of my WIP mission, I needed Boomer to be paradropped after some event.....

LOL...this is what I come up with:

Skip to around 2 mins for parachuting dog. Don't think I have the code still but will take a look

 

  • Like 2

Share this post


Link to post
Share on other sites

Sweet!  Dog might be a little freaked out by the time he hits the ground...  See if you can find that code.  Zagor was trying attaching the dog to parachutes but had trouble with it, so compromised on dropping him in a crate.

  • Like 1

Share this post


Link to post
Share on other sites
1 minute ago, johnnyboy said:

Sweet!  Dog might be a little freaked out by the time he hits the ground...  See if you can find that code.  Zagor was trying attaching the dog to parachutes but had trouble with it, so compromised on dropping him in a crate.

Yap..I was able to attach it to a chute, but it will not descent down smoothly. It stay at a certain altitude and then staggering down a little.Rinse and repeat.I knda like now the "special delivery crate" that barks at you as you get close..hahahahahha

  • Like 1

Share this post


Link to post
Share on other sites

Found it! This is straight copied from my messy testing code so obviously requires some work.

@zagor64bz I kind of like the crate as well.

act7 = player addAction ["		Dog Out",
{												
	player removeAction act7;
	detach dogVeh;
	if ((getPos dogVeh select 2) > 100) then
	{
		dogVeh allowDammage false;
		dogveh switchmove "Dog_Stop";
		sleep 3;
		_chute = createVehicle 
		[
			"NonSteerable_Parachute_F", 
			position dogVeh, [], 0, "CAN_COLLIDE"
		];
		_chute setPos getPos dogVeh;
		dogVeh attachTo [_chute,[0,-0.1,0.2]]; 
		if ((getPos dogVeh select 2) < 5) then
		{	detach _chute;
			dogVeh allowDammage true;
			dogVeh enableAI "MOVE";
			dogVeh enableAI "ANIM";
			dogVeh enableAI "FSM";
			dogVeh enableAI "target";
		}; 
	}
	else
	{
		dogVeh enableAI "MOVE";
		dogVeh enableAI "ANIM";
		dogVeh enableAI "FSM";
		dogVeh enableAI "target";
	};
},"",0.02,false,false];	

 

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×