Jump to content

Recommended Posts

Good afternoon!

 

I have been having quite a few issues with my custom tank's physX.

I'm really not sure how to describe it, so here's two videos so you can see what it does. At first the wheels would sink into the ground, then they were all above ground but the tank seemed to be floating over the wheels, which were stuck to the ground (so it was functional, but tank was on sort of invisible stretchers to the wheels) speed has never gone over 14km/h.

 

Tank1

 

EDIT: Forgot to mention, if I come out of the tank, it starts sliding sideways, as shown in the next video:

 

Tank2

 

 

So there are 13 wheels on each side, but PhysX only supports 10 per side. So from wheels 3 to 11, they are touching ground. Those are the specified in the config "wheels" physX part with their podkolo PLUS the rear wheels, as said in samples "must be present anyway"

Tweaking around the sprungmass, springstrengh..etc I found out I had wrong values. Now that they are supposedly correct, the tank just bobs from one side to the other... and when you accelerate, the nose pulls down and bottom pulls up, rather like it would do while BREAKING..? While on the other hand, the nose pulls up and bottom down when breaking... weird.

 

Anyway, here are some screens of the model LODs, and wheel-relevant config info / model.cfg

 

Resolution LOD

memory LOD

LandContact LOD

Geometry LOD

GeomPhysX LOD

 

