### Trying to Compile Engine Changes(TAIK) using Linux

Expanding and utilizing the engine via C++.

#### Trying to Compile Engine Changes(TAIK) using Linux

Jason Campbell
Posts: 162
Joined: Fri Feb 13, 2015 2:51 am

I recently have been using Torque 3D 3.5 in WINE on Linux so I can utilize Bryce's incredible Tactical AI Kit. Nothing would make me happier then getting TAIK to work natively in Linux. Looking at the changes, it may be possible even in 3,10. I could continue in 3.5 but there are some issues with using WINE, crashes and what not, though performance is surprisingly good.

My questions is basically, how do I add new files to the Engine if I can't use the Project Solution from Visual Studio?

How do I add files,filters and existing items using CMAKE?

Any help or tips would be greatly appreciated.

#### Re: Trying to Compile Engine Changes(TAIK) using Linux

Azaezel
Posts: 383
Joined: Tue Feb 03, 2015 9:50 pm

#### Re: Trying to Compile Engine Changes(TAIK) using Linux

Jason Campbell
Posts: 162
Joined: Fri Feb 13, 2015 2:51 am

Thanks, that might work. Plus, I was wondering exactly how to add modules anyway.

The reason it might not work is that, there is a folder named recast inside of a folder named nav and his example in Visual studio has recast nested in nav, as "filters". I thought I had it set up in Code::Blocks but I can't do it again.

Anyway, just to clarify, I could add afx using CMAKE GUI or by editing CMakeCache.txt?

Thanks for responding.

#### Re: Trying to Compile Engine Changes(TAIK) using Linux

Azaezel
Posts: 383
Joined: Tue Feb 03, 2015 9:50 pm

That method above adds a (pre-flipped) flag to cmake gui. Recast is already included in head, so won't need to do so twice.

#### Re: Trying to Compile Engine Changes(TAIK) using Linux

Jason Campbell
Posts: 162
Joined: Fri Feb 13, 2015 2:51 am

OK now I get it. I also think I'm beginning to understand why they are called filters. The Tactical AI Kit must use a modified recast.

I'll look more Intel VS and what is meant by filters.

#### Re: Trying to Compile Engine Changes(TAIK) using Linux

Jason Campbell
Posts: 162
Joined: Fri Feb 13, 2015 2:51 am

God, I'm so close to getting this working.

Originally Bryce said that any NavMesh and Recast will work fine as long as NavMesh is called Mesh1.

Well I finally got it to Build with 0 errors and everything seems to work except the NavMesh is not seen. The AI tries to walk the NavPath but fails. Here is the error

Code: Select all

==>SpawnAI(0,0,2);No NavMesh polygon near visit point (0, 0, 0) of NavPath 21855brain.weapon = TAIKGunImage, brain.ammo = TAIKGunAmmoAI player spawned. Id: 21852. Team: 0. Brain: 2185621852No NavMesh polygon near visit point (32.0894, 44.4581, 4.63566) of NavPath 21855Set::getObject - index out of range.scripts/server/ai/aiplayer/aiplayer.cs (862): Unable to find object: '' attempting to call function 'getPosition'21852: On path 20701, moving to node at index 0No NavMesh polygon near visit point (32.0894, 44.4581, 4.63566) of NavPath 21855Set::getObject - index out of range.scripts/server/ai/aiplayer/aiplayer.cs (862): Unable to find object: '' attempting to call function 'getPosition'21852: On path 20701, moving to node at index 0

I saw this error in an old GG post of Daniel's and tried his suggestion of changing mTypeMask |= StaticShapeObjectType | MarkerObjectType; to mTypeMask |= MarkerObjectType; but that didn't fix it.

This is killing me. Any suggestion, please.

One other thing. I'm getting a crash every so often

Code: Select all

Torque3D-3.10/Engine/source/core/stream/bitStream.cpp(339,0): {Fatal} - BitStream::writeInt: value out of range: -23/128 (7 bits)

I searched and it seems to be a network problem? I'm not checking my network when it occurs. Any thoughts on that would be appreciated.

Thank you

#### Re: Trying to Compile Engine Changes(TAIK) using Linux

Azaezel
Posts: 383
Joined: Tue Feb 03, 2015 9:50 pm

Well, I can say -23/128 (7 bits) report tells us you're sending something along the network that expects a 7 bit range of 0-128, and it thinks youre trying to feed it a -23 (could be that, or could be wrapping. Half the reason for throwing that in for folks a while back was it used to be a silent network leak that would corrupt other stuff down the line. With that, should be able to turn up the exact cause with a stack trace.)

#### Re: Trying to Compile Engine Changes(TAIK) using Linux

Jason Campbell
Posts: 162
Joined: Fri Feb 13, 2015 2:51 am

Don't mean to be a pain but could you point in the direction of how to go about doing a stack trace?

I used to be able to debug with Torsion but doesn't work with linux.

Thanks

#### Re: Trying to Compile Engine Changes(TAIK) using Linux

Azaezel
Posts: 383
Joined: Tue Feb 03, 2015 9:50 pm

http://darkdust.net/files/GDB%20Cheat%20Sheet.pdf cheat sheet
https://github.com/GarageGames/Torque3D ... .cpp#L1399 and you'll be looking for a line along those lines ( note the 7 bit length specification matching the error report.)

#### Re: Trying to Compile Engine Changes(TAIK) using Linux

Jason Campbell
Posts: 162
Joined: Fri Feb 13, 2015 2:51 am

