GameEngine - EditorEngine - checking around

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

GameEngine - EditorEngine - checking around

Post by Nelsona »

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 7374 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...
UncodeX Stuff
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: 420
Joined: Wed May 10, 2017 7:08 am

Re: GameEngine - EditorEngine - checking around

Post by SC]-[WARTZ_{HoF} »

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: 1692
Joined: Sat Sep 30, 2017 5:03 am

Re: GameEngine - EditorEngine - checking around

Post by Nelsona »

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.
Spoiler
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"
}
UncodeX Stuff
Not often maintained
My UT Mapping works...
Learn the rules like a pro, so you can break them like an artist.
- Pablo Picasso -
Nelsona
Posts: 1692
Joined: Sat Sep 30, 2017 5:03 am

Re: GameEngine - EditorEngine - checking around

Post by Nelsona »

The test-guy which is being used in Editor Environment
Spoiler
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.
UncodeX Stuff
Not often maintained
My UT Mapping works...
Learn the rules like a pro, so you can break them like an artist.
- Pablo Picasso -
Nelsona
Posts: 1692
Joined: Sat Sep 30, 2017 5:03 am

Re: GameEngine - EditorEngine - checking around

Post by Nelsona »

I don't know if I do need to start a tiny tech-mapping tutorial (no worries, I did not see many like these) toward some setting which can improve game-play in network play.
Sometimes when you play your map On-Line, several things might not be as you have been expecting. One sample is that decoration-flag1 and sub-classes which probably is not very moving or is not seen at random, making towers nice decorated with flags to not have any more design ON-Line. I'm far from giving an advice to screw actor's properties but... we do need this in certain cases...

Speaking about a map which I was patching last time like Minas_Tirith (fixed not fixed of course) we can take a look at flags fluttering on those towers - might be a dream ON-Line.
That_Old_Flag.PNG
That_Old_Flag.PNG (17.83 KiB) Viewed 6949 times
If you take a look at it... it might be funny or... disturbing like someone was on drugs over here:
- Good Morning, Mr. Flag, what are you doing today ?
- Good Morning, today I'm planning a WALK - look at my physics... I'm OK, right ?

Mapper has to mitigate ideas coming from a drunk brain by doing the right setup for such a flag if is used for a map dedicated for servers. As a sample I do settings in fore-mentioned crapped map as follows (why crapped, we can debate this later at will in a complete mapper defaming spree - not a desired good thing):
my code

Code: Select all

		if (string(A.Name) ~= "Flagb0") // Position 41
		{
			A.NetUpdateFrequency = 10;
			A.RemoteRole = ROLE_DumbProxy;
			A.bStasis = False;
			A.SetPhysics(PHYS_None);
			A.bAlwaysRelevant = True;
			continue;
		}
In translation I made flag to be replicated ALWAYS not only on sight with a lower frequency because it doesn't need 100, and RemoteRole is probably better at DumbProxy as long as this actor doesn't cooperate in Net Play for SimulatedProxy as long as animating function is... NOT SIMULATED. For sure FLAG is not suppsed to take a walk under Moon-light or Sun-Light - recommending PHYS_None.

Code: Select all

class Flag1 extends Decoration;

#exec MESH IMPORT MESH=Flag1M ANIVFILE=MODELS\flag_a.3D DATAFILE=MODELS\flag_d.3D X=0 Y=0 Z=0 ZeroTex=1
#exec MESH ORIGIN MESH=Flag1M X=0 Y=100 Z=0 YAW=128 PITCH=0 ROLL=-64
#exec MESH SEQUENCE MESH=flag1M SEQ=All    STARTFRAME=0  NUMFRAMES=14
#exec MESH SEQUENCE MESH=flag1M SEQ=Wave  STARTFRAME=1  NUMFRAMES=13
#exec TEXTURE IMPORT NAME=JFlag11 FILE=MODELS\flag.PCX GROUP=Skins
#exec TEXTURE IMPORT NAME=JFlag12 FILE=MODELS\flagb.PCX GROUP=Skins
#exec MESHMAP SCALE MESHMAP=flag1M X=0.1 Y=0.1 Z=0.2
#exec MESHMAP SETTEXTURE MESHMAP=flag1M NUM=0 TEXTURE=Jflag11

function PostBeginPlay()
{
	Super.PostBeginPlay();
	LoopAnim('Wave',0.7,0.1);
}
Oh Well, with a little fine tuning, this Flag can spawn in client and there will be full animated and full visible if exist in Authoritative environment. I mean client running its code will see it with no issues even if is located in a SkyBox - yeah, mappers - read well, coding is always helpful in mapping. And yes, this decoration is useless in servers if are placed in maps if has default setup, server running animations which NO ONE can see.
I will not forget to mention if you check collision of this thing, probably if has physics walking and no world collision, destination will be Void location.
To confirm that I'm not talking dreams, play map MH-Minas_Tirith in XC MH server and see those flags (they are only tweaked not replaced or added).

Thanks for watching, ooops reading.
UncodeX Stuff
Not often maintained
My UT Mapping works...
Learn the rules like a pro, so you can break them like an artist.
- Pablo Picasso -
Post Reply