• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Solved] Upgrades not working as intended

Status
Not open for further replies.
Level 1
Joined
Apr 2, 2014
Messages
5
Hey all,

tl;dr upgrades aren't working well. Do these things get corrupted sometimes? It's like the Upgrade Effects - Operation and Upgrade Effects - Value are out of sync.

I'm working on a Campaign tech extension mod for multiplayer and I'm rather stumped atm. It's my first project on SC2 and I've learned a lot. After creating Terran Vehicle And Ship Weapons Ultra-Capacitors and Terran Vehicle And Ship Vanadium Plating I thought I pretty much had the Upgrades down. Protoss is giving me headaches though. All I did was removed the unused actors and effects from the upgrade list (hybrid, Karrass, etc) and added some missing heroes. I did this a million times for Terran with all the mercs.

The problem:
After upgrading protoss air weapons 1, Tempest ground damage (resonance coil) went from 30 to 3. It's supposed to be 30 + 3. So you'd think I accidentally set the operation from (add) to (set). I have tripple checked this, it is not the case.

To create protoss air weapons level 2, I copied all the effect content directly from my own level 1 and just changed the icons from level 1 weapons to level 2 weapons. Any bug that might've slipped in, you'd assume it'd be copied along as well. However the Tempest damage does go from 3 to 6, but this time it's icon isn't updated. This behaviou is consistent with Operations and Values being out of sync. It tries to set the 3 that is supposed to be added and it succeeds. Then it tries to add an image, which fails.

Sorry if I was a bit too verbose, I'm trying to provide info and understand for myself wtf is happening here. Halp?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Sounds like a XML corruption of sorts. The Data editor is not entirely bug free and can let ghost XML entries (well technically the correct term is field declarations) which are invisible to you in table or GUI editor mode.

The most common example is button requirements for passive buttons in the command card leaking onto active ability buttons in the command card when you change the type without defaulting the requirements field. This is not shown when editing the active ability button in the command card and can only been seen by swapping it to a passive button type or by viewing the XML and seeing an extra entry declared in the arrays.

Since XML mode requires some understanding of XML, which is easy but not something everyone can do, I advise attaching your map/mod and letting me look at it in the editor. Please state which upgrades have this problem.
 
Level 1
Joined
Apr 2, 2014
Messages
5
I see, that's good to know. Fortunately I do have *some* understanding of XML and the editor and I dug this out from UpgradeData.xml :