I can't believe but it appears I have everything working correctly. I didn't think I would get this far really. I seemed to have squashed the other "value out range" problems but have a new one and I'm going mad. I haven't slept well in days. Okay.

This is the new one
Engine/source/core/stream/bitStream.cpp(339,0): {Fatal} - BitStream::writeInt: value out of range: -1/64 (6 bits)

I'm pretty sure it stems from this in player.cpp
stream->writeSignedFloat(fTranquilized, 6);

It seems to be a variable that effects speed while the players are zoomed and it crashes almost every time when I'm getting melee'd by an AIPlayer.

I'm just going to post the snippets from everywhere I can find it. Maybe if someone can think of a work around to keep it a positive number or something. It seems to be consistently fatal with a -1 value.

Any help would be appreciated. Thank you.

player.h
488         F32 fTranquilized;733         void Player::setTranquilized(const F32 & tranquilized);  734         const F32 & Player::getTranquilized();

player.cpp
1673        fTranquilized=0.0f;2801                 if(doStandardMove)2802                {2803                         F32 p = move->pitch * (mPose == SprintPose ? mDataBlock->sprintPitchScale : 1.0f);2804		 if (fTranquilized>0.0f) p+=fTranquilized * mSin((F32)Sim::getCurrentTime()/200.0f); //TAIKWeapons++2805                     if (p > M_PI_F) 2806                        p -= M_2PI_F;2807                     mHead.x = mClampF(mHead.x + p,mDataBlock->minLookAngle,2808                                         mDataBlock->maxLookAngle);2836                    F32 y = move->yaw * (mPose == SprintPose ? mDataBlock->sprintYawScale : 1.0f);2837		 if (fTranquilized>0.0f) y+=fTranquilized * mCos((F32)Sim::getCurrentTime()/300.0f); //TAIKWeapons++2838                      if (y > M_PI_F)2839                       y -= M_2PI_F;6833                  stream->writeSignedFloat(fTranquilized, 6); 6929                   fTranquilized = stream->readSignedFloat(6);(lines 7131 to 7149)ConsoleMethod( Player, IsTranquilized, F32, 2, 2, "Return if tranquilizer is enabled.")  {     Player* obj = static_cast<Player*>(object);     return obj->getTranquilized();  }    ConsoleMethod( Player, SetTranquilized, void, 3, 3, "(F32) Sets tranquilizer.")  {     Player* obj = static_cast<Player*>(object);     obj->setTranquilized(dAtof(argv[2]));  } const F32 & Player::getTranquilized() {      return fTranquilized;  }    void Player::setTranquilized(const F32 & tranquilized) {      fTranquilized = tranquilized;  }

TorqueScript(TAIKZoom.cs)
function serverCmdCallZoomFunction( %client, %out ){   %zoomer = %client.getControlObject();   //%curWeapon = %zoomer.getMountedImage($WeaponSlot).item.getName(); //%curWeapon = %zoomer.getMountedImage($WeaponSlot);   %zoomer.handleZoom(%out);}function Player::handleZoom(%this,%out){  %iS = %this.getImageState(0);  if (%this.isLeaning && !%out)    return;  if (%is $= "GLReady" || %is$= "GLActivate" || %is $= "GLPutAway" || %is$= "GLReload")    return;  if (%iS $= "ReloadClip") %out = true; if (%iS !$= "Ready" && %is !$= "NoAmmo" && %is !$= "DryFire" && %is !$= "Activate") %out = true; if (!%this.zoomOn && !%out) { %this.zoomOn = true; %this.setSpeedMult(0.5); %this.setTranquilized(0.0002); // Figure out what type of sights we should be using if (%this.getMountedImage(2)) { if (%this.getMountedImage(2).getName()$= "M68Image" || %this.getMountedImage(2).getName() $= "SquareDotImage" || %this.getMountedImage(2).getName()$= "CMoreImage" || %this.getMountedImage(2).getName() $= "GlockDotImage" || %this.getMountedImage(2).getName()$= "EOTechImage" || %this.getMountedImage(2).getName() $= "AKDotImage" || %this.getMountedImage(2).getName()$= "F2000DotImage")      {        // Red dot        %sightType = 2;      }      else if (%this.getMountedImage(2).getName() $= "AUGScopeImage") { //2x AUG Scope %sightType = 5; } else if (%this.getMountedImage(2).getName()$= "M4HandleImage" || %this.getMountedImage(2).getName() $= "M16HandleImage" || %this.getMountedImage(2).getName()$= "F2000IronImage")      {      	// Iron sight      	%sightType = 1;      }      else      {        // ACOG        if (%this.getMountedImage(2).getName() $= "ACOG1Image" || %this.getMountedImage(2).getName()$= "AKACOGImage")        	%sightType = 3;        else          %sightType = 4; // Default sniper scope      }    }    else    {      if (%this.getMountedImage(0).permanentScope)      {        // Scope that cannot be dismounted        %sightType = 3;      }      else      {        // Iron sights        %sightType = 1;      }    }  }  else  {    %this.zoomOn = false;    %sightType = 0;    %this.setSpeedMult(1.0);    %this.setTranquilized(0);  }  %cScope = %this.getMountedImage(0).scope;  %wName = %this.getMountedImage(0).getName();  if (%wName $= "M24Image" || %wName$= "M110Image" || %wName \$= "M14Image")    if (%sightType != 3)      %cScope = "M24Scope";  commandToClient(%this.client,'ZoomClientSide',%sightType,%this.getMountedImage(0).getName(),%cScope);}

#### Who is online

Users browsing this forum: No registered users and 2 guests