Battlezone Universe

Battlezone Universe => Battlezone 2 => Topic started by: appel on July 24, 2008, 08:25:21 AM

Title: BZ2 hovercraft physics
Post by: appel on July 24, 2008, 08:25:21 AM
Hi

I'm making a game demo and I want to include a BZ2-like hovercraft unit, that handles in the same way as a BZ2 hovercraft unit.

What information I need is all the variables that are used for the physics of the unit, and a short description of those variable.

Thank you :)
Title: Re: BZ2 hovercraft physics
Post by: Red Devil on July 24, 2008, 09:57:11 AM
How's this?

[HoverCraftClass]
velocForward = 30.0 //
velocReverse = 18.0 //
velocStrafe = 14.0 //
accelThrust = 24.0 //acceleration
accelBrake = 75.0 //braking
accelDragStop = 5.8 //how fast it stops once hands are off controls
accelJump = 15.0

setAltitude = 1.0 // how high off the ground

alphaTrack = 22.0 //springs speed it rights itself
alphaDamp = 8.0 //shocks

pitchPitch = 0.19 //nose up
pitchThrust = 0.09 //nose down

rollStrafe = 0.01 //rolls while strafing
omegaSpin = 6.0 //spinning in place speed
omegaTurn = 2.0 //turning while moving speed
alphaSteer = 4.5 //how fast it responds to steering
rollSteer = 0.1 //rolls while steering
Title: Re: BZ2 hovercraft physics
Post by: appel on July 24, 2008, 10:14:57 AM
Quote from: Red Devil on July 24, 2008, 09:57:11 AM
How's this?

[HoverCraftClass]
velocForward = 30.0 //
velocReverse = 18.0 //
velocStrafe = 14.0 //
accelThrust = 24.0 //acceleration
accelBrake = 75.0 //braking
accelDragStop = 5.8 //how fast it stops once hands are off controls
accelJump = 15.0

setAltitude = 1.0 // how high off the ground

alphaTrack = 22.0 //springs speed it rights itself
alphaDamp = 8.0 //shocks

pitchPitch = 0.19 //nose up
pitchThrust = 0.09 //nose down

rollStrafe = 0.01 //rolls while strafing
omegaSpin = 6.0 //spinning in place speed
omegaTurn = 2.0 //turning while moving speed
alphaSteer = 4.5 //how fast it responds to steering
rollSteer = 0.1 //rolls while steering


Thank, what I needed. I might need some more description of the following:

QuotepitchPitch = 0.19 //nose up
pitchThrust = 0.09 //nose down
I know what pitch is but how do these variables control the pitch of the hovercraft? Is there a maxUpPitch and maxDownPitch? What does pitchThrust actually do? Does it control how fast the vehicles pitch'es?

QuoteomegaSpin = 6.0 //spinning in place speed
omegaTurn = 2.0 //turning while moving speed
Is this the yaw speed? Why are there two? What's the difference between "spin" and "turn"?

QuoterollSteer = 0.1 //rolls while steering
Does the vehicle roll when yawing? I don't understand.
Title: Re: BZ2 hovercraft physics
Post by: Red Devil on July 24, 2008, 10:18:49 AM
pitchThrust is how much the nose tilts down when you step on the gas.

pitchPitch is how much the nose tilts up and down when you move the mouse when you're just sitting on the ground.

omegaSpin is how fast you spin while standing still.
omegaTurn is how fast you turn while moving.

rollSteer is how much it rolls while moving and steering.
Title: Re: BZ2 hovercraft physics
Post by: appel on July 24, 2008, 10:28:59 AM
Are there any differences in this set of variables between 1.2 and 1.3?
Title: Re: BZ2 hovercraft physics
Post by: Red Devil on July 24, 2008, 10:32:30 AM
Nope, they both apply.
Title: Re: BZ2 hovercraft physics
Post by: appel on July 24, 2008, 10:49:34 AM
Great, thanks Red Devil, I got all I need for now.  8-)
Title: Re: BZ2 hovercraft physics
Post by: General BlackDragon on July 24, 2008, 11:49:55 AM
I think there's more to it then that, some 1.3 free'ed up values in physics arnt there?
Title: Re: BZ2 hovercraft physics
Post by: AcneVulgaris on July 24, 2008, 05:11:57 PM
Quote from: appel on July 24, 2008, 08:25:21 AM

