XC_Engine [20] - XC_Core [7b] - XC_IpDrv

Re: XC_GameEngine [test build 5.1]

Postby Higor » Sun Nov 23, 2014 4:17 pm

Oh shi*

I should have totally seen that coming, will fix it ASAP (increase buffer sizes)

Code: Select all
void UXC_GameEngine::PerformSetCommand( const TCHAR* Str, FOutputDevice& Ar, UBOOL bNotifyObjectOfChange )
{
   // Set a class default variable.
   TCHAR ClassName[64], PropertyName[64], ThirdParam[256], FourthParam[256];



===================
Update, fixed.

Decided to operate directly on the TCHAR stream if possible, still don't know the actual engine command size limit. Anyone knows?
The actual function is here:
Code: Select all
void UXC_GameEngine::PerformSetCommand( const TCHAR* Str, FOutputDevice& Ar, UBOOL bNotifyObjectOfChange )
{
   // Set a class default variable, names are up to 64 chars and classname can go as (Package.Class)
   TCHAR ClassName[128], PropertyName[64], Number[128];
   UClass* Class;
   UProperty* Property;
   if ( ParseToken( Str, ClassName, ARRAY_COUNT(ClassName), 1 )
   &&   (Class=FindObject<UClass>( ANY_PACKAGE, ClassName))!=NULL )
   {
      if ( ParseToken( Str, PropertyName, ARRAY_COUNT(PropertyName), 1 )
      &&   (Property=FindField<UProperty>( Class, PropertyName))!=NULL )
      {
         while ( *Str==' ')
            Str++;
         const TCHAR* Tester = Str;
         if ( !(*Tester) ) //Nothing to do here
            return;
         while ( *Tester!=' ' && *Tester ) //Go ahead until i've gone thru all the token
            Tester++;
         while ( *Tester==' ')
            Tester++;

         if ( !(*Tester) ) //There was only one token, use Str directly as parameter
            UObject::GlobalSetProperty( Str, Class, Property, Property->Offset, bNotifyObjectOfChange );
         else if ( ParseToken( Str, Number, 64, 1) ) //Parse the parameter we just went through
         {
            while ( *Str==' ') //And remove spaces from main stream
               Str++;
            INT Idx = Clamp(appAtoi( Number), 0, Property->ArrayDim);
            UObject::GlobalSetProperty( Str, Class, Property, Property->Offset + Idx * Property->ElementSize, bNotifyObjectOfChange );
         }
         else
            debugf((EName)XC_ENGINE_XC_Engine.GetIndex(), TEXT("PerformSetCommand: SOMETHING IS NOT RIGHT!"));;
      }
      else
         Ar.Logf( NAME_ExecWarning, TEXT("Unrecognized property %s"), PropertyName );
   }
   else
      Ar.Logf( NAME_ExecWarning, TEXT("Unrecognized class %s"), ClassName );
}


=================
Also, the Nexgen PreLoginHook does let the players know the ban reason upon being rejected, you just have to look into the log:
Attachments
SERVER_REJECT.png
SERVER_REJECT.png (5.48 KiB) Viewed 2423 times
Higor
Godlike
 
Posts: 1642
Joined: Sun Mar 04, 2012 6:47 pm

Re: XC_GameEngine [test build 5.1]

Postby gust » Mon Nov 24, 2014 6:20 am

ConsoleCommand("set ini:Engine.Engine.GameEngine ServerActors"@ServerActors);

not work.
User avatar
gust
Novice
 
Posts: 13
Joined: Thu Jul 31, 2014 1:16 pm

Re: XC_GameEngine [test build 5.1]

Postby Higor » Thu Nov 27, 2014 12:37 am

The "ini:Engine.Engine.GameEngine" text should be parsed by the package name resolver when finding a class.
EngineClass = UObject::StaticLoadClass( UGameEngine::StaticClass(), NULL, TEXT("ini:Engine.Engine.GameEngine"), NULL, LOAD_NoFail, NULL );
does it when initializing the game engine and works without problem, and the same happens in the Unreal Engine 3 code I used, will find out what's happening in this case.

EDIT:
I wonder if it's possible to load maps using packages from the Cache folder.
Might as well do that for build 6.

EDIT2
I'll instead implement an autocache converter when joining servers (advanced setting, off by default) which will rename the cached packages currently being used and place them in user-defined folders.
Higor
Godlike
 
Posts: 1642
Joined: Sun Mar 04, 2012 6:47 pm

Re: XC_GameEngine [test build 6 - v451 Linux fix - CacheConv

Postby Higor » Sat Nov 29, 2014 11:08 pm

Fixed GET, SET when loading from INI
Optimized GetMapName hook a bit
Fixed v451 Linux segmentation fault.
Added automatic cache converter, check AutoCacheConverter.txt for details.

=========================
Automatic cache converter
=========================

The Automatic cache converter is a simple setting that allows the client to copy
files delivered by the current server it's connected to into the package folders
with correct names and cases.

The file copy operations occur immediately after loading the map on a remote
server and new files will be placed into the first directory that matches the
file system criterias.

All file copy operations will be logged and won't replace existing files.


======
Usage:

This option is disabled by default, you must enable it in order for it to work.
Set XC_GameEngine.bCacheConvertAtJoin=True.

- The option can be modified via INI as follows
[XC_Engine.XC_GameEngine]
bCacheConvertAtJoin=True

- Or via a command:
SET XC_GAMEENGINE bCacheConvertAtJoin 1


=========
Examples:

- Copying downloaded files into default folders
[Core.System]
Paths=../System/*.u
Paths=../Maps/*.unr
Paths=../Textures/*.utx
Paths=../Sounds/*.uax
Paths=../Music/*.umx

- Copying downloaded files into a common folder
[Core.System]
Paths=../Downloaded/*.u
Paths=../Downloaded/*.unr
Paths=../Downloaded/*.utx
Paths=../Downloaded/*.uax
Paths=../Downloaded/*.umx
Paths=../System/*.u
Paths=../Maps/*.unr
Paths=../Textures/*.utx
Paths=../Sounds/*.uax
Paths=../Music/*.umx
-> Make sure you create the folder you're going to use!!
Higor
Godlike
 
Posts: 1642
Joined: Sun Mar 04, 2012 6:47 pm

Re: XC_GameEngine [test build 6 - v451 Linux fix - CacheConv

Postby gust » Sun Nov 30, 2014 8:34 am

good work.
work fine :)
User avatar
gust
Novice
 
Posts: 13
Joined: Thu Jul 31, 2014 1:16 pm

Re: XC_GameEngine [test build 6 - v451 Linux fix - CacheConv

Postby sektor2111 » Mon Dec 15, 2014 7:28 pm

Good day, etc...

Suggestion for whatever XC_Engine or such Add-On

Ability to deal with headers definition. Example:
Class[0]=UnrealShare.ScriptedPawn,PointingTo=CustomPackage.ScriptedPawn
Class[1]=Engine.Mover,PointingTo=CustomPackage.Mover
Etc. :help:
I'll be totally grateful for ability to rewrite stuff as I consider...

Best Regards!
User avatar
sektor2111
Godlike
 
Posts: 3595
Joined: Sun May 09, 2010 6:15 pm
Location: vect(1,1,1)

Re: XC_GameEngine [test build 6 - v451 Linux fix - CacheConv

Postby Higor » Tue Dec 16, 2014 9:02 pm

That's not possible for a few reasons:

- It's a whole new mess to make all subclasses point to the new superclass.
- A single missing function from the original code will cause a crash.
- Replication will attempt to send the new class to a client instead of the old one. (only if the actor is of a replaced class, not subclass)
- ClassIsChildOf( actor.Class, class'ScriptedPawn'); will be broken, unless I add yet another native function hack.
- You may not add new variables, the hack is only possible to do post-map load and by then some actors will already have been spawned.
- Doing so pre-map load is forbidden to avoid cheating.

What I can do:
Runtime script patcher/recompiler, triggered by either map load or console command (server or local play).
It'd be the same as the GetWeapon, SetEnemy, etc thing... but instead recompiled from a user defined file and targeting specific functions/states.
Higor
Godlike
 
Posts: 1642
Joined: Sun Mar 04, 2012 6:47 pm

Re: XC_GameEngine [test build 6 - v451 Linux fix - CacheConv

Postby sektor2111 » Tue Dec 16, 2014 10:55 pm

Higor wrote:It's a whole new mess to make all subclasses point to the new superclass.

I thought that a string hack would be enough ... :(
Higor wrote:A single missing function from the original code will cause a crash.

Not really missing... reworking them a bit. Example SeenPlayer: I think is much better to trace some actor (mover ?) before to deliver a positive response, as I have seen so far the tweak works for Bot (original ScriptedPawn issue), in other way I think is possible for Human Player a small check in order to stay relaxed without announcing position behind a door like in Local games. I gotta admit that ScriptedPawn needs almost a total rewrite (Bump, Trigger, SeenPlayer, SetEnemy, MeleeDamageTarget and other NastyDamageTarget - to not mention states AlarmPaused, Guarding, Patroling, etc.)

Okay then with these pawn related.

How about PlayerCanSeeMe()? Pawn.AdjustAim ? "Fighter" animation is missing from some classes but it was default-ed to mock much better... also stabilizing collision check ?
User avatar
sektor2111
Godlike
 
Posts: 3595
Joined: Sun May 09, 2010 6:15 pm
Location: vect(1,1,1)

Re: XC_GameEngine [test build 6 - v451 Linux fix - CacheConv

Postby Higor » Tue Dec 16, 2014 11:06 pm

sektor2111 wrote:I think is much better to trace some actor (mover ?) before to deliver a positive response

Higor wrote:- (Dedicated Server) Initialization and update of Moving Brush Tracker in Dedicated servers.
- (Dedicated Server) Moving brush tracker fix can be ignored on certain user-defined maps.

The moving brush tracker is what causes movers to block traces.
Higor
Godlike
 
Posts: 1642
Joined: Sun Mar 04, 2012 6:47 pm

Re: XC_GameEngine [test build 6 - v451 Linux fix - CacheConv

Postby sektor2111 » Wed Dec 17, 2014 7:31 am

In UScript I was toying at monsters Vs Bot using something like:
Code: Select all
function bool ValidSight(Pawn S,Bot aBot)
{
   local bool result;
   local actor HitActor;
   local vector HitLocation, HitNormal;

   result=False;
   if ( S == None || aBot == None )
      result=False;
   HitActor = Trace(HitLocation, HitNormal, S.Location, aBot.Location, false);
   if ( HitActor == None )
      result = True;
   return result;
}

Also Bot is more cute like this:
Code: Select all
function byte AssessBotAttitude(Bot aBot, Pawn Other)   //Added
{
   local name MState;

   MState=Other.GetStateName();

   if (!ValidSight(Other,aBot) || MState == 'Sitting')
      return 2;
   else if ( ValidSight(Other,aBot) && MState != 'Sitting')
   {
      if ( ( Other.bIsPlayer && Other.PlayerReplicationInfo != None && Other.PlayerReplicationInfo.Team == aBot.PlayerReplicationInfo.Team ) || Other.IsA('Nali') || Other.IsA('Cow') )
         return 3;
      if ( Other.IsA('TeamCannon') && TeamCannon(Other).MyTeam==0 )
         return 3;
      if ( !Other.bIsPlayer && Other.CollisionHeight < 75 )
         return 1;
      if ( !Other.bIsPlayer && Other.CollisionHeight >= 75 )
         return 0;
   }
   else return super(DeathMatchPlus).AssessBotAttitude(aBot, Other);
}

These: Monster tweak belongs to MH v5.04, and Bot tweak belongs to my other MH2 version, and would be more cute to have some... add-on directly into ScriptedPawn at Section SeenPlayer, because in maps like MH-AlienX and/or MH-AnnihilationV2 not works so much XC_Engine's mover hack and monster still got mad at player, to not mention that a Shock Combo still killed monster behind a door, including a redeemer blast. Is not happening all the time but it looks like "thin" movers still have problems.
Into NsMonster2 (a monster-package in work) I won't apply any tweak because those pawns are done for a war purpose attacking all enemy around (playable in a new NsCTF3 and NsDM3) but for MonsterHunt I think the mostly replacements will solve these problems.
User avatar
sektor2111
Godlike
 
Posts: 3595
Joined: Sun May 09, 2010 6:15 pm
Location: vect(1,1,1)

Re: XC_GameEngine [test build 6 - v451 Linux fix - CacheConv

Postby Higor » Wed Dec 17, 2014 6:07 pm

That ValidSight will never return true unless the bot is ethereal.
Also, log warnings.

Try:
Code: Select all
function bool ValidSight( Pawn Attacker, Pawn Victim)
{
    local vector HitLocation, HitNormal;
    local actor A;
    assert( Attacker != none ); //Crash the game if we're doing something wrong
    assert( Victim != none); //Remove at the end of development phase
    ForEach Attacker.TraceActors( class'Actor', A, HitLocation, HitNormal, Victim.Location)
    {
        if ( (A == Level) || (Mover(A) != none) )
            return false;
        if ( A == Victim )
            return true;
        if ( A.bIsPawn ) //Can see through other pawns
            continue;
        if ( A.bBlockActors || A.bProjTarget ) //Won't attack through things that block projectiles
            return false;
    }
    //This automatically returns false anyways, no need to use a statement
}
Higor
Godlike
 
Posts: 1642
Joined: Sun Mar 04, 2012 6:47 pm

Re: XC_GameEngine [test build 6 - v451 Linux fix - CacheConv

Postby sektor2111 » Wed Dec 17, 2014 6:39 pm

No, It isn't returning any error as long as is called directly from attraction code which is called by Bot not by None and is testing ScriptedPawn if exist one, I prefer more times a wrapping which is ignored by the most of people doing feign coding. Also Neither Bot Attitude deal won't bug anything as long as Bot asking attitude when get a contact with "Other" so It won't mess nothing. I wouldn't post them if they would be bugged :| .
Code: Select all
if ( SomeActorInCause != None && SomeActorInCause.Something != None )
{
DoActionHere(SomeActorInCause);
log ("Got the battle...");
}

Log speaks well because I checked function Trace at Wiki first, and later I set logs. When things went well I removed logs - indeed not all of them from everywhere.
In a MH version against racing, Bot fired at door in maps like AlienX KrogaarSE trying forever to kill enemy behind a locked door. This ValidSight helped a lot, they are interested about pawn direct traceable because I was careful at code syntax described at Wiki. Ouch, I forgot to mention CanFireAtEnemy which is another bugged thing and that's why sometimes Bot shoot walls into enemy's direction (I cannot very block this because they tend to help each-other copying enemy from a teammate without taking geometry in account). But is much better anyway.
For a new prototype of monster, if is not dedicated for MonsterHunt I'm not interested so much in blocking them. Mod ruins mover very nice in order to be accessed by any pawn not only by Bot and Human Player.
Trace has basically 2 options prefered by me:
HitActor = Trace(HitLocation, HitNormal, S.Location, aBot.Location, false); - ignoring non-geometry actors, like their own body;
HitActor = Trace(HitLocation, HitNormal, S.Location, aBot.Location, true); - takes in account other actors - I don't love this because I need to compute own body cylinder.
Is much better to look at PlanetMonsterHunt for MH version 5.04 and see console... Bot won't ever attack a monster behind an un-opened door yet but will fight with Monster which has ValidSight - it is in fact a modification of CanFireAtEnemy which has really MANY chances to return True.
User avatar
sektor2111
Godlike
 
Posts: 3595
Joined: Sun May 09, 2010 6:15 pm
Location: vect(1,1,1)

Re: XC_GameEngine [test build 6 - v451 Linux fix - CacheConv

Postby Chamberly » Sun Dec 21, 2014 10:16 am

Using xConsole (version rc64) with this Engine, I typed in set input e say Hello in the console awhile on my server and it doesn't say Hello. :(
Now without xConsole, it works. O_o
Image
Image
irc.globalgamers.net #uscript
http://irc.lc/globalgamers/uscript
Image
User avatar
Chamberly
Godlike
 
Posts: 1632
Joined: Sat Sep 17, 2011 4:32 pm
Location: TN, USA
Personal rank: Dame. Vandora

Re: XC_GameEngine [test build 6 - v451 Linux fix - CacheConv

Postby Higor » Sun Dec 21, 2014 4:54 pm

Just tested the command and found the bug, noted.

In the meantime if you're using a value that contains spaces, input the array number as well:
- Set input Z 0 say stuff
Use that 0 to temporarily work around the issue until next release.
Higor
Godlike
 
Posts: 1642
Joined: Sun Mar 04, 2012 6:47 pm

Re: XC_GameEngine [test build 6 - v451 Linux fix - CacheConv

Postby Chamberly » Sun Dec 21, 2014 8:25 pm

Ok, thanks! :)
Image
Image
irc.globalgamers.net #uscript
http://irc.lc/globalgamers/uscript
Image
User avatar
Chamberly
Godlike
 
Posts: 1632
Joined: Sat Sep 17, 2011 4:32 pm
Location: TN, USA
Personal rank: Dame. Vandora

PreviousNext

Return to Discussions

Who is online

Users browsing this forum: No registered users and 1 guest