Config:

		simulation = "tankX";

        maxSpeed=24;	
		normalSpeedForwardCoef = 0.4;		
		changeGearMinEffectivity[] = {0.5,0.15,0.95,0.95,0.95,0.95,0.95,0.95,0.95,0.95,0.95,0.95,0.9,0.9,0.9,0.9,0.9};
		torqueCurve[] = {{"(0/0)"},{"(0.14/0.58)"},{"(0.29/0.81)"},{"(0.43/0.94)"},{"(0.57/1)"},{"(0.71/0.98)"},{"(0.86/0.87)"},{"(1/0.03)"}};
		
		thrustDelay			= 1;    	/// how much time does it take to get the full thrust (default 1), used to reduce initial wheel slipping
		clutchStrength 		= 180.0;
		fuelCapacity		= 1885;
		brakeIdleSpeed		= 1; 	/// speed in m/s below which braking is applied
		latency 			= 0.1;
		tankTurnForce		= 458700; /// Random magic number, expected to be something like 11 x mass of vehicle

		/// Gearbox and transmission
		idleRpm = 700; // RPM at which the engine idles.
		redRpm = 2640; // RPM at which the engine redlines.

		engineLosses = 25; // power losses on the engine's crank-shaft (before the gearbox) in Nm. (Multiplied by the gear ratio)
		transmissionLosses = 15; // power losses on wheel axis (in/after the gearbox) in Nm. (Constant)

		class complexGearbox
		{
			driveString = "D";
			gearBoxMode = "auto";
			GearboxRatios[] = {"R2",-3,"N",0,"D1",2,"D2",1.2,"D3",0.8,"D4",0.6,"D5",0.5};
			moveOffGear = 1;
			neutralString = "N";
			reverseString = "R";
			transmissionDelay = 0.1;
			TransmissionRatios[] = {"High",12};
		};
		
		numberPhysicalWheels = 20;
		
		class Wheels		///MAX of 10 PHYSX wheels per side! or crash!
		{
			class L1
			{				
				boneName = "wheel_podkoloL1";
				center   = "wheel_1_3_axis";
				boundary = "wheel_1_3_bound";
				damping = 75;
				steering = 0;
				side = "left";
				mass = 150;  //peso en kg de la rueda
				weight = 150;
				maxBrakeTorque = 40000;	//2000
				latStiffX = 25;
				latStiffY = 280;
				longitudinalStiffnessPerUnitGravity = 100000;
				sprungMass = 2320;
				springStrength = 58000;
				springDamperRate = 9281;
				
				dampingRate = 1;
				dampingRateInAir = 8830;
				dampingRateDamaged = 10;
				dampingRateDestroyed = 10000;
				MOI = 25;
				
				maxDroop = 0.18;
				maxCompression = 0.18;
				frictionVsSlipGraph[] = {{0,5},{0.5,5},{1,5}};
				
			};
			class L3: L1
			{
				boneName = "wheel_podkoloL2";
				center   = "wheel_1_4_axis";
				boundary = "wheel_1_4_bound";
			};
			class L4: L1
			{
				boneName = "wheel_podkoloL3";
				center   = "wheel_1_5_axis";
				boundary = "wheel_1_5_bound";
			};
			class L5: L1
			{
				boneName = "wheel_podkoloL4";
				center   = "wheel_1_6_axis";
				boundary = "wheel_1_6_bound";
			};
			class L6: L1
			{
				boneName = "wheel_podkoloL5";
				center   = "wheel_1_7_axis";
				boundary = "wheel_1_7_bound";
			};
			class L7: L1
			{
				boneName = "wheel_podkoloL6";
				center   = "wheel_1_8_axis";
				boundary = "wheel_1_8_bound";
			};
			class L8: L1
			{
				boneName = "wheel_podkoloL7";
				center   = "wheel_1_9_axis";
				boundary = "wheel_1_9_bound";
			};
			class L9: L1
			{
				boneName = "wheel_podkoloL8";
				center   = "wheel_1_10_axis";
				boundary = "wheel_1_10_bound";
			};
			class L10: L1
			{
				boneName = "wheel_podkoloL9";
				center   = "wheel_1_11_axis";
				boundary = "wheel_1_11_bound";
			};

			// rear left wheel, usually Idler or Drive Sproket
			// Note, this wheel may not always be touching the ground, but we need it anyway!
			
			class L2: L1 //kolP2
			{
				boneName = "";
				center   = "wheel_1_12_axis";
				boundary = "wheel_1_12_bound";
				
				maxDroop = 0;
				maxCompression = 0;
				
			};
			
		//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
			class R1: L1
			{
				boneName = "wheel_podkoloP1";
				center   = "wheel_2_3_axis";
				boundary = "wheel_2_3_bound";
				side = "right";
			};
			class R3: R1
			{
				boneName = "wheel_podkoloP2";
				center   = "wheel_2_4_axis";
				boundary = "wheel_2_4_bound";
			};
			class R4: R1
			{
				boneName = "wheel_podkoloP3";
				center   = "wheel_2_5_axis";
				boundary = "wheel_2_5_bound";
			};
			class R5: R1
			{
				boneName = "wheel_podkoloP4";
				center   = "wheel_2_6_axis";
				boundary = "wheel_2_6_bound";
			};
			class R6: R1
			{
				boneName = "wheel_podkoloP5";
				center   = "wheel_2_7_axis";
				boundary = "wheel_2_7_bound";
			};
			class R7: R1
			{
				boneName = "wheel_podkoloP6";
				center   = "wheel_2_8_axis";
				boundary = "wheel_2_8_bound";
			};
			class R8: R1
			{
				boneName = "wheel_podkoloP7";
				center   = "wheel_2_9_axis";
				boundary = "wheel_2_9_bound";
			};
			class R9: R1
			{
				boneName = "wheel_podkoloP8";
				center   = "wheel_2_10_axis";
				boundary = "wheel_2_10_bound";
			};
			class R10: R1
			{
				boneName = "wheel_podkoloP9";
				center   = "wheel_2_11_axis";
				boundary = "wheel_2_11_bound";
			};

			// rear right wheel, usually Idler or Drive Sproket
			// Note, this wheel may not always be touching the ground, but we need it anyway!
			class R2: L2
			{
				boneName = "";
				center   = "wheel_2_12_axis";
				boundary = "wheel_2_12_bound";	
				side = "right";
				
				maxDroop = 0;
				maxCompression = 0;
			};
		};
		
		selectionLeftOffset = "PasOffsetL";
		selectionRightOffset = "PasOffsetP";
		memoryPointTrack1L = "Stopa LL";
		memoryPointTrack1R = "Stopa LR";
		memoryPointTrack2L = "Stopa RL";
		memoryPointTrack2R = "Stopa RR";
		
		steerAheadSimul = 0.5;
		steerAheadPlan = 0.35;
		predictTurnPlan = 2.8;
		predictTurnSimul = 2.6;
		brakeDistance = 15;
		precision = 5;

		wheelCircumference = 0.4;
		tracksSpeed = 1;

And the model.cfg wheel relation:

 

#define ADD_COMPONENT(component) \
	class Add##component \
	{ \
		selection = z_##component; \
		source = Add##component; \
		type = hide; \
		sourceAddress = mirror; \
		minValue = -1; \
		maxValue = 0; \
		hideValue = 0.5; \
	};

class Rotation
{
	type = "rotation";
	memory = 1;
	minValue = 0;
	maxValue = 1;
	angle0 = 0;
	angle1 = 1;
};