I'm making a game demo and I want to include a BZ2-like hovercraft unit, that handles in the same way as a BZ2 hovercraft unit.



What are you using to make your demo?
Title: Re: BZ2 hovercraft physics
Post by: appel on July 25, 2008, 04:17:50 AM
Quote from: AcneVulgaris on July 24, 2008, 05:11:57 PM
What are you using to make your demo?

If you mean in terms of programming, then I'm using jME (java monkey engine library), it's OpenGL and Java. I'm also using jME-Physics2 library for the physics part.
Title: Re: BZ2 hovercraft physics
Post by: appel on July 25, 2008, 04:25:01 AM
Quote from: General BlackDragon on July 24, 2008, 11:49:55 AM
I think there's more to it then that, some 1.3 free'ed up values in physics arnt there?

I wonder if there are some "hidden" variables, inside the game engine. Or maybe they are all in config files? I need to get 1.3pb4 to check these config files out.
Title: Re: BZ2 hovercraft physics
Post by: TheJamsh on July 25, 2008, 06:27:47 AM
theres many many preset variables inthe game that are indeed hidden.

check out the changelog files to see all the ones GSH freed up and made externally adjustable... you could always speak to him about the internal variables but hes not aroud too often and is busy, try and grab him on the BZII chat thing in multiplayer
Title: Re: BZ2 hovercraft physics
Post by: OvermindDL1 on July 25, 2008, 09:14:02 AM
GSH said he exposed the internal vars for the ship/weapon/etc.. classes when he went through a spree doing so about a year or three ago.  That is what so much of the new stuff in the ODFs were.
(http://www.overminddl1.com/image_scripts/image_sig.php?type=ODL1signitures&image/sig.gif)
Generated by OvermindDL1's Signature Auto-Add Script (http://overminddl1.com) via GreaseMonkey (http://greasemonkey.mozdev.org/)

Title: Re: BZ2 hovercraft physics
Post by: Avatar on July 25, 2008, 11:41:41 AM
Wil?

:lol: :lol: :lol: :roll:

-Av-
Title: Re: BZ2 hovercraft physics
Post by: Feared_1 on July 26, 2008, 12:36:13 AM
Quote from: Avatar on July 25, 2008, 11:41:41 AM
Wil?

:lol: :lol: :lol: :roll:

-Av-

*ducks*
Title: Re: BZ2 hovercraft physics
Post by: appel on August 04, 2008, 05:49:37 PM
Ok, I'm well on my way to recreate the physics... but need help with defining some more variables.

What about the variables in [CraftClass] variables?

braccelFactor = 0.03
Break-deacceleration factor?

velFactor = 0.2
How fast the craft speeds up? There is accelThrust in the HoverCraftClass, how is that one used in relation to this one?

steerFactor = 1.5
Supposed to be pitchFactor?

omegaFactor = 0.2
strafeFactor = 0.2
I know what those do.

avoidSpeed = 20;
topSpeed = 30;
What is the difference here? Why not just have one max-speed variable?


Thank you :)
Title: Re: BZ2 hovercraft physics
Post by: General BlackDragon on August 04, 2008, 05:54:41 PM
those control how the AI moves, I think.

RD can explain more.
Title: Re: BZ2 hovercraft physics
Post by: Red Devil on August 04, 2008, 06:03:36 PM
ZA knows those settings better.
Title: Re: BZ2 hovercraft physics
Post by: appel on August 04, 2008, 06:05:08 PM
Quote from: General BlackDragon on August 04, 2008, 05:54:41 PM
those control how the AI moves, I think.

RD can explain more.

My understanding is that the ODF files represent a internal class hierarchy, e.g.

GameObjectClass (Contains the most basic and common variables among all game objects)
|
CraftClass (extends GameObjectClass. Contains the common variables among all craft/vehicle objects)
|
HoverCraftClass (extends CraftClass. Contains the common variables among all hovercraft vehicles)
Title: Re: BZ2 hovercraft physics
Post by: appel on August 04, 2008, 06:21:20 PM
Ok, including those above I need more info on this:

