Short Bot Note

Need some nice Mods? Here, you are right!
User avatar
papercoffee
Godlike
Posts: 9631
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: Short Bot Note

Post by papercoffee » Mon Nov 09, 2015 11:12 am

Ok... I'll give this a try now. Expect to get noob questions.

Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: Short Bot Note

Post by Spectra » Sun Nov 22, 2015 3:01 pm

So I added some extra lines to MBotv2 to make them translocate at Control Points without using any custom NavigationPoint(s). But is there any way to make them translocate while they are running??
They first stop, switch to translocator and translocate in same way like they translocate between LiftExit and TranslocDest/TranslocStart.

Image

User avatar
sektor2111
Godlike
Posts: 4547
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Short Bot Note

Post by sektor2111 » Sun Nov 22, 2015 3:17 pm

Let's see how things goes:
- technically when Bot-Pawn is moving there isn't too much code called except moving and looping an animation. Aditional things are sudden slapped into pawn (bump, SeenPlayer, HearNoise);
- PickDestination code does things more or less nasty when pawn reaches to a destination point (NavigationPoint) in order too decide next Step. While they moving they won't take more things in account.

You might screw this running movement in 2 ways:
- Spawn an actor at start of first MBotv2 life and manage things by pushing externally - NsDM3 does this and that's why I'm not using too much Bot code - simply they hunt and strafe using T-loc while they run if enemy has been encountered;
- Screw Moving by adding functions called - then... you might deliver small lags in movement. There is work to do in order to prevent nasty animations occuring.

You can try many things. My goal was to clean console and some null retarded things of default Bot, example:
- Ability to bring flag home after game Ended in those small cubes;
- Too busy with items in several Levels and no hunting player + other players type (monsters, etc.);
- Missing sanity from a lot of states/functions;

If you have more interesting tweaks I'll be glad to known them.
I have updated package because of another random issue (rare but still happened) - state tacticalmove - PickRegDestination - sequence added <if (Weapon != None)>. Was probably trigered in fight too early - weapon was getting late...

Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: Short Bot Note

Post by Spectra » Wed Nov 25, 2015 2:11 pm

Ok, after taking a close look, they do translocate while running but very rarely.

Well, not really a interesting tweak, but they often duck or even walk and fire.
Thank God, WalkingSpeed variable was already there!
Spoiler
Show
Image

Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: Short Bot Note

Post by Spectra » Fri Nov 27, 2015 5:25 pm

Also the sounds importing problem is solved. So I simply removed the "Sounds" folder.

User avatar
sektor2111
Godlike
Posts: 4547
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Short Bot Note

Post by sektor2111 » Fri Nov 27, 2015 7:37 pm

Rocky wrote:Also the sounds importing problem is solved. So I simply removed the "Sounds" folder.
I'm not sure what you did but let's see what I had in first version. Bots were functional but I did not heard any of native sounds (jump, die, fall, etc.), I have reimported separate as stand-alone sounds just because they were muted. Each time at recompiling I had to drop them in Editor and rewrite default properties - I don't know why they did not work. So because I got them out of stock, were always functional audible. That's all with those sounds. If you get rid of them in next compilation you might see them muted - then see what you have messed. It's more wise to move them as backup rather than deleting.

Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: Short Bot Note

Post by Spectra » Sat Nov 28, 2015 12:18 pm

It's more wise to move them as backup rather than deleting.
Removed in the sense that I did Cut-Paste the folder and moved to "Backup" folder, so that I can retrieve it back whenever I want.
Even if I delete the folder, then also I have whole package of MBotv1 which you gave and that I can simply copy and paste it back!
I'm not sure what you did but let's see what I had in first version. Bots were functional but I did not heard any of native sounds (jump, die, fall, etc.), I have reimported separate as stand-alone sounds just because they were muted. Each time at recompiling I had to drop them in Editor and rewrite default properties - I don't know why they did not work. So because I got them out of stock, were always functional audible. That's all with those sounds. If you get rid of them in next compilation you might see them muted - then see what you have messed.
I can show you how I fixed the problem, but my UT is in external HDD and my brother took it for a day.

