Weapon ODFs

Post everything from general questions, to modding questions, to map WIPs to releases. (SWBF1 only)

Moderator: Moderators

Post Reply
saberhagen

Weapon ODFs

Post by saberhagen »

Edit: As I said in the original post, I'm looking at weapon ODFs in order to make a "realism" mod. Since then I've found out most of what I need to know, and the gaps aren't particularly important for what I'm doing. I've posted my findings here for reference, in case anyone else finds them useful or interesting. I've concentrated on the stuff that determines how the weapon performs. There are other values which control sound and graphics which I'm not bothered about at the moment.

Thanks to everyone who posted replies. Your suggestions were useful and pointed me in the right direction. I've incorporated some of your information into the summary below. It should be obvious from the replies who can take credit for what.

Edit again: I've now added stuff about grenades. I still haven't looked at vehicles.


WEAPON ODF:

TargetEnemy
TargetNeutral
TargetFriendly

TargetPerson
TargetAnimal
TargetDroid
TargetVehicle
TargetBuilding

//These control what kind of targets missile launchers can lock onto. They also tell the AI what it should fire at with the selected weapon. If a target comes into range which this weapon can't target, bot will change to another weapon which can, if one is available. 1=can target; 0=can't.

//Also seems to be relationship between damage of weapon and hitpoints of target. If ratio between hitpoints of target and damage weapon can do to that target is 100:1 or more, bot will completely ignore target.

//Homing depends on weapon class being "launcher" and ordnance class being "missile". If weapon class is not launcher, lock on sound and graphics will not appear, but projectile will still home if ordnance class is missile.

MinRange
OptimalRange
MaxRange

//Tells AI bots when to use weapons. Independent of actual range (calculated by Velocity * LifeSpan in ordnance ODF). Limited by visual range of bot (can't see infantry at more than 64 metres, but can see vehicles further away. Possibly depends on size. Doesn't seem to be influenced by AISizeType). If within visual range, bot will always open fire at MaxRange even if this is out of actual range and has no effect. If target comes within MinRange bot will stop using weapon and switch to another if available. No evidence that OptimalRange has any influence.

LockOnRange
LockTime
LockOnAngle

//Lock-on for homing weapons (and possibly console auto-aim as well). LockOnRange seems to be independent of MaxRange and actual range.

ZoomMin // magnification for sight, first click
ZoomMax // magnification for sight, second click (if different from above)
ZoomRate// Rate at which scope zooms. If set to 0.0, first click turns scope on at minimum magnification and second click takes it straight to maximum. If set at mroe than 0, first click turns scope on at minimum magnification and second click turns it off. While it is on, forward and back keys can be used to zoom in and out at the rate specified.

YawSpread // horizontal deviation from aim (negative=right, positive=left)
PitchSpread // vertical deviation from aim

//These two spread values affect every shot including the first one. Spread is random up to the maximum specified above. Number seems to represent maximum deviation in metres at a range of 64 metres.

SpreadPerShot //cumulative spread which increases with each shot in a fully automatic burst. Not same units as other spread/patterns. 2 seems to be roughly equivalent to about 1m spread in 64m.

SpreadRecoverRate //presumably how fast weapon recovers from cumulative spread. Not sure exactly what the number means, but usually set at 4.8

SpreadThreshold //Determines after how many shots the SpreadPerShot kicks in. If set to 0, spread will affect second shot (first shot is never affected). Hard to tell exactly what values above 0 mean.

SpreadLimit //upper limit of cumulative spread. Probably uses same units as SpreadPerShot.

StandStillSpread //no effect
StandMoveSpread //random spread all directions, 1m in 64m
CrouchStillSpread //no effect
CrouchMoveSpread //random spread all directions, 1m in 64m
ProneStillSpread //no effect
ProneMoveSpread //not used: can't move and fire when prone


KickStrength //Self-explanatory. Not sure what units or maximum value are, but seems to be per shot, so will be multiplied for a salvo with more than one shot. Only found in some weapon ODFs (eg sniper rifle) but seems like it can be added to any weapon.

KickBuildup //Don't know what this does, if anything. Not always found with KickStrength. Only seen it in bowcaster so far.

KickSpread //Not sure what this does. Possibly has no effect, or needs to be combined with some other value. Found it in bowcaster ODF.

SpreadRecover //Not sure about this either. Seems to be associated with KickSpread, again found in bowcaster.


RoundsPerClip
ReloadTime
ShotDelay

