GameEngine - EditorEngine - checking around

Mod development and tools for UE1 game titles here.
Post Reply
Nelsona
Posts: 46
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 41 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...

User avatar
SC]-[WARTZ_{HoF}
Site Admin
Posts: 93
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: 46
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.
SpoilerShow
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"
}

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

Re: GameEngine - EditorEngine - checking around

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

The test-guy which is being used in Editor Environment
SpoilerShow
class GunlocScout expands Bot;

var() float Radiuses[5];
var() float Heights[5];

event PreBeginPlay()
{
bHidden = true;
bCanJump = true;
bCanWalk = true;
bCanSwim = true;
bCanFly = false;
bCanOpenDoors = true;
bCanDoSpecial = true;
LifeSpan = 0.01;
}

event PostBeginPlay()
{
}

event Destroyed()
{
}

function bool CheckReachability( Actor Start, Actor End)
{
local int ShrinkIdx;

Shrink(ShrinkIdx);
bCollideWorld = true;
bCollideWhenPlacing = true;
while ( !SetLocation(Start.Location) )
if ( !Shrink(ShrinkIdx) )
return false;
bStopAtLedges = False;
bAvoidLedges = False;
Move( vect(0,0,-1) * CollisionHeight);

if ( Region.Zone.bWaterZone ) SetPhysics( PHYS_Swimming);
else SetPhysics( PHYS_Walking);

while ( !PointReachable(End.Location) )
if ( !Shrink(ShrinkIdx) )
return false;
return true;
}

event FellOutOfWorld()
{
}

function bool Shrink( out int ShrinkInto)
{
if ( ShrinkInto >= ArrayCount(Radiuses) )
return false;
SetCollisionSize( Radiuses[ShrinkInto], Heights[ShrinkInto]);
ShrinkInto++;
return true;
}

defaultproperties
{
Radiuses(0)=50.000000
Radiuses(1)=42.000000
Radiuses(2)=30.000000
Radiuses(3)=18.000000
Radiuses(4)=8.000000
Heights(0)=70.000000
Heights(1)=65.000000
Heights(2)=52.000000
Heights(3)=48.000000
Heights(4)=39.000000
GroundSpeed=400.000000
WaterSpeed=280.000000
AirSpeed=400.000000
JumpZ=325.000000
UnderWaterTime=20.000000
CollisionRadius=17.000000
CollisionHeight=39.000000
bGameRelevant=True
}
This builder will need an icon placed in "editorres" folder which is inside "System" folder. You can modify an already made one (put a red line over it or something simple for identification). It's about those bmp files...

In other homework I'll do a research in how to detect if map has reachable paths between two flags or such two points using a... builder like this. I must think at strategy used... probably setting up two actor names (Playerstart10 or such and FlagBase1) then testing if some "guy" is able to track these, I want to know if "FindPathToward" works, as long as ActorReachable doesn't seems to operate or I did miss something, so I think I'll look for "FindPathTo". This is just a test which I wanna do because I'm curious what anything else is different in Editor nearby transient stuff which Editor is refusing by default. Or Editor will crash if some stuff calls Level.Game because Editor doesn't have a game or probably these functions will not work in that Environment.

Post Reply