Just seen this on the FD forums. One bug confirmed, looks like an update on its way.
https://forums.frontier.co.uk/showthrea ... ost4002121Mark Allen
Programmer- Elite: Dangerous
Frontier Employee
Given the speculation about what might be causing this bug, and what it means for the game - I thought I'd clarify a few things on the technical side . Sadly it wasn't as simple a change as an un-initialised or out of range value, my head would be a lot less hurty this week if it had been!
So, to try and explain.
The data for a module in Elite is split up into a set of blocks: things like power consumption, vulnerability to overheating, health, and of particular interest in this case, Weapon data. Weapon data is about 40-50 values controlling everything from the more obvious rate of fire & range, to slightly obscure things like how fast the beam fades after you release the trigger. More or less any combination of values is allowed (you want a laser shotgun? sure, take a pulse laser and set the Rounds Per Shot value to 12). This flow is identical between players and npcs, even stations and skimmers actually.
Prior to 1.6/2.1 the cached pointer each weapon held to its data was a simple affair pointing at a bit of data loaded from resources, but as part of the changes to make items modifiable I had to change this so it could also be a pointer to a block of data constructed from a base item plus a set of modifiers - ideally without the code reading that data caring (or even knowing) where it actually came from and therefore not needing to be rewritten to cope. This all works great in theory, and then in practice, up until a few naughty NPC's got into the mix and decided to make a mess. I'll gloss over a few details here, but the important information is that a specific sequence of events relating to how NPCs transfer authority from one players' machine to another, combined with some performance optimisations and an otherwise minor misunderstanding on my part of one of the slightly obscure networking functions got the weapon into an odd state. The NPC's weapon which should have been a railgun and had all the correct data for a railgun, but the cached pointer to its weapon data was pointing somewhere else. Dangling pointers aren't all that uncommon (and other programmers may know the pains they can cause!) but in this case the slightly surprising thing was that it would always be a pointer to a valid WeaponData - It's correct enough that it'd never have tripped any of the sanity checks or asserts that something was wrong, and yet.. clearly it's not right either!
What did this do exactly? Well in that example the weapon would have thought it was a slugshot: it'd make decisions on ammo, when to fire, how much power to consume and heat to generate as if it were a slugshot. It then tells the game to fire 12 shots but now we're outside the areas that use the cached data, the weapon manager knows its a railgun and dutifully fires 12 railgun shots . Depending on which machine this occurred on exactly it would either be as a visual artefact only that does no damage, or (more rarely but entirely possible) the weapon would *actually* fire 12 shots and carve a burning trail of death through the space in front of it. The hilarious part (for people not being aimed at) is that the bug can potentially cause hybrids of almost any two weapons... In my testing I've seen cases of railguns firing like slugshots, cannons firing as fast as multicannons, or my favourite absurd case of a Huge Plasma Accelerator firing every frame because it thought it was a beam laser... Ouch.
Why does this never occur on players? Well AI and players aren't governed by different rules in combat - but one thing AI's do that players never do is transfer authority between machines (it's rather hard to move out of range of yourself after all), which is the trigger at the heart of this bug. Removing modified weapons from NPCs earlier in the week will have reduced the frequency of the problem as it's more-or-less tied to how many modified weapons are in the session, the fix included in the build Zac mentioned coming soon should stamp it the rest of the way out. With the usual caveat of programmers: I fixed the problem I found, can't promise it's the last one!
Much as I love the insane weapons, and part of me likes having the proof that actually the system is hugely flexible... lets add them when we mean to next time! er... Sorry
-Mark