//all self-explanatory

TriggerSingle //0= fully automatic; 1=semi-automatic

MaxPressedTime //controls charge for weapons like bowcaster. 0.0 means no charge.

NextCharge //determines effect of charge for specified time. Can have several NextCharge statements, followed by lines pointing to different ordnance odf, adding shots to salvo, specifying shot pattern/spread etc.

//Most weapom classes can have charge, but it looks like "launcher" class can't.

SalvoCount //number of salvos per trigger press

ShotsPerSalvo //number of simultaneous shots per salvo. Defaults to 1 if value not specified

SalvoDelay //delay between salvos in seconds

InitialSalvoDelay //delay from trigger press to first salvo

SalvoTime //can't tell what this does. Usually set to 0



ShotPatternCount
ShotPatternPitchYaw

//Similar to first kind of Spread, but you can specify exact pitch and yaw for each individual shot rather than it being random.

//Pitch and Yaw seem to be expressed as metres deviation per 64 metres travelled (roughly). Spread Pitch and Yaw, and stance spread appear to use the same units (hard to be precise because of randomness).

OrdnanceName //points to ord.odf file for weapon

FirePointName //hardpoint where projectile appears to come from


ChargeRateLight
MaxChargeStrengthLight
ChargeDelayLight
ChargeRateHeavy
MaxChargeStrengthHeavy
ChargeDelayHeavy

//no effect, even with charge weapons like bowcaster. Charge is determined by MaxPressedTime


RecoilLengthLight
RecoilLengthHeavy
RecoilStrengthLight
RecoilStrengthHeavy
RecoilDecayLight
RecoilDecayHeavy

//Probably not used (commented out in some files). Could be for vibrating game controllers.

ShotElevate //For grenade class, sends the grenade higher than aim point (contributes to curve, along with gravity). Has no effect on "cannon" class



ORDNANCE ODF:

LifeSpan //lifespan of projectile in seconds. When time expires, it will disappear

Velocity //speed of projectile in metres per second

//actual range of weapon is calculated by multiplying LifeSpan and Velocity (divide by 8 to get number of ZE squares). It has absolutely nothing to do with MaxRange value in weapon ODF.

Gravity //how much projectile is affected by gravity. 1.0 is normal. Even laser bolts are affected. Normally they move too fast for it to make a difference, but if you slow them down you can see them falling. Set to 0.0 to make them immune to gravity.

MaxDamage //damage done to target when hit. Modified by Scale for target type.

VehicleScale
ShieldScale
PersonScale
DroidScale
BuildingScale

//MaxDamage is multiplied by this figure to get actual damage done to target of each type. 0.0 means weapon cannot damage this type at all. Recharge droids seem to be Building type (Edit: not Person as I said before), not Droid type.

ORDNANCE ODF (GRENADES):

ClassLabel //Ordnance class can be "shell" or "sticky". If in "sticky" class, does not necessarily stick to anything - has values specifying whether it sticks to each target type (Person, Vehicle etc). "sticky" class grenades have delayed explosion, whereas "shell" class explodes on impact.

ExplosionExpire //points to explosion ODF file to use when grenade expires. Used by sticky class, which always explodes after delay and never on impact. Also used by shell class: will explode at end of LifeSpan if it doesn't hit anything. If not specified will just disappear on expiry.

ExplosionImpact //points to explosion ODF file to use when grenade hits something. Seems to be only used by shell class, which always explodes on impact and never after delay. If not specified will just disappear on impact.

LifeSpan //for "sticky" class determines delay from coming to rest until explosion. Doesn't affect range (unlike LifeSpan * Velocity for "bolt" class). For "shell" class determines time at which the grenade explodes if it doesn't hit anything (eg if gravity set to 0, it will never hit the ground!). If not specified for "shell" seems to default to about 3 to 3.5 seconds, but "sticky" can be longer.

Gravity //determines effect of gravity/steepness of ballistic curve. If set to 0, grenade will never fall to earth.

Rebound //shouldn't affect shell as always explode on impact. Can't tell how it affects sticky. Range of values from 0 to 1 seems to produce same bounce effect.

Friction //can't tell what it does, if anything. Possibly controls how far sticky grenades will roll after landing.

Damage //damage done by grenade on impact, regardless of explosion. eg if a sticky bounces off something it will take this much damage, (modified by Scale for target type as with bolt).

StickPerson etc //one for each target type. Recharge droids are Building, not Droid. When destroyed, they are BuildingDead

