Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: SadisticSid on December 20, 2003, 01:25:16 pm

Title: Fire wait on turrets
Post by: SadisticSid on December 20, 2003, 01:25:16 pm
Any chance the SCP team could please enable turrets to fire once every 'fire wait' seconds instead of what they seem to be now? (put a Subach HL-7 on a turret and watch it fire very slowly to see what I mean.)

Hope this hasn't already been discussed, sorry if so!
Title: Fire wait on turrets
Post by: Lightspeed on December 20, 2003, 01:38:12 pm
that would be very useful, indeed :nod:
Title: Fire wait on turrets
Post by: diamondgeezer on December 20, 2003, 02:11:27 pm
I discovered that upping the turret AI's accuracy increases the rate of fire to what it's meant to be. I have no idea why this should be.
Title: Fire wait on turrets
Post by: TopAce on December 20, 2003, 03:09:39 pm
Even hostile fighters(with Ai) fire any kind of lasers far slower than the 'normal' fire rate. It is simply a balance thing. Nothing more, nothing less. But yeah, a slight RoF increase would be fine.
Title: Fire wait on turrets
Post by: karajorma on December 20, 2003, 05:27:21 pm
Quote
Originally posted by diamondgeezer
I discovered that upping the turret AI's accuracy increases the rate of fire to what it's meant to be. I have no idea why this should be.


Low accuracy gunners take longer trying to line up a shot? :p
Title: Fire wait on turrets
Post by: Flaser on December 20, 2003, 06:41:21 pm
With an SMG you'd do that while holding down the trigger, that's why they have the motto "spray and pray!" - the same would go for many weapons with hight ROF.
Title: Fire wait on turrets
Post by: Woolie Wool on December 20, 2003, 08:12:21 pm
Yeah, in Starforce, I'd like the turrets to really put out a hail of fire at you. However, it should be a FRED setting that can be enabled/disabled for each turret.
Title: Fire wait on turrets
Post by: CP5670 on December 21, 2003, 02:53:06 am
Quote
I discovered that upping the turret AI's accuracy increases the rate of fire to what it's meant to be. I have no idea why this should be.


yeah, "accuracy" is quite a misnomer for that setting; the AI's accuracy is always pretty much the same, and what it really controls is the rate of fire. It seems to affect both turrets and primary guns, but I am not sure about missile mounts.

I'm suspecting that the patience setting also does something completely unrelated to patience, as there certainly does not seem to be any difference in the patience levels of the computer ships (would be of little use anyway considering FS2's game mechanics). Maybe one of the coders can find some information on this.
Title: Fire wait on turrets
Post by: TopAce on December 21, 2003, 08:18:42 am
The $Patience is surely only for fighters. The turret fire rate decrease is only to balance the difficulty settings.
Title: Fire wait on turrets
Post by: phreak on December 21, 2003, 04:50:37 pm
this looks like the culprit

Code: [Select]

void turret_set_next_fire_timestamp(ship_subsys *turret, ai_info *aip)
{
float wait;
int weapon_id;

weapon_id = turret->system_info->turret_weapon_type;

wait = Weapon_info[weapon_id].fire_wait * 1000.0f;

// make side even for team vs. team
#ifndef NO_NETWORK
if ((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_TEAM)) {
// flak guns need to fire more rapidly
if (Weapon_info[weapon_id].wi_flags & WIF_FLAK) {
wait *= Ship_fire_delay_scale_friendly[Game_skill_level] * 0.5f;
wait += (Num_ai_classes - aip->ai_class - 1) * 40.0f;
} else {
wait *= Ship_fire_delay_scale_friendly[Game_skill_level];
wait += (Num_ai_classes - aip->ai_class - 1) * 100.0f;
}
}
else
#endif
{
// flak guns need to fire more rapidly
if (Weapon_info[weapon_id].wi_flags & WIF_FLAK) {
if (Ships[aip->shipnum].team == TEAM_FRIENDLY) {
wait *= Ship_fire_delay_scale_friendly[Game_skill_level] * 0.5f;
} else {
wait *= Ship_fire_delay_scale_hostile[Game_skill_level] * 0.5f;
}
wait += (Num_ai_classes - aip->ai_class - 1) * 40.0f;

} else if (Weapon_info[weapon_id].wi_flags & WIF_HUGE) {
// make huge weapons fire independently of team
wait *= Ship_fire_delay_scale_friendly[Game_skill_level];
wait += (Num_ai_classes - aip->ai_class - 1) * 100.0f;
} else {
// give team friendly an advantage
if (Ships[aip->shipnum].team == TEAM_FRIENDLY) {
wait *= Ship_fire_delay_scale_friendly[Game_skill_level];
} else {
wait *= Ship_fire_delay_scale_hostile[Game_skill_level];
}
wait += (Num_ai_classes - aip->ai_class - 1) * 100.0f;
}
}

// vary wait time +/- 10%
wait *= frand_range(0.9f, 1.1f);
turret->turret_next_fire_stamp = timestamp((int) wait);
}
Title: Fire wait on turrets
Post by: Taristin on December 21, 2003, 05:48:24 pm
...wait. Does that program it so that different teams fire at different rates?
Title: Fire wait on turrets
Post by: phreak on December 21, 2003, 05:58:06 pm
different teams and AI classes
Title: Fire wait on turrets
Post by: Taristin on December 21, 2003, 06:00:47 pm
I figured as much. I didn't bother to read the whole thing through... *shrugs*

Anyone gonna change it? :p
Title: Fire wait on turrets
Post by: TrashMan on December 21, 2003, 07:04:15 pm
Yeah! Change the darn thing! We want real ROF!
Title: Fire wait on turrets
Post by: Odyssey on December 21, 2003, 07:05:51 pm
[color=cc9900]What's wrong with just changing the AI level, TrashMan?[/color]
Title: Fire wait on turrets
Post by: SadisticSid on December 22, 2003, 09:05:02 am
Well look at the code - for one thing, flak always fires faster than normal weapons. If we could have an 'obey TBL fire wait' override flag for the weapon, that would let us have more flexibility in designing weapons while maintaining vanilla FS2 compatibility.
Title: Fire wait on turrets
Post by: phreak on December 22, 2003, 09:33:55 am
i was thinking of having weapons that have refire times of <=1/2 second should be fired as fast as possible instead of being  modified like that.
Title: Fire wait on turrets
Post by: SadisticSid on December 22, 2003, 09:37:18 am
Sounds good, yeah, although you might want to leave in those limitations for multiplayer.