Difference between revisions of "Tutorial - Beam Weapons"
m (additions) |
(typo fixes and corrections) |
||
Line 1: | Line 1: | ||
− | This is a short tutorial into | + | This is a short tutorial into making of beam weapons. Some knowledge on table editing is useful and as is basic understanding of [[Weapons.tbl]]. |
− | '''Please post any comments or questions | + | '''Please post any comments or questions concerning the beam weapons tutorial to the [[Talk:Tutorial_-_Beam_Weapon|talk page]]''' |
<br><br> | <br><br> | ||
==Making a Basic Beam Weapon== | ==Making a Basic Beam Weapon== | ||
Line 7: | Line 7: | ||
==Adding Beam Sections== | ==Adding Beam Sections== | ||
− | + | The process of adding new beam sections is rather straightforward when it is done directly with [[Weapons.tbl]], however there may be problems when using '''*-wep.tbm'''s to add or change existing beam sections if the additional [[Weapons.tbl#$BeamInfo:|+Index:]] table option is not properly used. If no index number is given to a beam section in '''*-wep.tbm''' game assumes it to be an additional beam texture even if it wouldn't be completely defined. However if you define index for the beam section you can edit an existing beam section in addition to creating new ones. | |
==Different Beam Types== | ==Different Beam Types== | ||
− | Beam types in FreeSpace open are clearly different from each other. Understanding their differences and also their unique features is | + | Beam types in FreeSpace open are clearly different from each other. Understanding their differences and also their unique features is useful in creating or editing beam weapon's table entry. |
===Type 0 Beams=== | ===Type 0 Beams=== | ||
− | Type 0 beams are basic | + | Type 0 beams are basic straight firing beam weapons without any additional features. They use [[Weapons.tbl#$BeamInfo:|+Miss Factor:]] values for determining weapon accuracy. Generally if they hit their target they will cause full damage. Type 0 beams do not function as fighter beams. |
Few examples are [[SGreen]], [[BGreen]] and [[BFRed]]. | Few examples are [[SGreen]], [[BGreen]] and [[BFRed]]. | ||
Line 23: | Line 23: | ||
===Type 1 Beams=== | ===Type 1 Beams=== | ||
− | Type 1 beams are slashing beams. These beams use | + | Type 1 beams are slashing beams. These beams use target's size (or more precisely, models octants) in determining the length of the slashing movement. They also use '''+Miss Factor:''' values for determining weapon accuracy. Generally it is very rare occurrence if they cause their full listed damage to the target as the slash usually goes wide of the target in both the starting and ending points of the slashing movement. However slashing beams tend to damage target's subsystems quite efficiently unlike type 0 beams. Type 1 beams do not function as fighter beams. |
Few examples are [[TerSlash]], and [[VSlash]]. | Few examples are [[TerSlash]], and [[VSlash]]. | ||
Line 37: | Line 37: | ||
===Type 3 Beams=== | ===Type 3 Beams=== | ||
− | Type 3 beams have different behaviours depending on the type of its target. Against small targets, or more precisely against targets defined with | + | Type 3 beams are also known as anti-fighter beams and unlike other beam types they have different behaviours depending on the type of its target. Against small targets, or more precisely against targets defined with certain [[Objecttypes.tbl#$Beams_Easily_Hit:|Objecttypes.tbl]] option, they fire a number of short beam pulses (defined with [[Weapons.tbl#$BeamInfo:|+Shots:]] that have their total combined lifetime equal to the defined lifetime of the beam. Against larger targets they behave exactly like type 0 beams. In both cases the beam uses '''+Miss Factor:''' values for its accuracy. Type 3 beams do not function as fighter beams. |
Few examples are [[AAAf]], and [[SAAA]]. | Few examples are [[AAAf]], and [[SAAA]]. | ||
Line 44: | Line 44: | ||
===Type 4 Beams=== | ===Type 4 Beams=== | ||
− | Type 4 beams are direct fire beams that fire only along the firing turrets normal. If mounted on single-part turret they will only fire where that turret's normal is pointing in similar manner as the | + | Type 4 beams are direct fire beams that fire only along the firing turrets normal. If mounted on single-part turret they will only fire where that turret's normal is pointing in similar manner as the unguided [[Weapons.tbl#$Swarm:|swarm]] weapons - that is they wont hit anything unless using extremely strict mission design - but with multi-part turrets they function quite nicely. They do not use '''+Miss Factor:''' values for determining weapon accuracy and this can make these beams exceedingly deadly however unlike other beam weapons these will become inaccurate if firing ship's weapons subsystem is damaged. |
The only example is [[MjolnirBeam]]'s fixed version. | The only example is [[MjolnirBeam]]'s fixed version. | ||
Line 53: | Line 53: | ||
Beam weapons use several different table options for setting the beam ranges. | Beam weapons use several different table options for setting the beam ranges. | ||
− | ===Beam | + | ===Beam Targeting Ranges=== |
− | Generally beams target any legal - that is anything not protected by other weapon settings such as 'huge' - target | + | Generally beams target any legal - that is anything not protected by other weapon settings such as 'huge' - target within the set [[Weapons.tbl#.2BWeapon_Range:|weapon range]]. However this range can be defined by using [[Weapons.tbl#.2BWeapon Range:|+Weapon Range:]] and [[Weapons.tbl#.2BWeapon Min Range:|+Weapon Min Range:]] for setting the maximum and minimum targeting ranges respectively. It should be also noted that beams do use the range calculated for other weapons as well (''lifetime x velocity'') despite the fact they actually do not need these values for anything else. That if the ''lifetime x velocity'' is smaller than the set ''weapon range'' then beam uses the ''lifetime x velocity'' for determining the maximum range. AI uses this range for determining when to fire the beam weapon. |
===Actual Beam Range=== | ===Actual Beam Range=== | ||
− | Normally beam range is 30 000 m. This can however be adjusted using '''+Range:''' option under [[Weapons.tbl#$BeamInfo:|$BeamInfo:]] in weapons.tbl. This effectively stops or rather dissipates (not a sharp ending) the beam at that range. It is worth noting that if the '''''actual beam range''''' is shorter than the set '''''beam | + | Normally beam range is 30 000 m. This can however be adjusted using '''+Range:''' option under [[Weapons.tbl#$BeamInfo:|$BeamInfo:]] in weapons.tbl. This effectively stops or rather dissipates (not a sharp ending) the beam at that range. It is worth noting that if the '''''actual beam range''''' is shorter than the set '''''beam targeting range''''' then AI will start firing the beam against targets beyond its range. |
===Beam Accuracy=== | ===Beam Accuracy=== | ||
− | Normally beam accuracy is determined with '''+Miss Factor:''' that uses set accuracy values for each difficulty level. Higher values increase the | + | Normally beam accuracy is determined with '''+Miss Factor:''' values that uses set accuracy values for each difficulty level. Higher values increase the chance of beams missing their targets. However direct fire beams (type 2 or type 4 beams as fighter beams and type 4 beams in multi-part turrets) use normal targeting 'rules'. That is they use the weapon velocity, target velocity, and range for calculating lead for the target. As beams are instantaneous this causes the beams to miss their targets or rather AI to fire its beam to a point exactly in front of the target. |
==Adjusting Beam Textures== | ==Adjusting Beam Textures== | ||
− | Beam textures are - by default - used | + | Beam textures are - by default - used in game by stretching the single bitmap over the whole length of the beam. It is worthwhile to notice that if beam hits anything its drawing length is limited to the distance from the firing point to the impact point. This may cause very erratic beam texture behaviour if the used bitmap was not uniform. Animations (both .ani and .eff) can be used instead normal bitmaps for beams textures. |
===Adjusting Tile Length=== | ===Adjusting Tile Length=== | ||
− | Instead of letting the game stretch the bitmap over the whole length of the beam the tiling of the beam texture can be adjusted | + | Instead of letting the game stretch the bitmap over the whole length of the beam the tiling of the beam texture can be adjusted with two different methods. To use these methods for adjusting beam texture tiling we have to use '''+Tile Factor:''' option under the beam section that is to be modified. Tile factor requires two arguments of which the first one (either 0 or 1) will determine the actual texture tiling method. |
<br><br> | <br><br> | ||
'''Tiling Method '0'''' | '''Tiling Method '0'''' | ||
− | Method '0' sets the beam texture to be tiled in similar way as the default method but with one difference. You can define how many times the texture | + | Method '0' sets the beam texture to be tiled in similar way as the default method but with one difference. You can define how many times the texture tile is used in beam - default option is the same as '''+Tile Factor: 0, 1'''. However stretching is again possible issue. |
<br><br> | <br><br> | ||
'''Tiling Method '1'''' | '''Tiling Method '1'''' | ||
− | Using method '1' for setting the beam texture tiling allows us to | + | Using method '1' for setting the beam texture tiling allows us to use the second value to define the length of the beam tiles used in the beam texture. So when using this method the number of tiles shown on screen does depends on the length of the beam and stretching issues shouldn't as visible at all. |
<br><br> | <br><br> | ||
===Setting Beam Translation Values=== | ===Setting Beam Translation Values=== | ||
− | Translation values allow us to move the beam tiles without actually using animations with them. The translation is set with '''+Translation:''' option under the beam section that is to be modified. Positive values cause the textures to move from the impact point towards the firing point and negative values | + | Translation values allow us to move the beam tiles without actually using animations with them. The translation is set with '''+Translation:''' option under the beam section that is to be modified. Positive values cause the textures to move from the impact point towards the firing point and respectively negative values force the textures to move from firing point towards the impact point. |
==Beam Damage Attenuation== | ==Beam Damage Attenuation== | ||
− | Damage from the beam weapons can be set to attenuate using the '''+Attenuation:''' option under the '''$BeamInfo:'''. It determines the point from where the damage attenuation begins. It accepts values from 0 to 1. With 1 the attenuation has no effect at all as the then the attenuation 'starts' at the maximum range of the beam. When using 0 however the damage attenuation starts from the firing point so that the beam | + | Damage from the beam weapons can be set to attenuate using the '''+Attenuation:''' option under the '''$BeamInfo:'''. It determines the point from where the damage attenuation begins. It accepts values from 0 to 1. With 1 the attenuation has no effect at all as the then the attenuation 'starts' at the maximum range of the beam. When using 0 however the damage attenuation starts from the firing point so that the beam doesn't do any damage in its set maximum range (defined with '''+Range:''', '''''not''''' with ''+Weapon Range:''). |
[[Category:Tutorials|Beam Weapons]] | [[Category:Tutorials|Beam Weapons]] |
Revision as of 06:22, 4 September 2006
This is a short tutorial into making of beam weapons. Some knowledge on table editing is useful and as is basic understanding of Weapons.tbl.
Please post any comments or questions concerning the beam weapons tutorial to the talk page
Contents
Making a Basic Beam Weapon
Adding Beam Sections
The process of adding new beam sections is rather straightforward when it is done directly with Weapons.tbl, however there may be problems when using *-wep.tbms to add or change existing beam sections if the additional +Index: table option is not properly used. If no index number is given to a beam section in *-wep.tbm game assumes it to be an additional beam texture even if it wouldn't be completely defined. However if you define index for the beam section you can edit an existing beam section in addition to creating new ones.
Different Beam Types
Beam types in FreeSpace open are clearly different from each other. Understanding their differences and also their unique features is useful in creating or editing beam weapon's table entry.
Type 0 Beams
Type 0 beams are basic straight firing beam weapons without any additional features. They use +Miss Factor: values for determining weapon accuracy. Generally if they hit their target they will cause full damage. Type 0 beams do not function as fighter beams.
Few examples are SGreen, BGreen and BFRed.
Type 1 Beams
Type 1 beams are slashing beams. These beams use target's size (or more precisely, models octants) in determining the length of the slashing movement. They also use +Miss Factor: values for determining weapon accuracy. Generally it is very rare occurrence if they cause their full listed damage to the target as the slash usually goes wide of the target in both the starting and ending points of the slashing movement. However slashing beams tend to damage target's subsystems quite efficiently unlike type 0 beams. Type 1 beams do not function as fighter beams.
Few examples are TerSlash, and VSlash.
Type 2 Beams
Type 2 beams are direct fire beams. When mounted on turrets they operate as type 0 beams however they can be used as fighter beams. When used as fighter beams they disregard any +Miss Factor: settings.
The only example is Targeting Laser (sort of)
Type 3 Beams
Type 3 beams are also known as anti-fighter beams and unlike other beam types they have different behaviours depending on the type of its target. Against small targets, or more precisely against targets defined with certain Objecttypes.tbl option, they fire a number of short beam pulses (defined with +Shots: that have their total combined lifetime equal to the defined lifetime of the beam. Against larger targets they behave exactly like type 0 beams. In both cases the beam uses +Miss Factor: values for its accuracy. Type 3 beams do not function as fighter beams.
Few examples are AAAf, and SAAA.
Type 4 Beams
Type 4 beams are direct fire beams that fire only along the firing turrets normal. If mounted on single-part turret they will only fire where that turret's normal is pointing in similar manner as the unguided swarm weapons - that is they wont hit anything unless using extremely strict mission design - but with multi-part turrets they function quite nicely. They do not use +Miss Factor: values for determining weapon accuracy and this can make these beams exceedingly deadly however unlike other beam weapons these will become inaccurate if firing ship's weapons subsystem is damaged.
The only example is MjolnirBeam's fixed version.
Adjusting Beam Ranges and Accuracy
Beam weapons use several different table options for setting the beam ranges.
Beam Targeting Ranges
Generally beams target any legal - that is anything not protected by other weapon settings such as 'huge' - target within the set weapon range. However this range can be defined by using +Weapon Range: and +Weapon Min Range: for setting the maximum and minimum targeting ranges respectively. It should be also noted that beams do use the range calculated for other weapons as well (lifetime x velocity) despite the fact they actually do not need these values for anything else. That if the lifetime x velocity is smaller than the set weapon range then beam uses the lifetime x velocity for determining the maximum range. AI uses this range for determining when to fire the beam weapon.
Actual Beam Range
Normally beam range is 30 000 m. This can however be adjusted using +Range: option under $BeamInfo: in weapons.tbl. This effectively stops or rather dissipates (not a sharp ending) the beam at that range. It is worth noting that if the actual beam range is shorter than the set beam targeting range then AI will start firing the beam against targets beyond its range.
Beam Accuracy
Normally beam accuracy is determined with +Miss Factor: values that uses set accuracy values for each difficulty level. Higher values increase the chance of beams missing their targets. However direct fire beams (type 2 or type 4 beams as fighter beams and type 4 beams in multi-part turrets) use normal targeting 'rules'. That is they use the weapon velocity, target velocity, and range for calculating lead for the target. As beams are instantaneous this causes the beams to miss their targets or rather AI to fire its beam to a point exactly in front of the target.
Adjusting Beam Textures
Beam textures are - by default - used in game by stretching the single bitmap over the whole length of the beam. It is worthwhile to notice that if beam hits anything its drawing length is limited to the distance from the firing point to the impact point. This may cause very erratic beam texture behaviour if the used bitmap was not uniform. Animations (both .ani and .eff) can be used instead normal bitmaps for beams textures.
Adjusting Tile Length
Instead of letting the game stretch the bitmap over the whole length of the beam the tiling of the beam texture can be adjusted with two different methods. To use these methods for adjusting beam texture tiling we have to use +Tile Factor: option under the beam section that is to be modified. Tile factor requires two arguments of which the first one (either 0 or 1) will determine the actual texture tiling method.
Tiling Method '0'
Method '0' sets the beam texture to be tiled in similar way as the default method but with one difference. You can define how many times the texture tile is used in beam - default option is the same as +Tile Factor: 0, 1. However stretching is again possible issue.
Tiling Method '1'
Using method '1' for setting the beam texture tiling allows us to use the second value to define the length of the beam tiles used in the beam texture. So when using this method the number of tiles shown on screen does depends on the length of the beam and stretching issues shouldn't as visible at all.
Setting Beam Translation Values
Translation values allow us to move the beam tiles without actually using animations with them. The translation is set with +Translation: option under the beam section that is to be modified. Positive values cause the textures to move from the impact point towards the firing point and respectively negative values force the textures to move from firing point towards the impact point.
Beam Damage Attenuation
Damage from the beam weapons can be set to attenuate using the +Attenuation: option under the $BeamInfo:. It determines the point from where the damage attenuation begins. It accepts values from 0 to 1. With 1 the attenuation has no effect at all as the then the attenuation 'starts' at the maximum range of the beam. When using 0 however the damage attenuation starts from the firing point so that the beam doesn't do any damage in its set maximum range (defined with +Range:, not with +Weapon Range:).