EXPLOSION ODF:

Damage //damage caused by explosion. Modified by Scale as usual

DamageRadiusInner //models within this radius (metres) take full damage

DamageRadiusOuter //models within this radius (metres) take half damage

Push //force of explposion which throws models within range. Not distance in metres.

PushRadiusInner //models within this radius (metres) take full push

PushRadiusOuter //models within this radius (metres) take half push

Shake //strength of vibration caused by explosion. Seems to be mostly cosmetic (apart from disrupting aim)

ShakeLength //duration of above in seconds

ShakeRadiusInner //radius for full shake
ShakeRadiusOuter //radius for half shake
Last edited by saberhagen on Sun Jan 22, 2006 4:38 pm, edited 6 times in total.
Qdin
Old School Staff
Posts: 2059
Joined: Wed Feb 23, 2005 9:54 am
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

RE: Weapon ODFs

Post by Qdin »

hmm

good :)

What excactly do you wanna know..?
Kyross

RE: Weapon ODFs

Post by Kyross »

Keep in mind the ODFs are, like other assets, done the same way as thy were for other platforms like PS2. My cousin has this for PS2 and there is an auto target mode incorporated which it like a lock on for guns and stuff and make it easier to hit people(joy, i can't imagine hitting anything with the analog stick alone). Therefore stuff like the

LockOnRange
LockTime
lockOnAngle

May still be in the files, but not do anything. This is just a theory tough.

Spread is also not completely random. usually the first few several shots will be quite accurate, but can start going all over the place after extended use. When my shots start flying in every direction I quickly switch t second weapon and back or reload and it fires straight again.

The fire point name is model related. In all weapons there is a hard point called hp_active which tells the game how/where the player holds the weapon. hp_fire determines where the attack/damage coms from. Fire point name is where you would specify this hard point.

Y'know, someone should get several ODFs from different types of objects, put them together in a document/post them, and comment in what everything does. It would be useful reference for new people or somene who wasn't sure of something, I think.
saberhagen

Re: RE: Weapon ODFs

Post by saberhagen »

Kyross wrote:Keep in mind the ODFs are, like other assets, done the same way as thy were for other platforms like PS2. My cousin has this for PS2 and there is an auto target mode incorporated which it like a lock on for guns and stuff and make it easier to hit people(joy, i can't imagine hitting anything with the analog stick alone). Therefore stuff like the

LockOnRange
LockTime
lockOnAngle

May still be in the files, but not do anything. This is just a theory tough.
That's a good point that I hadn't thought of. It also makes me think that Recoil could be related to vibrating controllers for consoles.
Kyross wrote:Spread is also not completely random. usually the first few several shots will be quite accurate, but can start going all over the place after extended use. When my shots start flying in every direction I quickly switch t second weapon and back or reload and it fires straight again.
I think there are several different types of spread. I'm not entirely sure how they interact with each other, but you can use each one on its own without having the others turned on.

The kind you mentioned is controlled by SpreadPerShot. As you said, it increases incrementally the longer you keep firing for and stops when you release the trigger. The direction of the spread seems to be random but not the distance.

Second, there's the spread controlled by YawSpread and PitchSpread. This affects every shot, including the first, and won't get worse over time if SpreadPerShot is set to 0. The direction and distance of spread are both random, up to the maximum specified for Yaw and Pitch. For most shipped weapons it's so small that you don't notice it but you can see it clearly with the Dark Trooper's shotgun.

Third, there's spread for posture and movement (StandMoveSpread etc). This doesn't appear to have been used in the shipped game as the values are always 0, but if you increase them, you can see it working.

Fourth, there's KickSpread, which doesn't seem to do anything unless I'm using it wrong. KickStrength makes the weapon point upwards by a certain amount after each shot has been fired. It then comes to rest slightly higher than it was before, so with a strong kick and a fast rate of fire, each shot in a burst will go progressively higher. However, with all spread turned off, each shot will go dead straight and not deviate from your aim. It's just that kick forces your aim higher.

On top of that there's ShotPattern which lets you specify the exact pitch and yaw of each shot in a salvo and isn't random at all. The best example is a fully charged bowcaster, which always fires its 7 shots in the same pattern.


Summary of queries I have:

The most important things I'd still like to know:

What determines whether a weapon has homing capabilities?

Does KickSpread do anything, and if so how do I get it to work?

Can MaxRange be changed?

Do the AimFactor values in the soldier ODFs do anything? If so, what and how does it work?
Delta_57_Dash
Jedi
Jedi
Posts: 1187
Joined: Fri Jun 10, 2005 2:46 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set

RE: Re: RE: Weapon ODFs

Post by Delta_57_Dash »

TriggerSingle //1= fully automatic; 0=semi-automatic <---- you reversed that... 1 is semi-auto, 0 is full-auto
saberhagen

Re: RE: Re: RE: Weapon ODFs

Post by saberhagen »

Delta_57_Dash wrote:TriggerSingle //1= fully automatic; 0=semi-automatic <---- you reversed that... 1 is semi-auto, 0 is full-auto
Doh! n00b is pwned. ;)

I did know that but typed it the wrong way round. I'll edit it to avoid confusion. Thanks for pointing it out.

I assume from the response to this thread that most people don't actually know very much about the details of weapon properties (I guess Fred must know a lot about this and I'll be asking him when I get the chance). I'm making a firing range map so I can test weapons under controlled conditions. I'll report back if I find anything interesting.