User avatar
sektor2111
Godlike
Posts: 4547
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Short Bot Note

Post by sektor2111 » Sat Dec 12, 2015 6:28 pm

To not forget something.

At a moment in state Hunting Bot was doing some stupid things (which of course I don't like).

Let's say it was trying to reach directly at enemy with any matter (even through some nasty obstructions).
What I don't like at all and I have removed them without to see issues:

Code: Select all

.....
//ClearPaths(); //this one I think is bullshitting everything
		MoveTarget = FindPathTo(Enemy.Location+vect(0,0,-5)); //See something...
		if ( MoveTarget != None )
		{
//			log( Self.GetHumanName()$" > I found a path to enemy "$Enemy.GetHumanName() );
			return; //If tracking a path normally is possible then use THAT WAY
		}
		if ( FindBestPathToward(Enemy, false) ) //Changed to False ... no comment. This one doesn't amazes me.
			return;
....
So I have done modifications in PickDestination from state Hunting as long as running in walls is not a "feature".

Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: Short Bot Note

Post by Spectra » Mon Dec 21, 2015 4:49 pm

For a moment, MBotv2 sometimes by mistake fires two transloc modules at a same time, when translocating to control points.
This is kinda annoying.

Looks like I will have to remove those codes.

Besides, I have a list of dumb questions as follows:
1. What is the difference between PickDestination and PickRegDestination in state TacticalMove??
2. What is the difference between MoveTarget, RoamTarget and OrderObject??
3. What is Bump??
4. What does state StakeOut does?
5. What is RouteCache??

User avatar
sektor2111
Godlike
Posts: 4547
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Short Bot Note

Post by sektor2111 » Mon Dec 21, 2015 6:05 pm

Rocky wrote:Besides, I have a list of dumb questions as follows:
1. What is the difference between PickDestination and PickRegDestination in state TacticalMove??
2. What is the difference between MoveTarget, RoamTarget and OrderObject??
3. What is Bump??
4. What does state StakeOut does?
5. What is RouteCache??
First of all I'm totally appreciating that you are interested in improvements. At first look things might be a bit harder but they aren't really rocket science.
PickDestination (based on my understanding) gets called when pawn has reached into a point (NavigationPoint) and will sort a new (nextPoint or whatever) new destination.
PickRegDestination if I'm not mistaking get called often in combat as a direction for combat moves depending on place - visibility to environment/enemy/safe spot, ect - gotta check it in detail for more explanations.
MoveTarget - obviously this is a NavigationPoint or a keypoint - usually is an actor which isn't blocking pawn but has a purpose: NavigationPoint - reaching here we want next direction. KeyPoint - mission related, Trigger - engaged according to some "push" rules or even when SpeciaHandling gets called (handle lifts/door, impacthammer, translocator, ect).
RoamTarget - mainly roamtarget in 1on1 DM is supposed to be PlayerPawn if too many armors aren't bullshiting game-goal - killing opponent - yes, we speak about PlayerPawn purposedly (which I screwed because I think is a dumb policy).
In other case this actor RoamTarget can be a random InventorySpot sorted by PickDestination. As long as pawn did not touched that goal will track paths to that actor.
OrderObject - this actor can be PlayerPawn if the man/woman ordered Bot - CoverMe - My mistake I forgot to add that in verbosing tech. Also OrderObject can be a NavigationPoint if Order is "Defend" and pawn is looking for a proper spot
for defence. OrderObject can spawn if Bot is ordered "Hold This Position" is a keypoint spawned when human ordered bot and Bot will find path to that location taking a defence position.
Bump - This function gets called when some actor colliding and blocking actors is touching Bot or when Bot is touching that thing while is roaming around or doing whatever action. I used this to ruin that BlockMonsters crap out, ONLY when it mocks Bot's Navigation by directly blocking. Result, if default Bot won't pass here ever, this Bot will pass like this obstruction never been there.
StakeOut - this state gets called when Bot cannot see any more an enemy which was previously engaged in combat with him. This state can be stopped in games where mission is important. Simply logic: if enemy is hidding - attack objective and win, do not wait to see him or hunt him because that freak is not an objective in our game (see Assault)
RouteCache - well, these are NavigationPoint-s (I'm not sure if anything else will ever be a RouteCache). These are 16 pieces of road leading to a destination (InventorySpot, Keypoint, Flag, etc.). Pawn has 16 points - (I think) in order to process finding a path to a goal faster - speed up native navigation process - once established the road is easy to deliver next Point using next RouteCache. Here I have hacked things in purpose to gain a translocation in a good range getting over 2 or 3 points because I don't see reasons to not use translocator if this is possible - randomly - with default travel between too much closer 2 PathNodes is wasting time and is always a predictable target as long as default Navigation is always the same.
Issues:
- running with Flag will be predictable if map doesn't have A.I. directives enhanced and a rocket properly fired will make Bot to have a death meeting when gets fired properly in a Node when Bot will reach there in next 3 seconds - here Pawn is not warned to strafe so will act like a retard dying all the time if hunter is in a good fire spot;
- a shortcut at RouteCache when Bot has an AlternatePath acquired will deliver errors (or code/actors/action have to be studied in detail and wrapping them properly).
NsCTF is able to deal with RouteCache pretty well guiding Bot/MBot properly.

Edit:
Rocky wrote: For a moment, MBotv2 sometimes by mistake fires two transloc modules at a same time, when translocating to control points.
This is kinda annoying.
Then you need a wrapper - destroy TTarget if exist one or trigger a default check before translocation. There is nothing to be removed - Removal is not a fix, sanitize code.

Edit2: I'm not sure what you did at your v2 but a couple of minutes ago I fired up some Domination matches and I did not see translocation issues, simply check if (bCanTranslocate). See if that boolean is assigned correctly.

User avatar
sektor2111
Godlike
Posts: 4547
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Short Bot Note

Post by sektor2111 » Sun Dec 27, 2015 10:29 pm

All right, Rocky. I'll introduce a default issue which at a moment is annoying.
I don't have much drawing skill so I have rushed at a small picture describing one of issues - might be many but have the same solution. Example:
[attachment=0]Bad_Spots.png[/attachment]
Simply in random moments from state roaming a very easy and pathetic jump is not operated and Pawn runs in place like an idiot at ledges, the same happens when is closer to a wall and the way down is right there but it's not interested to jump... Jump Jump Jump - really hard :loool:
I was trying to screw roaming but looks like engine's participation is not very friendly - I really don't need new issues, also I did not figured internal solutions just primary PickWallAdjust + a random trace. Now I'm testing how works a couple maps with good paths but showing Pawn flaws in Navigation at ledges and way down from ledges using red paths closer to walls.

I'm saying Roaming because in state Hunting is a real bitch + Tactical move where they jump to the death.

Using Holding solution I also have brought an external temporary keypoint living 1 second and triggering idiot to jump. Now I'll do some tests as long as I did not love their run-no-run habits. Now I'm in testing operation. If you are interested I'm gonna update first link but first I wanna do a couple of tests (or many tests).

To not forget - solution won't run post game-ended and neither in water for simple logic reasons. In water pawn can move how wants and where wants (swimming) and if match is ended there is no need for anything special.
Attachments
Bad_Spots.png
Bad_Spots.png (7.54 KiB) Viewed 4457 times

Spectra
Masterful
Posts: 542
Joined: Tue Jan 22, 2013 5:23 pm
Personal rank: Nullified!
Location: (X) Unable To Locate....

Re: Short Bot Note

Post by Spectra » Tue Dec 29, 2015 10:10 am

I am interested and waiting for your test results!

Some weird bugs/things I found from original MBot:
MBot doesn't really care to pickup guns near him when they are given orders to Cover you! They think Enforcer (and other enforcer mods) is Almighty Father. :loool:

Is there any way not make jumps when Destination.Z < Location.Z?? They jump like stupid, even where jumps are not required! (See Deck16][ near minigun2 area)

I haven't touched MBotv2 since last week! And those double Transloc Module problem is also solved and now they run and translocate well.
Should I release with whatever I have done so far??

User avatar
sektor2111
Godlike
Posts: 4547
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Short Bot Note

Post by sektor2111 » Tue Dec 29, 2015 5:54 pm

Rocky wrote:Some weird bugs/things I found from original MBot:
MBot doesn't really care to pickup guns near him when they are given orders to Cover you! They think Enforcer (and other enforcer mods) is Almighty Father.
I screwed something at picking inventory. I've figured in some moments attempts to recover weapons flew on walls not really reachable. But Pinata type drop still fool them, example in my MH2 they get everything around from other Bot/player murdered by monsters. In DM they get the mostly marked items (Level Items) attempting to load the nearby weaponry only if encounter a threat, else they get "fresh" stuff (some people drop almost empty weaponry which was fooling them). So to speak if you want original "get everything way" you can put back default PickLocalInventory if I well recall its name, and also that 600 UU picking habit. My way was get minimum and hunt pawns not crawling too busy with items.
You might do a primary check for old codes in map "DM-1on1-Sph3res-v2.unr". I like map, I like paths, I can find pawns as well but there is a spot driving me mad (perhaps affected by Skill level). Path-Line created between LiftExit2 and PathNode0.
I figured often Bot skating there for long time unable to deal with that way down when comes from ripper.
[attachment=0]Solving_Reds.PNG[/attachment]
Why I want such issues solved ? Because there are more Levels with such single problems and re-editing is time consuming and not enough issues for screwing Level - because I'm fully repathing Level when has a lot of issues. Solution seems cute with a jumper type keypoint Owned and being in Level all the time in let's say "warehouse" rather than spawning a bunch of them all the time with limited life. Bot call that randomly. I wanna see how much affects normal GamePlay for doing fine tuning and also which trace is better to trigger a jump when pawn has a nasty ledge blocking a line between legs and next node triggering a jump. I'm saying node excepting waiting pawns at lift or when other state gets sudden called or when pawn is waiting an inventory to respawn (happens under 5 seconds).
Up mentioned Level has now an improved deal, Bot simply jumps normally into Node direction with a random velocity (not the same as a stupid robot) take a way more or less closer to PathNode0 or even doing a replay getting into LiftCenter first. Better than skating 5 minutes and no result.
Secondary way could be sorting another point if Bot still crawl into a zone by spawning a reference point. If point still have Bot in range then we have a problem, Move Bot pretty far (try finding a Node at 1000 UU if possible but not closer than 300). This is only in theory, I think the best solution is that helper which being a code outside of pawn is not rammed by engine when is moving pawn.

Aside note:
If this would be a Level pathed by me I would deal with some bOneWayPath set in settings and placements or a pathing tweak to prevent that wild way down created.

Next problem might be a harder one - looping between 2 nodes crap. But that's another homework and it needs first some tricky logs placed to spy RouteCache-s.
Rocky wrote: I haven't touched MBotv2 since last week! And those double Transloc Module problem is also solved and now they run and translocate well.
Should I release with whatever I have done so far??
You can release what you might think necessary, for me showing codes is enough to drop them in my classes.
Related to jump habits at way down, well it's exactly the problem described if they don't jump - it's bStopAtLedges, bAvoidLedges problems of roaming. The problem is finding that Navigation sequence to slow down jump velocity. Navigation seems combined with Natives and UScript and now I'm trying some UScript tweaks, example randomizing tiny Velocity things in order to get over ledges. No worry for Deck16, I have simply modified it for a couple of reasons at pathing chapter:
- a node sometime stuck at shield and it's totally useless;
- no valid way for seeking Flak near vials, PulseGun (only in heavy combat situations);
- I don't recall what I was looking for but pathing was looping me badly in minigun area - there is a node-soup there, map is bombed with useless points in a simple area;
- several translocation spots would be recommended when Translocator is available but I did not figured too many options;
- Bot has NO path at Redeemer - which is dumb.
So for me Deck16][ is a wreck, I'm using a modified one.
Attachments
Solving_Reds.PNG
Last edited by sektor2111 on Sun Jan 03, 2016 2:01 am, edited 1 time in total.

User avatar
sektor2111
Godlike
Posts: 4547
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Short Bot Note

Post by sektor2111 » Wed Dec 30, 2015 4:48 pm

I have uploaded a version compiled December29. Whatever goes wrong for you I'll point sequences to be easily modified

In State Roaming not functions from roaming as much state itself has add-ons:

Code: Select all

..
Moving: //internal label
	else if ( MoveTarget != None && MoveTarget.IsA('Inventory') && Level.Game.bTeamGame )
	{
		if ( Orders == 'Follow' && Pawn(OrderObject) != None )
			ShareWith(Pawn(OrderObject));
		else if ( SupportingPlayer != None )
			ShareWith(SupportingPlayer);
	}
//from here go couple of changes
if ( MoveTarget != None ) //must have something
	{
		if ( !Region.Zone.bWaterZone ) //Won't happen in water
		{
			if ( MoveTarget.Location.Z < ( Location.Z-50 ) //lower point
				&& SpecialPause == 0 //not a lift or special handling
					&& !FastTrace( MoveTarget.Location,Location+vect(0,0,-20)) //and not really traceable
						&& FRand() > 0.7 ) //Change this random if measure is too rare eg: 0.5 - 0.6
			{
				if ( JumpZ > 200 ) //if is not rammed at jumping
				{
					if ( mk != None ) //test existence of our new thing-tool used
					{
//						log (Self.GetHumanName()@"going down way."); //Spy if code works
//						mk.SetRotation(Rotation); //Rotate as Owner //see this in detail
						mk.SetLocation(Location); //Bring to Owner
						mk.Touch(Self); //Call drop - it's not self called mainly - the rest is operated by mk itself
					}
				}
			}
			if ( ( Vsize(Velocity) > 10 && ( FRand() < 0.1 ) ) )
			{
				if ( !bWallAdjust && PickWallAdjust() )
					if ( mk != None )
					{
//						mk.SetRotation(Rotation);
						mk.SetLocation(Location);
						mk.Touch(Self);
					}
			}
			if ( Vsize(Velocity) > 10 )
			if ( !FastTrace( MoveTarget.Location,Location+vect(0,0,-20))
			&& ( MoveTarget.Location.Z-Location.Z ) <= ( MaxStepHeight + CollisionHeight )
			&& ( MoveTarget.Location.Z-Location.Z ) > MaxStepHeight )
			{
				if ( mk != None )
				{
//					mk.SetRotation(Rotation);
					mk.SetLocation(Location);
					mk.Touch(Self);
				}
			}
		}
		if ( VSize(Location-MoveTarget.Location) < CollisionRadius * 0.5
			&& SpecialPause == 0 && FRand() > 0.5 )
		{
			CampTime = 1.0;
			bCampOnlyOnce = true;
			GoTo('Camp');
		}
mk is an actor keypoint spawned right at begining

Code: Select all

function PreBeginPlay()
{
	bIsPlayer = true;
	mk = Spawn( class 'MyKick',Self,,Location+Vect(0,0,100),Rotation); //spawn at some location - let's call it warehouse
	Super(Pawn).PreBeginPlay(); //get over Bot because it goes at Pawn anyway
	if (Orders == '')
		Orders = 'FreeLance';
}
Now we have the tool that can be changed as needed

Code: Select all

class MyKick expands Keypoint;

var MBot Pending;
var Vector Direction;
var float Distance;
var int JumpZ;
var Vector StartLocation;

event PreBeginPlay()
{
	// No relevance shite
}

event PostBeginPlay()
{
	StartLocation = Location; //save location
	if ( Pawn(Owner) != None )
	{
		JumpZ=Pawn(Owner).JumpZ; //assign if needs or don't use original
		if (!Level.Game.bGameEnded) //Never work if everything is finished
			Touch(Owner); //call touch - eh, not necessary but let it be
	}
}

event Timer()
{
	if ( Pending != None
		&& Pending.Health >= 1
			&& Pending.MoveTarget != None
				&& !Pending.bCamping )
	{
		SetRotation(Pending.Rotation); //adjust rotation of jump based on Owner 
		Pending.SetPhysics(PHYS_Falling); //Will need fall
//		Pending.Velocity = Pending.GroundSpeed * Vector(Rotation);
//		Distance = VSize(Pending.MoveTarget.Location-Pending.Location);
//		Direction = ( Pending.MoveTarget.Location-Pending.Location )/Distance;
//		Pending.Velocity = Pending.GroundSpeed * Direction;
		if ( Pending.Region.Zone.ZoneGravity == class'ZoneInfo'.default.ZoneGravity )
			Pending.Velocity.Z = Clamp((JumpZ*FRand()),200,JumpZ); //rule for normal gravity
		else
			Pending.Velocity.Z = Clamp((JumpZ*FRand()),100,JumpZ/2); //pick another for lowgraw cases
//		Pending.Acceleration = Direction * Pending.AccelRate;
		Pending.Destination = Pending.MoveTarget.Location; //I want that location
		Pending.bJumpOffPawn = True; //jump this way
		Pending.SetFall(); //Fall down after jump
	}
	SetLocation(StartLocation); //Do party and move at home
}

function Touch( actor Other )
{
	if ( Other == Owner //Having owner and only owner
		&& MBot(Other) != None //having special owner
			&& !MBot(Other).bHidden //Not a hidden or such
				&& !Level.Game.bGameEnded //no ended double check
					&& !Owner.Region.Zone.bWaterZone //no water with any matter
						&& MBot(Owner).IsInState('Roaming')) //only for roaming - don't react at impactjumping or translocation
	{
		Pending = MBot(Other); //set as our value
		SetTimer(0.15, false); //wait a bit and call
//		log (Self$" > I'm gonna throw "$Other.GetHumanName());
	}
}

defaultproperties
{
   bDirectional=True
   JumpZ=320 //rise this up if is not good - or follow owner
   CollisionHeight=20
   CollisionRadius=20
   RemoteRole=ROLE_None
   bStatic=False
}

User avatar
sektor2111
Godlike
Posts: 4547
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Short Bot Note

Post by sektor2111 » Sun Jan 03, 2016 2:09 am

Related to that step up section. For some reason (new XC tracing) when the step up is passing through a door pawn jumps and returns at point without going forward. I added a FRand() to decrease a bit jumping in higher points and it helps.

Code: Select all

         if ( Vsize(Velocity) > 10 && FRand() > 0.5 ) //modified here
         if ( !FastTrace( MoveTarget.Location,Location+vect(0,0,-20))
         && ( MoveTarget.Location.Z-Location.Z ) <= ( MaxStepHeight + CollisionHeight )
         && ( MoveTarget.Location.Z-Location.Z ) > MaxStepHeight )
Change is welcomed in maps a la MH-Canyon - bad step at minigun area, bad step at vials near castle. Now is more properly navigable.

Post Reply