class CfgSkeletons
{
	class Default
	{
		isDiscrete = 1;
		skeletonInherit = "";
		skeletonBones[] = {};
	};
	class Vehicle: Default {};
	class TankBase: Vehicle {};
	class 7Y_churchill_01_skeleton: TankBase
	{
		skeletonInherit = "TankBase";
		skeletonBones[] =
		{
			
			"wheel_1_1","",
			"wheel_1_2","",
			"wheel_1_12","",
			"wheel_1_13","",
			
			"wheel_2_1","",
			"wheel_2_2","",
			"wheel_2_12","",
			"wheel_2_13","",
			
			"podkoloL1","",
			"podkoloL2","",
			"podkoloL3","",
			"podkoloL4","",
			"podkoloL5","",
			"podkoloL6","",
			"podkoloL7","",
			"podkoloL8","",
			"podkoloL9","",
			
			
			"podkoloP1","",
			"podkoloP2","",
			"podkoloP3","",
			"podkoloP4","",
			"podkoloP5","",
			"podkoloP6","",
			"podkoloP7","",
			"podkoloP8","",
			"podkoloP9","",
			
			
			"wheel_1_3","podkoloL1",
			"wheel_1_4","podkoloL2",
			"wheel_1_5","podkoloL3",
			"wheel_1_6","podkoloL4",
			"wheel_1_7","podkoloL5",
			"wheel_1_8","podkoloL6",
			"wheel_1_9","podkoloL7",
			"wheel_1_10","podkoloL8",
			"wheel_1_11","podkoloL9",
			
			
			"wheel_2_3","podkoloP1",
			"wheel_2_4","podkoloP2",
			"wheel_2_5","podkoloP3",
			"wheel_2_6","podkoloP4",
			"wheel_2_7","podkoloP5",
			"wheel_2_8","podkoloP6",
			"wheel_2_9","podkoloP7",
			"wheel_2_10","podkoloP8",
			"wheel_2_11","podkoloP9",
			
			"damageHide","",
			"podkoloL1_hide","podkoloL1",
			"podkoloL2_hide","podkoloL2",
			"podkoloL3_hide","podkoloL3",
			"podkoloL4_hide","podkoloL4",
			"podkoloL5_hide","podkoloL5",
			"podkoloL6_hide","podkoloL6",
			"podkoloL7_hide","podkoloL7",
			"podkoloL8_hide","podkoloL8",
			"podkoloL9_hide","podkoloL9",
			
			"podkoloP1_hide","podkoloP1",
			"podkoloP2_hide","podkoloP2",
			"podkoloP3_hide","podkoloP3",
			"podkoloP4_hide","podkoloP4",
			"podkoloP5_hide","podkoloP5",
			"podkoloP6_hide","podkoloP6",
			"podkoloP7_hide","podkoloP7",
			"podkoloP8_hide","podkoloP8",
			"podkoloP9_hide","podkoloP9",
			
			"main_trav","",
			"commander_turret","main_trav",
			"main_elev","main_trav",
			"cannonMG","main_elev",
			"zasleh","main_elev",
			"recoilHlaven",	"main_elev",
			"gunnerview","main_elev",
			"zasleh2","main_elev",
			/*
			"OtocVelitele","",
			"OtocHlavenVelitele","OtocVelitele",
			*/
			"loader_trav","",
			"loader_elev","loader_trav",
			"loaderview","loader_elev",
			"zasleh3","loader_elev",
			
			"hatch_driver_A","",
			"hatch_driver_B","",
			"hatch_loader_A","",
			"hatch_loader_B","",
			"hatch_commander_A","main_trav",
			"hatch_commander_B","main_trav",
			"hatch_gunner_A","main_trav",
			"hatch_gunner_B","main_trav",
			
			"damageVez","main_trav"

		};
	};
};

class CfgModels
{
	class Default
	{
		sectionsInherit = "";
		sections[] = {};
		skeletonName = "";
	};
	class Vehicle: Default {};
	class Tank : Vehicle {};
	
	class 7Y_churchill: Tank
	{
		htMin = 60;		// Minimum half-cooling time (in seconds)
		htMax = 1800;	// Maximum half-cooling time (in seconds)
		afMax = 200;	// Maximum temperature in case the model is alive (in celsius)
		mfMax = 100;	// Maximum temperature when the model is moving (in celsius)
						// mFact & tBody used to simulate main gun heat
		mFact = 1;		// Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)).
		tBody = 250;	// Metabolism temperature of the model (in celsius)
		
		skeletonName = "7Y_churchill_01_skeleton";
		sections[] =
		{

			"PasOffsetP",
			"PasOffsetL",
			"pas_L",
			"pas_P",
			"motor",
			"vez",
			"zbran",
			"clan",
			"clan_sign",
			"Light_L",
			"Light_R",
			"zbytek",
			"Camo1",
			"zasleh2",
			"zasleh3",
			"zasleh",
			"main_elev",
			"main_trav",
			"loader_elev",
			"loader_trav"
		};