<CUpgrade id="ProtossAirWeaponsLevel1">
<EffectArray index="26" Reference="Effect,PurifierBeamDamage,Amount" Value="2.000000"/>
<EffectArray index="27" Reference="Weapon,ScoutGround,Level" Value="1"/>
<EffectArray index="28" Reference="Effect,ScoutGround,Amount" Value="1"/>
<EffectArray index="29" Reference="Weapon,ScoutAir,Level" Value="1"/>
<EffectArray index="30" Reference="Effect,ScoutAirU,Amount" Value="1"/>
<EffectArray index="31" Reference="Weapon,UrunEnergyBeam,Level" Value="1"/>
<EffectArray index="32" Reference="Effect,UrunEnergyBeamDamage,Amount" Value="2"/>
<EffectArray index="33" Reference="Weapon,MohandarPrismaticBeam,Level" Value="1"/>
<EffectArray index="34" Reference="Effect,MohandarMUx1,Amount" Value="1"/>
<EffectArray index="35" Reference="Effect,MohandarMUx2,Amount" Value="2"/>
<EffectArray index="36" Reference="Effect,MohandarMUx3,Amount" Value="4"/>
<EffectArray index="37" Reference="Weapon,ArtanisBeam,Level" Value="1"/>
<EffectArray index="38" Reference="Effect,ArtanisBeamDamage,Amount" Value="1"/>
<EffectArray index="39" Reference="Weapon,SelendisInterceptorBeam,Level" Value="1"/>
<EffectArray index="40" Reference="Effect,SelendisInterceptorU,Amount" Value="1"/>
<EffectArray index="41" Reference="Weapon,SelendisInterceptor,Level" Value="1"/>
<EffectArray index="42" Operation="Set" Reference="Weapon,ScoutGround,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel1.dds"/>
<EffectArray index="43" Operation="Set" Reference="Weapon,ScoutAir,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel1.dds"/>
<EffectArray index="44" Operation="Set" Reference="Weapon,UrunEnergyBeam,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel1.dds"/>
<EffectArray index="45" Operation="Set" Reference="Weapon,MohandarPrismaticBeam,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel1.dds"/>
<EffectArray index="46" Operation="Set" Reference="Weapon,ArtanisBeam,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel1.dds"/>
<EffectArray index="47" Operation="Set" Reference="Weapon,SelendisInterceptorBeam,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel1.dds"/>
<EffectArray index="48" Operation="Add" Reference="Effect,TempestDamage,AttributeBonus[Massive]" Value="2"/>
<EffectArray index="49" Operation="Set" Reference="Weapon,VoidRaySwarm,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel1.dds"/>
<EffectArray index="50" Operation="Add" Reference="Weapon,VoidRaySwarm,Level" Value="1"/>
<EffectArray index="51" Operation="Add" Reference="Effect,VoidRaySwarmDamage,Amount" Value="1"/>
<EffectArray index="52" Operation="Add" Reference="Effect,VoidRaySwarmEnhancedDamage,Amount" Value="1"/>
<EffectArray index="53" Operation="Set" Reference="Weapon,TempestGround,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel1.dds"/>
<EffectArray index="54" Operation="Add" Reference="Weapon,TempestGround,Level" Value="1"/>
<EffectArray index="55" Reference="Effect,TempestDamageGround,Amount" Value="3"/>
<EffectArray index="56" removed="1"/>
<EffectArray index="57" removed="1"/>
<EffectArray index="58" removed="1"/>
<EffectArray index="59" removed="1"/>
<EffectArray index="60" removed="1"/>
<AffectedUnitArray value="Scout"/>
<AffectedUnitArray value="Artanis"/>
<AffectedUnitArray value="Selendis"/>
<AffectedUnitArray value="SelendisInterceptor"/>
<AffectedUnitArray value="Mohandar"/>
<AffectedUnitArray value="Urun"/>
<AffectedUnitArray value="Tempest"/>
</CUpgrade>
<CUpgrade id="ProtossAirWeaponsLevel2">
<EffectArray index="26" Reference="Effect,PurifierBeamDamage,Amount" Value="2.000000"/>
<EffectArray index="27" Reference="Weapon,ScoutGround,Level" Value="1"/>
<EffectArray index="28" Reference="Effect,ScoutGround,Amount" Value="1"/>
<EffectArray index="29" Reference="Weapon,ScoutAir,Level" Value="1"/>
<EffectArray index="30" Reference="Effect,ScoutAirU,Amount" Value="1"/>
<EffectArray index="31" Reference="Weapon,UrunEnergyBeam,Level" Value="1"/>
<EffectArray index="32" Reference="Effect,UrunEnergyBeamDamage,Amount" Value="2"/>
<EffectArray index="33" Reference="Weapon,MohandarPrismaticBeam,Level" Value="1"/>
<EffectArray index="34" Reference="Effect,MohandarMUx1,Amount" Value="1"/>
<EffectArray index="35" Reference="Effect,MohandarMUx2,Amount" Value="2"/>
<EffectArray index="36" Reference="Effect,MohandarMUx3,Amount" Value="4"/>
<EffectArray index="37" Reference="Weapon,ArtanisBeam,Level" Value="1"/>
<EffectArray index="38" Reference="Effect,ArtanisBeamDamage,Amount" Value="1"/>
<EffectArray index="39" Reference="Weapon,SelendisInterceptorBeam,Level" Value="1"/>
<EffectArray index="40" Reference="Effect,SelendisInterceptorU,Amount" Value="1"/>
<EffectArray index="41" Reference="Weapon,SelendisInterceptor,Level" Value="1"/>
<EffectArray index="42" Operation="Set" Reference="Weapon,ScoutGround,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel2.dds"/>
<EffectArray index="43" Operation="Set" Reference="Weapon,ScoutAir,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel2.dds"/>
<EffectArray index="44" Operation="Set" Reference="Weapon,UrunEnergyBeam,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel2.dds"/>
<EffectArray index="45" Operation="Set" Reference="Weapon,MohandarPrismaticBeam,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel2.dds"/>
<EffectArray index="46" Operation="Set" Reference="Weapon,ArtanisBeam,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel2.dds"/>
<EffectArray index="47" Operation="Set" Reference="Weapon,SelendisInterceptorBeam,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel2.dds"/>
<EffectArray index="48" Operation="Add" Reference="Effect,TempestDamage,AttributeBonus[Massive]" Value="2"/>
<EffectArray index="49" Operation="Set" Reference="Weapon,VoidRaySwarm,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel2.dds"/>
<EffectArray index="50" Operation="Add" Reference="Weapon,VoidRaySwarm,Level" Value="1"/>
<EffectArray index="51" Operation="Add" Reference="Effect,VoidRaySwarmDamage,Amount" Value="1"/>
<EffectArray index="52" Operation="Add" Reference="Effect,VoidRaySwarmEnhancedDamage,Amount" Value="1"/>
<EffectArray index="53" Operation="Set" Reference="Weapon,TempestGround,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel2.dds"/>
<EffectArray index="54" Operation="Add" Reference="Weapon,TempestGround,Level" Value="1"/>
<EffectArray index="55" Reference="Effect,TempestDamageGround,Amount" Value="3"/>
<EffectArray index="56" removed="1"/>
<EffectArray index="57" removed="1"/>
<EffectArray index="58" removed="1"/>
<EffectArray index="59" removed="1"/>
<EffectArray index="60" removed="1"/>
<AffectedUnitArray value="Scout"/>
<AffectedUnitArray value="Artanis"/>
<AffectedUnitArray value="Selendis"/>
<AffectedUnitArray value="SelendisInterceptor"/>
<AffectedUnitArray value="Mohandar"/>
<AffectedUnitArray value="Urun"/>
<AffectedUnitArray value="Tempest"/>
</CUpgrade>
<CUpgrade id="ProtossAirWeaponsLevel3">
<EffectArray index="26" Reference="Effect,PurifierBeamDamage,Amount" Value="2.000000"/>
<EffectArray index="27" Reference="Weapon,ScoutGround,Level" Value="1"/>
<EffectArray index="28" Reference="Effect,ScoutGround,Amount" Value="1"/>
<EffectArray index="29" Reference="Weapon,ScoutAir,Level" Value="1"/>
<EffectArray index="30" Reference="Effect,ScoutAirU,Amount" Value="1"/>
<EffectArray index="31" Reference="Weapon,UrunEnergyBeam,Level" Value="1"/>
<EffectArray index="32" Reference="Effect,UrunEnergyBeamDamage,Amount" Value="2"/>
<EffectArray index="33" Reference="Weapon,MohandarPrismaticBeam,Level" Value="1"/>
<EffectArray index="34" Reference="Effect,MohandarMUx1,Amount" Value="1"/>
<EffectArray index="35" Reference="Effect,MohandarMUx2,Amount" Value="2"/>
<EffectArray index="36" Reference="Effect,MohandarMUx3,Amount" Value="4"/>
<EffectArray index="37" Reference="Weapon,ArtanisBeam,Level" Value="1"/>
<EffectArray index="38" Reference="Effect,ArtanisBeamDamage,Amount" Value="1"/>
<EffectArray index="39" Reference="Weapon,SelendisInterceptorBeam,Level" Value="1"/>
<EffectArray index="40" Reference="Effect,SelendisInterceptorU,Amount" Value="1"/>
<EffectArray index="41" Reference="Weapon,SelendisInterceptor,Level" Value="1"/>
<EffectArray index="42" Operation="Set" Reference="Weapon,ScoutGround,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel3.dds"/>
<EffectArray index="43" Operation="Set" Reference="Weapon,ScoutAir,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel3.dds"/>
<EffectArray index="44" Operation="Set" Reference="Weapon,UrunEnergyBeam,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel3.dds"/>
<EffectArray index="45" Operation="Set" Reference="Weapon,MohandarPrismaticBeam,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel3.dds"/>
<EffectArray index="46" Operation="Set" Reference="Weapon,ArtanisBeam,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel3.dds"/>
<EffectArray index="47" Operation="Set" Reference="Weapon,SelendisInterceptorBeam,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel3.dds"/>
<EffectArray index="48" Operation="Add" Reference="Effect,TempestDamage,AttributeBonus[Massive]" Value="2"/>
<EffectArray index="49" Operation="Set" Reference="Weapon,VoidRaySwarm,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel3.dds"/>
<EffectArray index="50" Operation="Add" Reference="Weapon,VoidRaySwarm,Level" Value="1"/>
<EffectArray index="51" Operation="Add" Reference="Effect,VoidRaySwarmDamage,Amount" Value="1"/>
<EffectArray index="52" Operation="Add" Reference="Effect,VoidRaySwarmEnhancedDamage,Amount" Value="1"/>
<EffectArray index="53" Operation="Set" Reference="Weapon,TempestGround,Icon" Value="Assets\Textures\btn-upgrade-protoss-airweaponslevel3.dds"/>
<EffectArray index="54" Operation="Add" Reference="Weapon,TempestGround,Level" Value="1"/>
<EffectArray index="55" Reference="Effect,TempestDamageGround,Amount" Value="3"/>
<EffectArray index="56" removed="1"/>
<EffectArray index="57" removed="1"/>
<EffectArray index="58" removed="1"/>
<EffectArray index="59" removed="1"/>
<EffectArray index="60" removed="1"/>
<AffectedUnitArray value="Scout"/>
<AffectedUnitArray value="Artanis"/>
<AffectedUnitArray value="Selendis"/>
<AffectedUnitArray value="SelendisInterceptor"/>
<AffectedUnitArray value="Mohandar"/>
<AffectedUnitArray value="Urun"/>
<AffectedUnitArray value="Tempest"/>
</CUpgrade>

