NPCs and laser temperature
Moderators: winston, another_commander, Getafix
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
NPCs and laser temperature
An issue which popped up in another thread prompts me to ask a question I had for a long time: How is laser temperature and overheating handled for NPCs?
In the target inspector almost each shot brings the bar from 0 to 1, where it stays without dropping until the next shot is fired. There is no visible relation between number of shots fired and laser temperature, also no sign of an effect of overheating.
Basically it looks like, although a laser temperature is defined, no sensible handling of it exists at all. Is that a correct observation?
In the target inspector almost each shot brings the bar from 0 to 1, where it stays without dropping until the next shot is fired. There is no visible relation between number of shots fired and laser temperature, also no sign of an effect of overheating.
Basically it looks like, although a laser temperature is defined, no sensible handling of it exists at all. Is that a correct observation?
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
“Laser overheating” for NPCs is modelled as a random chance of a random penalty to the delay between shots. Both the chance of this happening and the duration of the penalty is dependent on weapon_energy.
The temperature gauge in the debug inspector shows laserHeatLevel, which was added to ShipEntity for shader bindings – it’s never used internally. The calculation is (recharge rate - time to next shot opportunity) / recharge rate, clamped to [0..1]. In other words, it will rise to 1 on a shot without a penalty, then drop to 0 over the recharge time, after which the ship can fire again. if the penalty is incurred, it will saturate at 1 during the penalty period.
As far as I can see, there is no penalty mechanism at all for subentity weapons.
Code: Select all
// random laser over-heating for AI ships
if ((!isPlayer)&&((ranrot_rand() & 255) < weapon_energy)&&(![self isMining]))
{
shot_time -= (randf() * weapon_energy);
}
As far as I can see, there is no penalty mechanism at all for subentity weapons.
E-mail: [email protected]
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: NPCs and laser temperature
I think you are correct. The NPC laser heat is based on a random value, defined after each shot.Commander McLane wrote:Basically it looks like, although a laser temperature is defined, no sensible handling of it exists at all. Is that a correct observation?
Or more precise:
Code: Select all
[self resetShotTime];
// random laser over-heating for AI ships
if (((ranrot_rand() & 255) < weapon_energy))
{
shot_time -= (randf() * weapon_energy);
}
Edit: it was shot_time > weapon_recharge_rate, not shot_time > weapon_energy
Last edited by Eric Walch on Tue Apr 13, 2010 2:29 pm, edited 1 time in total.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Re: NPCs and laser temperature
Commander McLane wrote:An issue which popped up in another thread prompts me to ask a question I had for a long time: How is laser temperature and overheating handled for NPCs?
In the target inspector almost each shot brings the bar from 0 to 1, where it stays without dropping until the next shot is fired. There is no visible relation between number of shots fired and laser temperature, also no sign of an effect of overheating.
Basically it looks like, although a laser temperature is defined, no sensible handling of it exists at all. Is that a correct observation?
coincidently i found out about weapon_energy, the larger the more likely it is to random overheat.
Cheers Frame
Bounty Scanner
Number 935
Number 935
- Diziet Sma
- ---- E L I T E ----
- Posts: 6311
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Does this mean that laser subentities, such as on a Rattlecutter, will not overheat, in other words, they can just keep on firing indefinitely?Ahruman wrote:As far as I can see, there is no penalty mechanism at all for subentity weapons.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- DaddyHoggy
- Intergalactic Spam Assassin
- Posts: 8515
- Joined: Tue Dec 05, 2006 9:43 pm
- Location: Newbury, UK
- Contact:
Worryingly, that's what I suspect to be the case! (I'm sure Ahruman will confirm)Diziet Sma wrote:Does this mean that laser subentities, such as on a Rattlecutter, will not overheat, in other words, they can just keep on firing indefinitely?Ahruman wrote:As far as I can see, there is no penalty mechanism at all for subentity weapons.
Oolite Life is now revealed hereSelezen wrote:Apparently I was having a DaddyHoggy moment.
- JensAyton
- Grand Admiral Emeritus
- Posts: 6657
- Joined: Sat Apr 02, 2005 2:43 pm
- Location: Sweden
- Contact:
As far as I can see, yes.Diziet Sma wrote:Does this mean that laser subentities, such as on a Rattlecutter, will not overheat, in other words, they can just keep on firing indefinitely?
This of course suggests the follow-up question, “Why don’t you fix it, then?”
The ideal fix would be for NPCs to have the full player-style overheating mechanism. However, for this to work well the combat AI would need to be revised to take overheating into account, and I frankly have no idea how to go about it.
A simpler approach would be for the random “overheating” penalty to apply to all weapons on a ship. Since different weapons can have different firing rates, this would need the cooldown timer to be separated out, but it should be reasonably easy.
E-mail: [email protected]
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
They can't fire indefinitely as there is still the checkDiziet Sma wrote:Does this mean that laser subentities, such as on a Rattlecutter, will not overheat, in other words, they can just keep on firing indefinitely?
Code: Select all
if ([self shotTime] < weapon_recharge_rate)
And yes, as Ahruman just writes there is no extra time penalty like with the main weapon. However, when a ship has both a main- and sub- laser, the sub lasers will also respect the overheat time of the main laser.
UPS-Courier & DeepSpacePirates & others at the box and some older versions
Ah, see.
I was wondering why the only multilaser ship in my game (snark : 1 main and 2 subentity front lasers) was always stopping to fire after a while.
(They are tough enough like this )
So, as long as ships have main lasers firing in the same direction as their subentity weapons, everything is fine ?
I was wondering why the only multilaser ship in my game (snark : 1 main and 2 subentity front lasers) was always stopping to fire after a while.
(They are tough enough like this )
So, as long as ships have main lasers firing in the same direction as their subentity weapons, everything is fine ?