Does anyone know what the units for MaxRange are? From what I've done so far, they don't seem to quite match up with Zeroedit squares, but they're obviously much more than metres (assuming MaxRange is the greatest range at which the reticle will turn red when over an enemy model).
Riley75

Post by Riley75 »

I'm guessing a weapon has a lock-on mechanism if the ClassLabel is set to "launcher".
saberhagen

Post by saberhagen »

Riley75 wrote:I'm guessing a weapon has a lock-on mechanism if the ClassLabel is set to "launcher".
Haven't had a chance to test this yet but it sounds plausible. (Edit: I've just tried changing the ClassLabel of a missile launcher from "launcher" to "cannon". I don't get the lock-on sound or graphics any more, but the missiles still home in on enemies. Interesting...).

However, I've just made an exciting (for me, anyway) breakthrough with ranges.

I am now fairly confident that, at least for weapons of class "cannon" on the PC version, MinRange, OptimalRange and MaxRange have absolutely no effect. They are possibly connected with homing weapons and/or console auto aim. I'll do some more tests later to see if they affect locking on with missile launchers. (Edit: as Riley75 said below, they are actually hints to tell the AI when to use a weapon.)

The range of a weapon is actually determined by multiplying the Velocity (metres per second) and LifeSpan (seconds) values found in the ordnance ODF. Obviously the distance is in metres and can then be divided by 8 to give a distance in Zeroedit squares. There seems to be a slight discrepancy (a couple of metres or so) between the point where the reticle turns red and the point where the bolt can reach the target before it expires. I'm not sure how this came about as I'm fairly certain that they're both based on the same calculation.
Last edited by saberhagen on Wed Dec 21, 2005 11:14 am, edited 1 time in total.
Riley75

Post by Riley75 »

MinRange, OptimalRange and MaxRange might just be used as a signal to the AI -- it might give them guidelines for when to use different weapons. It sounds like alot of what you're looking for is in the ordnance ODFs.
saberhagen

Post by saberhagen »

Riley75 wrote:MinRange, OptimalRange and MaxRange might just be used as a signal to the AI -- it might give them guidelines for when to use different weapons. It sounds like alot of what you're looking for is in the ordnance ODFs.
You're right. The Range values are used by the AI. For example, the sniper rifle's MinRange is 32 and the pistol's MaxRange is 32, so when you get within 32 metres of a sniper bot, it switches from rifle to pistol. So far I haven't found that OptimalRange makes any difference. The only way I've been able to force a bot to change weapons is to use MinRange.

In practice maximum range is limited by the bot's visual range. It looks like bots can't see infantry more than 64 metres away, regardless of the MaxRange, LockOnRange and actual range (Velocity * LifeSpan) of their weapon. However, they can see vehicles from much further away. For example, a rebel combat speeder can be seen and shot at from over 128 metres away.

Provided the target is within visual range, the bot will always open fire at the distance specified in MaxRange, even if this is out of the weapon's actual range.
xwingguy

Post by xwingguy »

There is another damage section just to add.

AnimalScale

Also I believe optimal Range is where a projectile will create the maxium damaged allowed. You know, like in the hints and tips in the loading screen it says that missiles and bombs perform the maxium damage at a longer range.
JabbaLovesLava
Sith
Sith
Posts: 1396
Joined: Tue Jun 07, 2005 11:50 am

Post by JabbaLovesLava »

Doesnt the game locck-on if you're playing with a joy stick?
Post Reply