Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Woolie Wool on February 16, 2005, 12:49:18 pm

Title: SCP Avenger cannon
Post by: Woolie Wool on February 16, 2005, 12:49:18 pm
Since the Avenger cannon in FS1 and FSPort is so completely different from the description in the tech room, I made one with SCP features that more closely approximates the description of the Avenger (no autoaim though):

Code: [Select]
$Name: @Avenger
+Title: XSTR("GTW-15 Avenger Cannon", 3270)
+Description:
XSTR(
"Medium Energy Usage
Level 3 Hull Damage
Level 2 Shield Damage
", 3271)
$end_multi_text
+Tech Title: XSTR("GTW-15 Avenger Cannon", 3272)
+Tech Anim: cb_avenger
+Tech Description:
XSTR(
"A rapid-fire, computer-controlled radar and gun system - capable of firing at a rate of more than 4500 rounds per minute - used primarily for close-defense situations - uses closed-loop radar technology to locate, identify, and direct a stream of highly destructive 45mm projectiles to the target. With the advent of shield technology, the GTW-15 is preferred over the ML-16 in any ship that can carry it. It's extra damage against hulls make it one of the best anti cruiser weapons. It has also proven very effective against Vasudan fighters. However, it's substandard anti-shield capabilities make it a poor choice for dogfighting Shivans, although far better than the ML-16.", 3273)
$end_multi_text
$Model File: none
@Laser Bitmap: lamprey_bitmap
@Laser Glow: none
@Laser Color: 140, 140, 60
@Laser Color2: 140, 140, 60
@Laser Length: 0.2
@Laser Head Radius: 0.2
@Laser Tail Radius: 0.2
$Mass: 0.032 ;; adjusted for higher rate of fire
$Velocity: 1000.0 ;; speed of the weapon (initially) -- may or may not change
$Fire Wait: 0.02 ;; It's only 3000 rpm instead of 4500, but 4500 rpm leads to a repeating decimal for a firewait
$Damage: 1
$Armor Factor: 1.6 ;; does damage at an identical rate to the original Avenger
$Shield Factor: 1.088 ;; damage rate identical to original Avenger
$Subsystem Factor: 0.448 ;; damage rate identical to original Avenger
$Lifetime: 1.9
$Energy Consumed: 0.024 ;; Energy used at an identical rate to original Avenger
$Cargo Size: 0.0 ;;
$Homing: NO
$LaunchSnd: 163 ;;
$ImpactSnd: 85 ;;
$Flags: ( "player allowed" "stream" )
$Trail: ;; Trail cannot be set if Exhaust is set
+Start Width:           0.2                                      ;; Width of trail nearest missile
+End Width:             0.01                                       ;; Width of trail before it "evaporates"
+Start Alpha:       1.0
+End Alpha: 0.0
+Max Life: 0.1                                       ;; how many seconds before trail disappears
+Bitmap: hornet_bitmap ;; Bitmap used to draw trail
$Icon: icon_avenger
$Anim: avenger
$Impact Explosion: Maxim_Impact
$Impact Explosion Radius: 1.0
$Fof: 2.0


It is not yet completed or thoroughly tested. Also note that the weapon sounds reference entries in the FSPort weapons.tbl, not the base FS2 one. Enjoy.
Title: SCP Avenger cannon
Post by: Woolie Wool on February 16, 2005, 02:16:55 pm
Any comments on balance, playability, appearance, etc.?
Title: SCP Avenger cannon
Post by: Carl on February 16, 2005, 04:40:12 pm
if it leads to a repeating decimal, just round it to the third or fourth digit. FS2 can handle values less than the hundredths place i believe.
Title: SCP Avenger cannon
Post by: StratComm on February 16, 2005, 04:54:28 pm
It's at worst floating point, and it will round but the degree of precision is something like 7-8 decimal places.  Believe it or not, 0.02 isn't actually going to wind up in memory like that.

However, I'd like to point out that the game's not going to like you at all.  If you've got 2 firepoints and you hold down the trigger for 1 second you're going to generate 100 shots, all of which must be tracked and checked for colissions.  As you add things like this into the mission, the game will either slow to a crawl or stop detecting colissions properly.
Title: SCP Avenger cannon
Post by: TrashMan on February 16, 2005, 05:01:05 pm
Strangely I have miniguns in game and the game never slowed down for me (and I think they are even faster than this one)...
Title: SCP Avenger cannon
Post by: StratComm on February 16, 2005, 05:06:34 pm
I doubt you've tested them thuroughly enough then.  This used to happen when you had too many asteroids; lasers aren't as hard to track because you don't have to check collisions against them, but once you get too many things onscreen the game starts to get sloppy.  Make a cargo container with a ton of hitpoints (so the game doesn't arbitrarily scale it like a capital ship, otherwise anything would work) and fire your gun at it from the ship in your mod with the max number of guns in a primary bank from maximum range.  I can almost promise that the damage done over time wouldn't add up to what you defined in the table because some shots aren't being picked up.  As I said, the more ships that mount this type of gun in a mission the worse the problem gets, and it's more dependent on the speed of a user's computer than almost any other performance concern in FSO.  The slower your comp, the fewer shots have to be present for this to happen.
Title: SCP Avenger cannon
Post by: Woolie Wool on February 16, 2005, 05:36:11 pm
If I run into serious poblems with this weapon, I'll increase the firewait to 0.05 or maybe even 0.1.
Title: SCP Avenger cannon
Post by: Solatar on February 16, 2005, 05:54:39 pm
Might add a "stream" tag and adjust firewaits to work with that. That way you can say it fires 4500rpm, BUT it only fires from one barrel at a time (half the shots).