		class Animations
		{
			class damageHide
			{
				type="hide";
				source="damage";
				selection="damageHide";
			};
						
			//////////////NOT TOUCHING GROUND LEFT///////////////
			
			class Wheel_kolL1
			{
				type="rotationX";
				source="wheelL";
				selection="wheel_1_1";
				axis="";
				memory="false";
				animPeriod=0;
				minvalue=0.5;
				maxvalue = 1.0;
				angle0=0;
				angle1="rad -360";
				sourceAddress="loop";
			};
			
			class Wheel_kolL2: Wheel_kolL1
			{
				selection="wheel_1_2";
			};
			
			class Wheel_kolL3: Wheel_kolL1
			{
				selection="wheel_1_12";
			};
			class Wheel_kolL4: Wheel_kolL1
			{
				selection="wheel_1_13";
			};

			//////////////NOT TOUCHING GROUND RIGHT///////////////
			
			class Wheel_kolP1: Wheel_kolL1
			{
				source="wheelR";
				selection="wheel_2_1";
			};
			class Wheel_kolP2: Wheel_kolP1
			{
				selection="wheel_2_1";
			};
			
			class Wheel_kolP3: Wheel_kolP1
			{
				selection="wheel_2_2";
			};
			class Wheel_kolP4: Wheel_kolP1
			{
				selection="wheel_2_12";
			};
			
			class Wheel_kolP5: Wheel_kolP1
			{
				selection="wheel_2_13";
			};
			
			///////////////////WHEELS LEFT///////////////////////
			
			class Wheel_koloL1: Wheel_kolL1
			{
				selection="wheel_1_3";
			};
						
			class Wheel_koloL2: Wheel_koloL1
			{
				selection="wheel_1_4";
			};
			class Wheel_koloL3: Wheel_koloL1
			{
				selection="wheel_1_5";
			};
			class Wheel_koloL4: Wheel_koloL1
			{
				selection="wheel_1_6";
			};
			class Wheel_koloL5: Wheel_koloL1
			{
				selection="wheel_1_7";
			};
			class Wheel_koloL6: Wheel_koloL1
			{
				selection="wheel_1_8";
			};
			class Wheel_koloL7: Wheel_koloL1
			{
				selection="wheel_1_9";
			};
			class Wheel_koloL8: Wheel_koloL1
			{
				selection="wheel_1_10";
			};
			class Wheel_koloL9: Wheel_koloL1
			{
				selection="wheel_1_11";
			};
						
			///////////////////WHEELS RIGHT///////////////////////
			
			class Wheel_koloP1: Wheel_koloL1
			{
				source="wheelR";
				selection="wheel_2_3";
			};
			
			class Wheel_koloP2: Wheel_koloP1
			{
				selection="wheel_2_4";
			};
			class Wheel_koloP3: Wheel_koloP1
			{
				selection="wheel_2_5";
			};
			class Wheel_koloP4: Wheel_koloP1
			{
				selection="wheel_2_6";
			};
			class Wheel_koloP5: Wheel_koloP1
			{
				selection="wheel_2_7";
			};
			class Wheel_koloP6: Wheel_koloP1
			{
				selection="wheel_2_8";
			};
			class Wheel_koloP7: Wheel_koloP1
			{
				selection="wheel_2_9";
			};
			class Wheel_koloP8: Wheel_koloP1
			{
				selection="wheel_2_10";
			};
			class Wheel_koloP9: Wheel_koloP1
			{
				selection="wheel_2_11";
			};
			
			///////////////////SUSPENSION LEFT/////////////////////////
			
			class Wheel_podkoloL1
			{
				type="translation";
				source="damper";
				selection="podkoloL1";
				axis="Basic_Damper_Destruct_Axis";
				memory="true";
				animPeriod=0;
				minValue="0";
				maxValue="1";
				offset0= "-0.18";
				offset1= "0.18";
			};
						