Nothing seems particularly strange to me, though I don't know why operation is missing so often (there's a default?), but I don't know what to look for either. If this is insufficient information I have no problems uploading the map and handing it over.
 
Last edited:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
(there's a default?)
Yes, all fields have a default value based on data class (their parent).

<EffectArray index="55" Reference="Effect,TempestDamageGround,Amount" Value="3"/>
<EffectArray index="56" removed="1"/>
It appears that it has nonsense field declerations which may be causing the problem. If you could please send the map I will look at the problem myself and see if I can find the exact cause. It is saying index elements are "removed" but if this does not have a parent (which it does not) then there is no need to remove anything. It looks to me that the data editor has got a bit confused as to how to build the XML.

Specifically, it appears that index 1 to 25 are missing in the data declaration. Since the element has no parents these will be nonsense values. Such index data could be corrupting it.
 
Level 1
Joined
Apr 2, 2014
Messages
5
Ah, but there are quite a few parents actually, since I'm using the Swarm Story dependency. I had no idea the system worked like this before I looked at the xml, since I had no problems. I assumed the inheritance was just convenience for creation, but an upgrade actually takes a lot of data from its parents :x
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
Ah, but there are quite a few parents actually, since I'm using the Swarm Story dependency.
Yes but those entries you posted do not have a parent. This might be related to the bug as if they should have a parent yet do not it is not going to not work at all like you want. I can tell because when the entry is defined it has to be given a parent parameter with a reference to the parent for the entry. All the entries shown above are of a certain class (CUpgrade) but have no parent.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
I suspect it is caused by passive inheritance collisions caused by you overwriting the campaign mods with the melee balance mods resulting in illogical data. There is a reason they warn you not to use the melee balance mods and campaign mods at the same time.

I would advise making your own Protoss Air Weapon upgrade in parallel to the existing one. The only other solution would be a mess of manually tracking how values are declared through the mods and writing the appropriate XML code to make sure they are set correctly.

In Swarm mode you have...
<EffectArray Reference="Effect,TempestDamage,Amount" Value="3"/>
This is some element (you need to track inheritance and extensions to find out).

In SwarmMulti you have...
<EffectArray Reference="Effect,TempestDamageGround,Amount" Value="3"/>
This is the same element redeclared at another new index. The old one will probably be over written with garbage as the Multi mod was not made campaign aware.

Finally in your mod you have...
<EffectArray index="55" Reference="Effect,TempestDamageGround,Amount" Value="3"/>
This is specifically overwriting element 55 with it. The question is if the other two copies declared above have been over written properly or do they still exist?

Basically data inherits via two means. Parents and extension. Parents specify a source entry to be extended (generally applied when you declare a new element). Extension modifies existing entries changing values (generally applied by the dependency tree allowing a higher level data source to change values of a lower level data source).

The Multi mods and Campaign mods were designed to only be on top of the Base mods. Trying to put them on top of each other will result in inconsistent data as the extensions they provide were not designed with that in mind.

A balance change might modify, say, the carrier interceptor damage which is index 10. However one lower mod might move that entry to index 12. This will result in nonsense update array as whatever was in 10 is now interceptor stuff. Sure you can overwrite all entries to make sure they are in a consistent order but some times the XML compiler (that converts the tables into XML) fails to do it properly. Maybe the set/add field cannot be modified, who knows.

Still it will probably be less work in the long run to declare parallel data to the standard upgrades and get them to extend from the base air upgrade. It will not result in much larger file size as already you are having to re-declare a huge number of elements in the XML due to mal-alignment of array indices.
 
Status
Not open for further replies.
Top