Scaling interaction with NoDefaultXXXEffects needs fixing

Creation, discussion, and balancing of game content such as techs, buildings, ship parts.

Moderators: Oberlus, Committer

Post Reply
Message
Author
Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Scaling interaction with NoDefaultXXXEffects needs fixing

#1 Post by Ophiuchus »

I think I might have messed up conceptually and broke stuff in master via commit 509683a4f84ee7155d9f7b62479b45f8d0d70c55

Fix PartCapacity and HullStructure to return unscaled values if default effects are disabled (#4307)


That changed the scaling which is used for Structure()/m_structure/METER_MAX_STRUCTURE and Speed()/m_speed/METER_SPEED in ship hull; and for ship parts Capacity() those RULE_SHIP_STRUCTURE_FACTOR (PC_ARMOUR),

E.g. with that commit now all reading of capacity for the upgradable weapon types is without damage scaling, because those are set NoDefaultCapacityEffects.
So the stringtables fix for weapon strength i just made for release-v0.5 do wrong values in master because those rely on PartCapacity.

The idea was to have no scaling if the default effects are disabled, because in a sense if you disable the default effects you are responsible for the result anyways.

I cant completely remember why I needed/wanted to disable the scaling.

One highly probable case is the 'Colony Base' hull type where the structure does not directly translate to the resulting structure (the colony base hull should be be able to be one-shotted by mines-1 and ard-disruptor-1 ; see b0470666943481976cf7e4b9ffa19672375abf11).
So the structure value of the hull design is either 2 or 16 (default structure scaling x8 ) while the usual effective structure will be 12 (2 scaled by the lower of damage x6 and structure scaling x8 )
If the scaling always applies, one would have to make the effect quite more convoluted by adding an extra division SHIP_STRUCTURE_FACTOR

There might be also a case with the speed of fields.

The upgradable weapon parts are all NoDefaultCapacity.
The default effect is to set the METER_MAX_CAPACITY (scaled) and the METER_MAX_SECONDARY_STAT, both unstacked.
The WEAPON_BASE_DEFAULT_EFFECTS from shortrange.macros used in the parts are the default effects if one does not own the necessary base tech (SetMaxCapacity,SetMaxSecondaryStat, guarded by a stackinggroup).
The WEAPON_BASE_EFFECTS from the tech ship_weapons.py also seems to recreate the default effects once per ship.
So currently i dont see/remember why the default effect is removed and recreated.

There is an extra effect to set the damage to big-number to make tech upgrades happen.
Note: it seems in that effect the secondary stat could/should also be set to big-number

I am not completely sure which way to go.


Either we say: scaling always applies, even if NoDefault*Effects is set; as the effects do not have anything to do with the base values (m_capacity, m_structure, m_speed)
* need to adjust base hull
* revert 509683a4f84ee7155d9f7b62479b45f8d0d70c55


Or we say: if you go NoDefault*Effects then you have to apply scaling by hand.
* need to check all uses of PartCapacity (not so many; maybe two relevant ones) and PartSecondaryStat (two)
* need to check HullSpeed and HullStructure() uses (zero)
* consider NoDefaultFuelEffects (basically all player used hulls because of fuel efficiency)/ check HullFuel uses (one)


Regardless:
* check why/if we need those weapon base effects
* if there is a NoDefaultXXXEffects, we could indicate that in the UI. E.g. base hull part could write: structure: 2 (depends non standard effects)
* we should check SetMaxSecondaryStat effects happen at the right time (e.g. flanking/charge for newly built ships with AD)
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Ophiuchus
Programmer
Posts: 3433
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Scaling interaction with NoDefaultXXXEffects needs fixing

#2 Post by Ophiuchus »

I tried going the "if you go NoDefault*Effects then you have to apply scaling by hand" route. And until now I am quite satisfied.

I think we can get rid of NoDefaultCapacityEffects in the upgradable weapons and the manual effects in the short_range.macros and ship_weapon.py. Bonus: the weapon part Shot damage is shown correctly (i.e. scaled) for the in the part pedia entry (e.g. Mass Driver 1 - Shot Damage: 18)

For the upgrades we will always need effects setting the meters (and those wont get reflected in the simple capacity/Shot Damage listing), as there are probably different tech levels between empires.

Else we could probably turn around the effects: set the PartCapacity to an upgraded value and then apply a negative effect "outdated tech" on the ships which have not been in supply since the tech got researched.
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

Post Reply