alphaTrack = 22.0 //springs speed it rights itself
alphaDamp = 8.0 //shocks
Title: Re: BZ2 hovercraft physics
Post by: Zero Angel on August 05, 2008, 12:36:25 AM
The following is a list of AI parameters I created a long time ago for an experimental scout variant (http://zeroangel.overminddl1.com/misc_files/ivenhscout.odf) which was supposed to dogfight more like a human would. I dont know how much these params have changed since 1.3pb2, but these are my notes.


// AI Handling Info --
brAccelFactor = 0.85f; // Acceleration Level for strafing (changed for 1.3)
strafeFactor = 0.9f; // % of time that unit will strafe
steerFactor = 1.05f;  // Low values = slow AI steer
omegaFactor = 0.5f; // Amount of 'give' for target lead (changed for 1.3)
velFactor = 0.3f; // Thruster burst length [in % of desired velocity]
alphaScale = 0.6  // Overcompensate left/right aim (0.3 is default?)
omegaScale = 0.8  // Accuracy for opponent strafing in single direction (~0.75 is perfect?)

steerScatter = 0.3 // Allowed steer inaccuracy
pitchScatter = 0.1 // Allowed pitch inaccuracy

TopSpeed = 50 // Set this over actual top speed for more aggressive forward AI movement

velFactor has to do with whether the AI will feather the gas pedal, or step on it and then step off of it for a long time when going not at full speed. Ie: in other words, it has to do with how 'fine' the AI controls the thrust on the craft. A coarse setting would have the AI stepping on the gas for a long time, then letting it drift for awhile.

I think avoidspeed sets how fast the ships will move when they need to get around obstacles and such.

I'm not *too* sure about alphaTrack and alphaDamp, they're both pretty similar parameters, and I remember playing with them a few years ago. I know for one of them, it would affect how sturdy your craft was (ie: how affected it would be by omega kicks from explosions), and one (or maybe the same one) controlled how much the auto-leveling would kick in -- you could set it to 0, and your craft would somersault at the slightest provocation, but having a low setting of that would make it easy to look directly up.
Title: Re: BZ2 hovercraft physics
Post by: appel on August 05, 2008, 03:34:03 AM
Quote from: Zero Angel on August 05, 2008, 12:36:25 AM
The following is a list of AI parameters I created a long time ago for an experimental AI scout which was supposed to dogfight more like a human would. I dont know how much these params have changed since 1.3pb2, but these are my notes.


// AI Handling Info --
brAccelFactor = 0.85f; // Acceleration Level for strafing (changed for 1.3)
strafeFactor = 0.9f; // % of time that unit will strafe
steerFactor = 1.05f;  // Low values = slow AI steer
omegaFactor = 0.5f; // Amount of 'give' for target lead (changed for 1.3)
velFactor = 0.3f; // Thruster burst length [in % of desired velocity]
alphaScale = 0.6  // Overcompensate left/right aim (0.3 is default?)
omegaScale = 0.8  // Accuracy for opponent strafing in single direction (~0.75 is perfect?)

steerScatter = 0.3 // Allowed steer inaccuracy
pitchScatter = 0.1 // Allowed pitch inaccuracy

TopSpeed = 50 // Set this over actual top speed for more aggressive forward AI movement

velFactor has to do with whether the AI will feather the gas pedal, or step on it and then step off of it for a long time when going not at full speed. Ie: in other words, it has to do with how 'fine' the AI controls the thrust on the craft. A coarse setting would have the AI stepping on the gas for a long time, then letting it drift for awhile.

I think avoidspeed sets how fast the ships will move when they need to get around obstacles and such.

I'm not *too* sure about alphaTrack and alphaDamp, they're both pretty similar parameters, and I remember playing with them a few years ago. I know for one of them, it would affect how sturdy your craft was (ie: how affected it would be by omega kicks from explosions), and one (or maybe the same one) controlled how much the auto-leveling would kick in -- you could set it to 0, and your craft would somersault at the slightest provocation, but having a low setting of that would make it easy to look directly up.

Ok, thanks. Seems like I'll just ignore those variables for now as they are AI.
Title: Re: BZ2 hovercraft physics
Post by: Commando on August 07, 2008, 04:29:59 AM
AlphaTrack is not an ai only setting.  I had to lower alphaTrack for hovering assault tanks since it appeared to control the unit's rotational acceleration.
Title: Re: BZ2 hovercraft physics
Post by: Red Devil on August 07, 2008, 03:28:00 PM
alphaDamp affects the smoothness of your forwards/backwards rotation, how much the bumps affect it, really.  Setting it to 12 will make your Scout real smooth.

Like Commando says, alphaTrack affects your longitudinal rotation.  Stick your arm straight out in front of you and twist it and it's that rotation.  Setting it high will make your ship go right side up quicker when it's upside down.
Title: Re: BZ2 hovercraft physics
Post by: Red Devil on August 08, 2008, 02:45:01 PM
Here's some other settings you can use that I use in mine:

[GameObjectClass]

CanSelect = false // can select with point-and-space
NoShadow = false // never renders a shadow if true.

collisionRadius = 8.0
alwaysClip = 0

DoBettyHealth = true // true: do Betty health warnings
DoBettyAmmo = true // true: do Betty ammo warnings
DoBettyLost = true // true : betty voice when this craft is lost

Tuggable = -1 // -1 = default behavior, 0 = never tuggable, 1 = always tuggable

isStealth = false

IsSingle = false

playerOnly = 0

Mass = 10000

Lifespan = -1 // -1 == infinite; > 0 is # seconds of life before it goes *boom*


[CraftClass]

LeaveExplodeScorch = true
MaxScorchHeight = 20.0 // max height above ground to leave a scorch

ClosestEnemyGoodEyes = false // but defaults true for CLASS_TURRETTANK items

CraftTeamIsPilotTeam = true   // false
WeaponsConverge = true

Use13Aim = false            // If false, tries to use 1.2's aim code
Aim12Delay3 = 0.14          //.. Aim12Delay3 = 0.1, 0.14, 0.23333, 0.3
HoverAim12Delay3 = 0.6      //.. HoverAim12Delay3 = 0.5, 0.6, 0.83333, 1.0
AssaultAim12Delay3 = 0.7    //.. AssaultAim12Delay3 = 0.7, 0.7, 0.7, 0.7

Aim12CannonError3 = 0.2     //.. Aim12CannonError3 = 0.75, 0.5, 0.2, 0.0

Lifespan = -1 // -1 == infinite; > 0 is # seconds of life before it goes *boom*

HealthChangeLevelDelta = 0.2 // valid values are 0..1

AttackTaskAttackTimeout3 = 8.0
AttackTaskFleeTimeout3 = 20
AttackTaskStrafeAfterFlee3 = true
AttackTaskStrafeToFleeTimeout3 = 25

// AttackTaskAttackTimeout0 .. AttackTaskAttackTimeout3 = 8.0, 12.0, 16.0, 20.0
// AttackTaskFleeTimeout0 .. AttackTaskFleeTimeout3 = 50, 40, 30, 20
// AttackTaskStrafeAfterFlee0 .. AttackTaskStrafeAfterFlee3 = false, false, false, true
// AttackTaskStrafeToFleeTimeout0 .. AttackTaskStrafeToFleeTimeout3 = 0, 25, 50, 75

//   These are skill-dependent tuning behaviors for craft that
// subcontract out parts of their behavior to
// AttackTask.cpp. AttackTaskAttackTimeout# is how many seconds a craft
// will be in 'STAND' mode (~= stand and fire), before it switches to
// 'FLEE' mode. (Note: people talking about scouts that run away all the
// time, this is the number to change-- make it a lot higher, and let the
// CraftClass::HealthChangeLevelDelta param take effect). The FleeTimeout
// is the number of turns (1/10 seconds, so that 50 == 5.0 seconds) is
// how long it'll stay in FLEE. If StrafeAfterFlee is true, when FLEE is
// done, it'll go to STRAFE, otherwise it'll go to
// BLAST. StafeToFleeTimeout is how many turns it'll be in STRAFE, then
// it'll switch to FLEE. [NM]

StrafeTimeBase3 = 0.5   //.. StrafeTimeBase3 = 0.5/1.0/3.0/5.0
StrafeTimeRandom3 = 0.5 //.. StrafeTimeRandom3 = 0.5/1.0/1.5/2.0
RetargetOnStrafe = true

// AI Settings

attackRange = 320.0 // for AttackTask.cpp
waitRange = 370.0 // for AttackTask.cpp
fireConeXBase = 0.2 // for AttackTask.cpp and other AI tasks
fireConeXSkillAdj = -0.05 // for AttackTask.cpp and other AI tasks
fireConeYBase = 0.2 // for AttackTask.cpp and other AI tasks
fireConeYSkillAdj = -0.05 // for AttackTask.cpp and other AI tasks
AttackTaskBlastDist = 40.0 // for AttackTask.cpp,
OffensiveProcessMadTime = 30.0 // for OffensiveProcess.cpp

PathingType = -1 // -1 = auto, 0 = Hover, 1 = Walker, 2 = Person, 3 = Tracked, 4 = Flyer
AvoidType = -1 // -1 = auto, 0 = None, 1 = force, 2 = plan

//xplSnipe = ""
//xplChunk = ""
//xplCrash = ""

//damageEffect1 = ""
//damageEffect2 = ""
//damageEffect3 = ""
//damageEffect4 = ""

chunkEffect1 = "iochnk01.xsi"
chunkEffect2 = "iochnk02.xsi"
chunkEffect3 = "iochnk03.xsi"
chunkEffect4 = "iochnk04.xsi"
chunkEffect5 = "iochnk05.xsi"
chunkEffect6 = "iochnk06.xsi"
chunkEffect7 = "iochnk07.xsi"

BailSound = "wohoo.wav" // Sound on pilot bailing out
CanAIEject = true // AI pilots can eject from this craft when destroyed
CraftTeamIsPilotTeam = false
CanBailout = true // default
CanUserBailout = true // Human can exit craft w/ Ctrl-B if true
CanUserHopout = true
CanRecycle = true // 'RECYCLE' shows up on the 0 key if true
needPilot = 1
canSnipe = 1
CanRescue = 1
//canHunt = 1
DAMAGE_SCALE = 0.05 // Scale in turning velocity into damage, on craft:ground or craft:building collisions
MAX_PILOT_HORIZ_VELOCITY = 25.0 // Max horizontal velocity a pilot can have when ejecting
RECYCLE_TASK_DIST = 10.0 // How far from the recycler until we're 'done' and recycle
// DoIdleDispatch = true

MIN_BOUNCE_VEL = 0.5

DAMAGE_SCALE = 0.05 // Scale in turning velocity into damage, on craft:ground or craft:building collisions
MAX_PILOT_HORIZ_VELOCITY = 25.0 // Max horizontal velocity a pilot can have when ejecting
RECYCLE_TASK_DIST = 10.0 // How far from the recycler until we're 'done' and recycle

OBJECT_ELASTICITY = 0.425   // 0.125
GROUND_ELASTICITY = 0.07125 // 0.03125
CollideTerrainSound = "silence.wav"    // "collide01.wav" // Sound on collision w/ terrain
CollideBldgSound = "collide02.wav"     // Sound on collision w/ building or immovable object
CollideOtherSound = "collide01.wav"    // Sound on hitting other objects
ExplodeSound = "Ordin_a.wav" // Sound when a craft explodes

DoBettyAttack = true // true: do betty attack warnings when this is damaged.

X_SPIN_RATE = 1.5707963267948966 // = 0.5f * PI;
Y_SPIN_RATE = 3.1415926535897932 // = PI;
Z_SPIN_RATE = 0.7853981633974483 // = 0.25f * PI;

Title: Re: BZ2 hovercraft physics
Post by: appel on August 08, 2008, 04:16:04 PM
Thanks RD, all of this will help :)