EDIT: Meant "cycle:
Title: SCP Avenger cannon
Post by: Woolie Wool on February 16, 2005, 06:01:15 pm
It already has a "stream" flag.
Title: SCP Avenger cannon
Post by: Solatar on February 16, 2005, 05:59:57 pm
My mistake, I meant to say "cycle".
Title: SCP Avenger cannon
Post by: Trivial Psychic on February 16, 2005, 08:32:06 pm
You might want to make it a ballistic primary.
Title: SCP Avenger cannon
Post by: Flaser on February 17, 2005, 12:32:05 am
IMHO a possible workaround would be handling streams of bullet as one projectile and do collision check for the mass of them.

An better alternative would be the ability to check how long a ship is in this stream just as it is down with beams AFAIK.

That way you can have weapons with massive ROF, and instead a full blown collision check for each bullet, you'd handle a stream object.
Title: SCP Avenger cannon
Post by: StratComm on February 17, 2005, 01:14:09 am
With the proper application of particles, that might actually be possible without major reworking.  It'd make tweaking a royal pain, but it should certainly be doable.
Title: SCP Avenger cannon
Post by: Bobboau on February 17, 2005, 09:24:16 am
I have consitered makeing a waeon type that used the trail code for rendering, it would let out a solid sream and damage would be based on how much of the stream the ship intersected. the big thing that has stoped me is it would requier spliting these streams up into more (posably MANY more) streams when they hit a ship and only part of the stream hits
Title: SCP Avenger cannon
Post by: terren on February 17, 2005, 10:39:47 pm
I allready did this for personal use, it looks realy cool when you set it so each 'shot' looks like about 8 or 10 bullets.  then I went and added player controled AAA beams to an interseptor, and slash beams to a bomber.  although I have yet to test those.  I also tried making the avenger balistic so it could track it's target, but it just keeps homing in on them instead of flying passed.  

Can I get a 'Homing lifetime' option?
Ie, homes in on target for 3 seconds, then goes dumbfire.
Title: SCP Avenger cannon
Post by: Woolie Wool on February 18, 2005, 10:58:01 am
Quote
Originally posted by Trivial Psychic
You might want to make it a ballistic primary.


But then I'd have to alter every ship table entry to give ships weapon ammo.
Title: SCP Avenger cannon
Post by: Solatar on February 18, 2005, 12:45:11 pm
Quote
Originally posted by terren
I allready did this for personal use, it looks realy cool when you set it so each 'shot' looks like about 8 or 10 bullets.  then I went and added player controled AAA beams to an interseptor, and slash beams to a bomber.  although I have yet to test those.  I also tried making the avenger balistic so it could track it's target, but it just keeps homing in on them instead of flying passed.  

Can I get a 'Homing lifetime' option?
Ie, homes in on target for 3 seconds, then goes dumbfire.



You made it home as a primary?


wow...this is the widest reply box I've ever seen...
Title: SCP Avenger cannon
Post by: Woolie Wool on February 18, 2005, 02:52:15 pm
Blame the tech description for the wiiiiide reply box.
Title: SCP Avenger cannon
Post by: Solatar on February 18, 2005, 03:36:29 pm
....
take it out and put *snip* or something...what I usually do on forums.:D
Title: SCP Avenger cannon
Post by: terren on February 20, 2005, 08:28:50 pm
In honsety I dont remember if it was a primary or secondary, I think I gave it a POF file as apposed to a laserglow, if I'm remembering the right weapon. I did about 4 or 5 avengers trying to get one working.