GameEngine - EditorEngine - checking around

Mod development and tools for UE1 game titles here.
Post Reply
Nelsona
Posts: 492
Joined: Sat Sep 30, 2017 5:03 am

GameEngine - EditorEngine - checking around

Post by Nelsona » Tue Jan 09, 2018 5:54 pm

I was messing up with doing a sort of tester in order to help me in doing patchers. Goal was to find if I do need forced links between PathNodes or they get normal directives.
The result of initial tests was... interesting and not that real. GameEngine has other deal than EditorEngine and Editor does paths taking more factors in account - is not the same environment anyway - yeah, Funky - read well.
I did a sort of test using a Fake Bot. Plain paths looks properly but not those which are bigger than "stepheight" and jumping doesn't seems in account at Reachable chapter or I fail to figure something. Technology seems to help in figuring if Map has some BSP problem causing bad spots.
The extra Note:
When Pawn has Flight capability - reachable term is really... huge, cough fliers can find more stuff than I have expected or is a fake Editor prediction.
If anyone wants to figure whatever stunts I can "spoiler" some code.
Test_Reach.PNG
Test_Reach.PNG (730.48 KiB) Viewed 1334 times
A conclusion is according to Editor rules, if these Healthvials, PlayerStart and Pathnode from middle would not be there, these two selected Nodes would have a direct link proving that path net should not be heavy loaded for no reason...

The problem and the pain of Editor is that it did not include any tester like this and neither logging the bad brush with troubles in order to quickly get the fix, we can see only polyfix bla bla but none Info about crapped brush...
Not often maintained
My UT Mapping works...
Learn the rules like a pro, so you can break them like an artist.
- Pablo Picasso -