			class Wheel_podkoloL2: Wheel_podkoloL1
			{
				selection="podkoloL2";
			};
			class Wheel_podkoloL3: Wheel_podkoloL1
			{
				selection="podkoloL3";
			};
			class Wheel_podkoloL4: Wheel_podkoloL1
			{
				selection="podkoloL4";
			};
			class Wheel_podkoloL5: Wheel_podkoloL1
			{
				selection="podkoloL5";
			};
			class Wheel_podkoloL6: Wheel_podkoloL1
			{
				selection="podkoloL6";
			};
			class Wheel_podkoloL7: Wheel_podkoloL1
			{
				selection="podkoloL7";
			};
			class Wheel_podkoloL8: Wheel_podkoloL1
			{
				selection="podkoloL8";
			};
			class Wheel_podkoloL9: Wheel_podkoloL1
			{
				selection="podkoloL9";
			};
			
			///////////////////SUSPENSION RIGHT/////////////////////////
			
			class Wheel_podkoloP1: Wheel_podkoloL1
			{
				selection="podkoloP1";
			};
			
			class Wheel_podkoloP2: Wheel_podkoloP1
			{
				selection="podkoloP2";
			};
			class Wheel_podkoloP3: Wheel_podkoloP1
			{
				selection="podkoloP3";
			};
			class Wheel_podkoloP4: Wheel_podkoloP1
			{
				selection="podkoloP4";
			};
			class Wheel_podkoloP5: Wheel_podkoloP1
			{
				selection="podkoloP5";
			};
			class Wheel_podkoloP6: Wheel_podkoloP1
			{
				selection="podkoloP6";
			};
			class Wheel_podkoloP7: Wheel_podkoloL1
			{
				selection="podkoloP7";
			};
			class Wheel_podkoloP8: Wheel_podkoloL1
			{
				selection="podkoloP8";
			};
			class Wheel_podkoloP9: Wheel_podkoloL1
			{
				selection="podkoloP9";
			};

			/////////////////////////////////////////////////////////////
			
			class podkoloL1_hide_damage: damageHide
			{
				selection="podkoloL1_hide";
			};
			class podkoloL2_hide_damage: damageHide
			{
				selection="podkoloL2_hide";
			};
			class podkoloL3_hide_damage: damageHide
			{
				selection="podkoloL3_hide";
			};
			class podkoloL4_hide_damage: damageHide
			{
				selection="podkoloL4_hide";
			};
			class podkoloL5_hide_damage: damageHide
			{
				selection="podkoloL5_hide";
			};
			class podkoloL6_hide_damage: damageHide
			{
				selection="podkoloL6_hide";
			};
			class podkoloL7_hide_damage: damageHide
			{
				selection="podkoloL7_hide";
			};
			class podkoloL8_hide_damage: damageHide
			{
				selection="podkoloL8_hide";
			};
			class podkoloL9_hide_damage: damageHide
			{
				selection="podkoloL9_hide";
			};
			
			//////////////////////////////////////////////////////////////
			class podkoloP1_hide_damage: damageHide
			{
				selection="podkoloP1_hide";
			};
			class podkoloP2_hide_damage: damageHide
			{
				selection="podkoloP2_hide";
			};
			class podkoloP3_hide_damage: damageHide
			{
				selection="podkoloP3_hide";
			};
			class podkoloP4_hide_damage: damageHide
			{
				selection="podkoloP4_hide";
			};
			class podkoloP5_hide_damage: damageHide
			{
				selection="podkoloP5_hide";
			};
			class podkoloP6_hide_damage: damageHide
			{
				selection="podkoloP6_hide";
			};
			class podkoloP7_hide_damage: damageHide
			{
				selection="podkoloP7_hide";
			};
			class podkoloP8_hide_damage: damageHide
			{
				selection="podkoloP8_hide";
			};
			class podkoloP9_hide_damage: damageHide
			{
				selection="podkoloP9_hide";
			};
			
			//////////////////////////////////////////////////////////////

 

 

 

Thanks for your time!

 

 

Loki.

Edited by 7Y-Loki
missing info

Share this post


Link to post
Share on other sites

The problem with tanks only going max 14km/h is often because the wheels are in different sizes in the memory lod, so try to make sure that the wheel_axis and wheel_bound are the same distance from each other on every wheel.

Share this post


Link to post
Share on other sites
3 hours ago, Whitefame said:

The problem with tanks only going max 14km/h is often because the wheels are in different sizes in the memory lod, so try to make sure that the wheel_axis and wheel_bound are the same distance from each other on every wheel.

 

Thanks for your answer! That includes front/rear sprokets? Even wheels not touching ground? (Different sized wheels)

Share this post


Link to post
Share on other sites
38 minutes ago, 7Y-Loki said:

 

Thanks for your answer! That includes front/rear sprokets? Even wheels not touching ground? (Different sized wheels)

Yeah all wheels that uses physX so front/rear sprockets included, the visual model can be bigger/smaller thou. 

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×