[Help Request] Enemies spawning with only one weapon?

Discuss and distribute tools and methods for modding. Moderator - Grognak
Posts: 40
Joined: Tue May 07, 2013 6:27 am

[Help Request] Enemies spawning with only one weapon?

Postby featherwings » Wed May 14, 2014 10:25 pm

So I'm working on a total weapons rewrite. (Hence the reason for that huge spreadsheet I've been passing around.) Is there any known XML error that would cause enemies to spawn with only one weapon? They have up to eight power bars but they always have exactly one weapon, leaving the rest of the power unused. This happens in all sectors, too.

Here's what my mod's doing so far:
- I've got a core set of weapons together that replaces all of the default weapons. This is in blueprints.xml. I'm not .append-ing blueprints.xml, since I don't want any of the existing weapons, but I started with a copy of vanilla blueprints.xml and deleted only the existing weapons so the rest of the code should be intact. These weapons all work, fire properly, etc. I've also added a few weapons to the player ships in blueprints.xml.
- I've cleared all the weapons in dlcBlueprints.xml - this is also not being .appended. I've left one dummy weapon in the blueprintList DLC_WEAPONS because FTL doesn't seem to like empty sets. The rest of the file hasn't been touched.
(I've tried with both of these files as .append and I still get the same issue)
- In both dlcBlueprintsOverwrite.xml.append and autoBlueprints.xml.append I've updated the weaponlists to only have my new weapons. I've tried using a list of all of my weapons, and I've tried using a subset of about four different weapons that don't do anything weird. I haven't touched the events weaponLists, but I figure that wouldn't cause this kind of bug.
- I'm running entirely new sectors and events (the other five files in my mod are sector_data.xml, events.xml.append, events_fuel.xml.append and newEvents.xml.append - but these aren't related to the problem since I get the exact same issue without the files using vanilla events, and when I'm using the Mod Testing Framework.
- I specifically haven't touched any of the any shipBlueprint descriptions anywhere - and the ships are spawning normally, just sans all but one weapon.

Even when the weaponList is exclusively 1 power weapons, they don't do anything - and it doesn't matter where I'm pulling ships from. My events call pirates, but the rebel fleet's elite fighters and MTE's "spawn ships" are also effected. (ships with defined weapons have more than one weapon, but they're broken as I don't have any of the original weapons.)

I've been crunching on this one for hours - I've tried it as all .append and as all no append, I've poured over vanilla files and other mods' weaponLists, and I just can't see what I'm doing wrong. I'll post my mod files if anyone wants, but I'd rather not unless it's necessary. Anyone have any thoughts?
Posts: 40
Joined: Tue May 07, 2013 6:27 am

Re: [Help Request] Enemies spawning with only one weapon?

Postby featherwings » Mon May 19, 2014 10:53 am

A quick bump and update - I've literally only hammered away at trying to fix this bug since my last post. It's getting incredibly frustrating and I'd love to know ANYTHING about how the game decides to allocate weapons from blueprintLists.

Some tests and findings:
Limiting the possible weapons to four doesn't change anything, and may even make things worse. Making every weapon blueprintList a vanilla burst laser I also breaks weapon assignment, although it's very different - enemies spawn with either no weapons or some weapons, but not "always one"

I took a vanilla blueprints.xml and slowly overwrote each part of the vanilla weapons loadout. It's definitely not a name problem, or an issue with an unmodified file somewhere else - keeping vanilla names but new descriptions causes the bug.

And this isn't a clear, always reproducible bug - as I increase the number of modded weapons, the probability a ship spawns with this issue approaches 100%. This makes it really frustrating to try to fix.

One thought I've had is that most of my weapons are BURST and BOOST, and maybe there's some internal restriction limiting the numbers of those tags on AI ships. Does anyone know anything about this? I'm sure I've seen enemies with multiple flak in vanilla.

Another thought is that it's related to the <bp> tag, which everyone says is "harmless" but I have a feeling might be tied into the generation somehow. I'm that desperate I've started dicking with <bp> values.

If anyone wants to look at my code, it's here:


And really, ANY thoughts would be appreciated. I'm getting desperate.
User avatar
Posts: 1472
Joined: Mon Jan 14, 2013 10:20 pm

Re: [Help Request] Enemies spawning with only one weapon?

Postby kartoFlane » Mon May 19, 2014 2:09 pm

IIRC there was a problem with ship lists that would cause a similar problem, ie. unmodded enemies would spawn most of the time. The solution was to completely remove all vanilla enemies, and replace them with exact copies, but with a different blueprint name (eg. MOD_AUTO_BASIC instead of AUTO_BASIC).
Perhaps you could try something similar here?
Superluminal2 - a ship editor for FTL
Posts: 40
Joined: Tue May 07, 2013 6:27 am

Re: [Help Request] Enemies spawning with only one weapon?

Postby featherwings » Wed May 21, 2014 7:49 am

I just finished trying that - replacing basically every xml file with new, non-append ones and I used notepad++'s replace in all open files to clear every reference to every vanilla weapon (except for the boss ones, the drone ones, and the crystal shard.)

Still getting the same issue, and I'm running out of options. It's officially gotten to the point where I've spent more on this issue than working on the mod itself.

(BTW kartoflame, your error checker is AWESOME BEYOND BELIEF even if I'm not getting any errors with this mod, it's nice to know it's not an FTL syntax error.)

What's weird is that sometimes I even occasionally get ships with a drone system but no drones - just two/three/four empty bars of drone system power. And I know they're not system repair or anything because I've been using level four sensors for this whole thing.

Has anyone seen the drones issue (an enemy spawns with a drone system but no drones) in vanilla? I want to make sure it's related to my mod.

Also, can someone report if they've seen an NPC ship in vanilla with multiple flak weapons? I'm slightly concerned about multiple <burst> weapons, and if someone's seen it in vanilla I know there's no hidden hardcoded limit against it.

Thanks again, everyone.
Posts: 40
Joined: Tue May 07, 2013 6:27 am

Re: [Help Request] Enemies spawning with only one weapon?

Postby featherwings » Wed May 21, 2014 11:17 pm

One more update:

Pretty sure it's related to the <type>BURST tag. The whole issue vanishes when I convert all of the weapons back to <type>LASER; and the more <type>BURST weapons I have the greater a chance a ship spawns with the bug.

I'd like to report this as a bug since I think it'd happen with vanilla flak weaponry too; so I guess I'd like to ask again if anyone's seen this happen in vanilla - an enemy with a Flak II and too many empty power bars or an enemy with both Flak I and Flak II?

Anyway, since 90% of my weapons are <type>BURST, I've got to re-think a lot of what I was trying to do.

First, I've got to dick around with manually assigning weapons load-outs semirandomly via <weapon name/> and blueprintLists (They work together! Not sure if I'll run into bugs like this exact issue though)

An alternative option is having an entire second set of weapons for NPCs which have the same stats but <type>LASER. Since enemies naturally "scatter" their shots, it wouldn't be too different, although these would be a fair bit stronger because they don't have the inherent miss rates of the player's burst weapons, but I never said I wanted this mod to be fair. :twisted:

If anyone else has any other suggestions I'd love to hear them!

Who is online

Users browsing this forum: No registered users and 11 guests