User avatar
SC]-[WARTZ_{HoF}
Site Admin
Posts: 191
Joined: Wed May 10, 2017 7:08 am

Re: GameEngine - EditorEngine - checking around

Post by SC]-[WARTZ_{HoF} » Tue Jan 09, 2018 7:38 pm

Nelsona wrote:
Tue Jan 09, 2018 5:54 pm
When Pawn has Flight capability - reachable term is really... huge, cough fliers can find more stuff than I have expected or is a fake Editor prediction.
If anyone wants to figure whatever stunts I can "spoiler" some code.
I'm very interested. :D

Nelsona
Posts: 492
Joined: Sat Sep 30, 2017 5:03 am

Re: GameEngine - EditorEngine - checking around

Post by Nelsona » Tue Jan 09, 2018 8:50 pm

In game things are ugly if we do very long range paths - some times this is not what we need, speaking about run-time control. class PathsLinker expands BrushBuilder;

var() bool bLogNewNav, bLogTweakPoint, bGenerateDecoUC, bLogActors, bComputeDistance,
bCheckDuplicates, bLogBrushBuildLag, bTestReach;
var() int NumBrush;

var LevelInfo MyMap;

final function FindLevel()
{
SetPropertyText("MyMap","MyLevel.LevelInfo0");
if( MyMap==None )
SetPropertyText("MyMap","MyLevel.LevelInfo1");
if( MyMap==None )
SetPropertyText("MyMap","MyLevel.LevelInfo2");
if( MyMap==None )
Warn("Couldn't find levelinfo!");
}

event bool Build()
{
FindLevel();
if( MyMap == None )
GoTo NoMap;
if (bLogNewNav)
LogSpawnSelected();
if (bLogTweakPoint)
LogVectorialEtc();
if (bGenerateDecoUC)
GenerateNonStaticDeco();
if (bLogActors)
LogWrappedNames();
if (bComputeDistance)
ComputeTheseTwo();
if (bCheckDuplicates)
FindCrappedActors();
if (bLogBrushBuildLag)
{
if ( NumBrush == 0 )
return BadParameters("NumBrush parameter should not be 0.");
FindLaggerBuild();
}
if (bTestReach)
TestTheseTwo();
GoTo Ending;
NoMap:
log ("No Map Environment for Operating...",'PathsLinker');
return BadParameters("Did not find a clean Level...");
Ending:

}

final function TestTheseTwo()
{
local Actor A, A1, A2;
local GunlocScout S;

foreach MyMap.AllActors(class'Actor',A)
{
if ( A.bSelected && A1 == None )
{
A1 = A;
continue;
}
if ( A.bSelected && A2 == None )
{
A2 = A;
break;
}
}
if ( A1 != None && A2 != None )
{
S = MyMap.Spawn(class'GunlocScout',,,A1.Location);
if (S == None) Goto UnabletoOperate;
else
{
if (S.CheckReachability( A1,A2 ))
{
Log ("Route is OK from"@A1.Name@"to"@A2.Name@"having distance"@VSize(A1.Location-A2.Location)@"UU.");
S.SetLocation(A2.Location);
if (S.CheckReachability( A2,A1 ))
{
Log ("Route is OK from"@A2.Name@"to"@A1.Name@"having distance"@VSize(A2.Location-A1.Location)@"UU.");
}
else
{
Log ("Route from "$A2.Name$" to "$A1.Name$" doesn't seem reachable.");
S.bCanFly = True;
if (S.CheckReachability( A2,A1 ))
Log("Flight is required for navigating from"@A2.Name@"to"@A1.Name);
}
}
else
{
Log ("Route from "$A1.Name$" to "$A2.Name$" doesn't seem reachable.");
S.bCanFly = True;
if (S.CheckReachability( A1,A2 ))
Log("Flight is required for navigating from"@A1.Name@"to"@A2.Name);
S.bCanFly = False;
S.SetLocation(A2.Location);
if (S.CheckReachability( A2,A1 ))
{
Log ("Route is OK from"@A2.Name@"to"@A1.Name@"having distance"@VSize(A2.Location-A1.Location)@"UU.");
}
else
{
S.bCanFly = True;
if (S.CheckReachability( A2,A1 ))
Log("Flight is required for navigating from"@A2.Name@"to"@A1.Name);
else
Log ("Route from "$A2.Name$" to "$A1.Name$" doesn't seem reachable.");
}
}
S.Destroy();
}
Goto DoneHere;
}
UnabletoOperate:
log ("Bad Selection... I'm sorry about that...");
DoneHere:
}

final function FindLaggerBuild()
{
local Brush B;
local INT i;

foreach MyMap.AllActors(class 'Brush',B)
{
i++;
if (i == NumBrush)
{
log ("Suspect Brush pausing build process ="@B.Name);
break;
}
}
}

final function FindCrappedActors()
{
local Actor A, A1;
local Int i, j;

foreach MyMap.AllActors(class'Actor',A)
{
foreach MyMap.AllActors(class'Actor',A1,A.Tag)
{
if ( string(A.Name) == string(A1.Name) )
{
i++;
}
}
if ( i > 1 )
{
j++;
log (A.Name@"was found"@i@"times.");
}
i = 0;
}
if ( j > 0 )
log ("Found"@j@"duplicated Actors.");
else
log ("This Level doesn't seems to have duplicated actors at this check.");
}

final function ComputeTheseTwo()
{
local Actor A, A1, A2;

foreach MyMap.AllActors(class'Actor',A)
{
if ( A.bSelected && A1 == None )
{
A1 = A;
continue;
}
if ( A.bSelected && A2 == None )
{
A2 = A;
break;
}
}
if ( A1 != None && A2 != None )
{
log ("Distance between"@A1.Name@"and"@A2.Name@"="@VSize(A1.Location-A2.Location)@"UU.");
A1 = None; A2 = None;
}
else
log("You must have 2 selected actors...");
}

final function LogWrappedNames()
{
local int I;
local Actor A;

foreach MyMap.AllActors(class'Actor',A)
{
I++;
log (A.Name@"is number"@I@".",'OrderOfActors');
}
log ( "Logged "$I$" actors..." );
}

final function LogSpawnSelected()
{
local Actor A;
local bool bRotated;

foreach MyMap.AllActors(class'Actor',A)
{
if (A.bSelected)
{
if ( A.Rotation.Pitch != 0 )
{
log ("NewRot.Pitch="$A.Rotation.Pitch$";",'UcCopy');
bRotated = True;
}
if ( A.Rotation.Roll != 0 )
{
log ("NewRot.Roll="$A.Rotation.Roll$";",'UcCopy');
bRotated = True;
}
if ( A.Rotation.Yaw != 0 )
{
log ("NewRot.Yaw="$A.Rotation.Yaw$";",'UcCopy');
bRotated = True;
}
if ( bRotated && NavigationPoint(A) == None )
log ( "Spawn(class'"$A.Tag$"',,,vect("$int(A.Location.X)$","$int(A.Location.Y)$","$int(A.Location.Z)$"),NewRot);",'UcCopy' );
else
log ( "Spawn(class'"$A.Tag$"',,,vect("$int(A.Location.X)$","$int(A.Location.Y)$","$int(A.Location.Z)$"));",'UcCopy' );
bRotated = False;
}
}
}

final function LogVectorialEtc()
{
local Actor A;
local string str, sto;
local int I;

I=0;
foreach MyMap.AllActors(class'Actor',A)
{
I++;
if (A.bSelected)
{
if (A.IsA('NavigationPoint'))
{
log ( "foreach NavigationActors(class'"$GetClassName(A)$"',"$Left(GetClassName(A),2)$",30,vect("$int(A.Location.X)$","$int(A.Location.Y)$","$int(A.Location.Z)$"))",'UcCopy');
log ("{",'UcCopy');
log (" if (string("$Left(GetClassName(A),2)$".Name) ~= "$CHR(34)$A.Name$CHR(34)$")",'UcCopy');
log (" {",'UcCopy');
log (" ",'UcCopy');
log (" break;",'UcCopy');
log (" }",'UcCopy');
log ("}",'UcCopy');
}
else
{
log (" if (string(A.Name) ~= "$CHR(34)$A.Name$CHR(34)$") // Position "$I,'UcCopy');
log (" {",'UcCopy');
log (" ",'UcCopy');
log (" continue;",'UcCopy');
log (" }",'UcCopy');
}
str = "";
sto = "";
}
}
I = 0;
}

final function GenerateNonStaticDeco()
{
local Actor A;
local string str, sto;
local int I;

foreach MyMap.AllActors(class'Actor',A)
{
if (A.bSelected)
{
if ( A.IsA('Decoration') )
{
log ("class E_"$GetClassName(A)$" expands "$GetClassName(A)$";",'UcCopy');
log (" ",'UcCopy');
log ("defaultproperties",'UcCopy');
log ("{",'UcCopy');
log (" bStatic=False",'UcCopy');
log (" bNoDelete=False",'UcCopy');
log (" bMovable=True",'UcCopy');
log (" bGameRelevant=True",'UcCopy');
log (" bCollideWorld=False",'UcCopy');
log (" bCollideActors=False",'UcCopy');
log (" bCollideWhenPlacing=False",'UcCopy');
log (" ScaleGlow=240",'UcCopy');
log (" RemoteRole=ROLE_None",'UcCopy');
log ("}",'UcCopy');
}
}
}
}

function String GetClassName(Actor AnActor)
{

Local string FullName, ClassName, Temp;
Local int pos, I, J;

Temp="None";
if (AnActor == None) return Temp;
FullName="";
pos=-1;
FullName=string(AnActor.Class);
ClassName=string(AnActor.Class);
// log (FullName);
pos = InStr(FullName, ".");
// log (pos);
if ( InStr(FullName, ".") > 0 )
{
FullName=Left(FullName, InStr(FullName, "."));
I = Len(FullName);
J = Len(string(AnActor.Class));
FullName = Right(ClassName,J-(I+1));
}
// log ("GetClassName::"@FullName@"for"@AnActor.Name);
return FullName;
/*
if (anActor == None)
return string(None);
return string(anActor.Class.Outer);
*/
// return string(anActor.Class.Outer);
}

defaultproperties
{
BitmapFilename="PathsLinker"
ToolTip="Paths Linker"
}
Not often maintained
My UT Mapping works...
Learn the rules like a pro, so you can break them like an artist.
- Pablo Picasso -