Splitting MonsterHunt packages?

Discussions about Coding and Scripting
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Splitting MonsterHunt packages?

Post by sektor2111 »

All right...
After getting main stuff operational, however some "featured" Levels seems to go crazy at whatever triggering problem - it's a critical situation when a Warp suddenly deactivates with no return and a Teleporter as well. My conformed MH seems to have some skating issues, which I cannot figure where are coming from. It was using 2 add ons for default player in purpose to setup stuff correctly. Okay, on the other side, so called XC MonsterHunt which is an extension of default MonsterHunt at this stage works perfectly, no warping troubles, no crap, just... working properly in Levels where my conformed MH seems to do sucks.

So what's the plan ? Adding good things into XC_MonsterHunt with separate named stuff, separate classes, cute tweaks without to mess anymore with the same named things conformed and made "compatible" because they doesn't seems compatible 100%. It's only a waste of time for me as long as I don't have skill for detecting all crap happening in memory at using these "conformed" things. By Expanding that old crap into an extension and happily executing rewritten stuff there, I don't need any attached End, Waypoint, etc. Everything works because we play a default MonsterHunt with another suit - Bullet Proof suit.

Now I have to tweak Old weapons and Tournament creatures, I wanna see if troubles are coming from whatever tweaks or because conformed MH was using different rules... causing some glitches...
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Splitting MonsterHunt packages?

Post by sektor2111 »

Bump:
An A.I. note as a conclusion after doing some tests.
It looks like I have to implement in XC MonsterHunt "bHunting" deal. I made a small null tunnel (no items far away), having a Waypoint closer to end, but placed a bit higher on purpose. Without getting a reference like a nearby NavigationPoint, Bot was moving there to the closer PathNode, not to goal yet but... it's a progress at expanding Path Finding into game controller - it looks like it do works even if goal is not Pawn or Enemy Pawn, it's about finding actors generally - used Default Editor Pathing and... I'll do soon tests with XC_PathBuilder.

Else I fired MHBotyMan4 tester (compatible with XC MonsterHunt, btw, without hunting). Me, human, I did not see any path out of bHunting. Also Bot in original MonsterHunt was running in place with no purpose. bHunting seems to help Pawn in finding higher located things - good to know for me and explained nowhere in tutorials concerning coding A.I. in a game controller... I think this might be cute in Assault game where Objective can be sometimes unreachable in default navigation options... else they have used a "Nearest PathNode Tag" as a goal - probably a sort of UScript replacement for bHunting, or because testing if Pawn is on a such direct location needs a sort of test based RouteCache and or visibility and or target height - probably too expensive...

Edit: Or not that expensive taking in account "routecache".
When Pawn moves to a goal has some routecache if that thing is not directly reachable. If we have RouteCache[0] but not RouteCache[1] this means we are straight on that critical Node because next one doesn't exist. Result: Bot moves to point with any matter - even is out of ground obviously UnReachable in default MH. So to speak it do looks priceless like this case:
[attachment=0]NoReachAndReach.png[/attachment]
Spoiler

Code: Select all

function bool FindSpecialAttractionFor(Bot aBot)
{
	local MonsterWaypoint W;
	local MonsterEnd E;
	local MonsterWaypoint NextPoint;
	local bool bFound;
	local float BestWeight;
	local ScriptedPawn S;

	if ( aBot.Health < 1 )
	{
		aBot.GotoState('Dying');
		return false;
	}

	if ( aBot.LastAttractCheck == Level.TimeSeconds )
		return false;

	if ( aBot.Enemy != None && ValidSight(aBot.Enemy,aBot) )
	{
		if (!aBot.IsInstate('Attacking'))
		{
			aBot.GotoState('Attacking');
			return False;
		}
	}

	aBot.LastAttractCheck = Level.TimeSeconds;

	if ( GameGoal == None )
	{
		if ( NumPoints > 0 )
		{
			aBot.bHunting = True;
			foreach AllActors( class'MonsterWaypoint', W )
			{
				if ( W.bEnabled && !W.bVisited && ( W.Position == LastPoint + 1) )
				{
					NumPoints --;
					NextPoint = W;
					GameGoal = NextPoint;
					if ( aBot.ActorReachable(NextPoint) )
					{
						aBot.MoveTarget = NextPoint;
						break;
					}
					else
						aBot.MoveTarget = aBot.FindPathToward(NextPoint);
					if ( aBot.MoveTarget != None )
						break;
					else
						aBot.MoveTarget = aBot.FindPathTo(NextPoint.Location);
					if ( aBot.MoveTarget != None )
						break;
					break;
				}
			}
			aBot.bHunting = False;
		}
		else
		{
			aBot.bHunting = True;
			foreach AllActors( class'MonsterEnd', E )
			{
				if ( aBot.ActorReachable(E) )
				{
					GameGoal = E;
					aBot.MoveTarget = E;
					break;
				}
				else
					aBot.MoveTarget = aBot.FindPathToward(E);
				if ( aBot.MoveTarget != None )
				{
					GameGoal = E;
					break;
				}
				else
				{
					aBot.MoveTarget = aBot.FindPathTo(E.Location);
				}
				if ( aBot.MoveTarget != None )
				{
					GameGoal = E;
					break;
				}
			}
			aBot.bHunting = False;
		}
	}

	if ( ((aBot.Orders == 'Attack') || ((aBot.Orders == 'Freelance') && (FRand() > 0.25))) && ScriptedPawn(aBot.Enemy) == None )
	{
		if ( GameGoal != None )
		{
			aBot.bHunting = True;
			if ( aBot.MoveTarget != GameGoal )
			{
//-----------------
/*
This is not called, happening in latent movement, LOL.
If there is no PathNode in that spot this will never get called
				if ( VSize( GameGoal.Location - aBot.Location ) < 50 )
				{
					aBot.BigJump(GameGoal);
					aBot.MoveTarget = GameGoal;
					GoTo JustMove;
				}
*/
//-----------------
//				log (aBot.GetHumanName()@query first move...);
/*
Expanding a bit seeking feature toward bHunting...
*/
				if ( aBot.RouteCache[0] != None && aBot.RouteCache[1] == None && !aBot.ActorReachable(GameGoal)
					&& ValidSight(GameGoal,aBot) 
					&& GameGoal.Location.z < aBot.Location.Z + ( aBot.CollisionHeight + GameGoal.CollisionHeight ) )
					{
						log (aBot.GetHumanName()@Push Condition Reached...);
						aBot.MoveTarget = GameGoal; //Apply Brute Force if Bot is here
//						log (aBot.GetHumanName()@RouteCache 0 is@aBot.RouteCache[0]);
//						log (aBot.GetHumanName()@RouteCache 1 is@aBot.RouteCache[1]);
					}
				else
					log (aBot.GetHumanName()@Push Condition Not Reached...);
			}
			if ( aBot.MoveTarget != GameGoal )
			{
//				log (aBot.GetHumanName()@still doesn't move... Keep scanning using defaults.);
				if ( aBot.ActorReachable(GameGoal) )
					aBot.MoveTarget = GameGoal;
				else
					aBot.MoveTarget = aBot.FindPathToward(GameGoal);
				if ( aBot.MoveTarget == None )
					aBot.MoveTarget = aBot.FindPathTo(GameGoal.Location);
				if ( aBot.MoveTarget == None )
					if ( aBot.PointReachable( GameGoal.Location ) )
						aBot.MoveTarget = GameGoal;
			}
			if ( aBot.MoveTarget != None && !aBot.bCamping )
			{
				SetAttractionStateFor(aBot);
				return True;
			}
			aBot.bHunting = False;
		}
		else
		{
			BestWeight = 0;
			aBot.MoveTarget = aBot.FindBestInventoryPath(BestWeight,True); //Else do what RedFist wants - predicting respawn like professional Bots
		}
JustMove:
	}
	return false;
}
The question stays why Epic did not use this extra power - probably they once again did not read docs written by themselves :lol2: . And bHunting feature can be... imported a bit into UScript like in that non-conformed v504, but I really want to allow Engine to work by itself. It looks like exist some condition for this hunting feature, in above example returns a valid result if actor is somewhere in 600 UU range from a visible Node else... Bot is not that determined. The closer is the better...
Of course, now I have to remove some logs and to beautify a bit the Bot code from above...
Attachments
Completing 2 Objectives Originally UnReachable using bHunting before path seeking code.
Completing 2 Objectives Originally UnReachable using bHunting before path seeking code.
User avatar
sektor2111
Godlike
Posts: 6403
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Splitting MonsterHunt packages?

Post by sektor2111 »

Bumping something
Reason Gunloc Mutator Tool.
In a simple Level I have summoned a few "gunlocteleporter" actors.
I was trying to find paths later but... I did not see them linked at all.

Purpose:
I was intended to do some mutator for OFF-Line gaming (for my daughter), in order to play some craps with no paths by dynamically adding nodes for getting bots around in covering purpose. LINKING those teleporters doesn't seems to work... I see only teleporters spamming me and nothing like a Path-Net.
Else light me up with a functional solution in connecting 2 nodes when I want, after 5 minutes, 8 minutes or when I need them.

Edit:Okay, I got it, it was missing "the master", I got some paths in an empty crap right in game... :lol: first stage is completed...
Post Reply