Jump to content

Champion upgrade bug


hollth
 Share

Recommended Posts

In a game I just played I noticed that with the attack upgrade for champion units my civilian bowmen were upgraded too. Didn't notice if it applied to all soldiers or only the bowmen. I was playing as the Mauryans on Oasis. I'll try to test again next time I play to see if I can reproduce it and if it works with other civs.

Link to comment
Share on other sites

I didn't take a screen shot. Still getting used to mac commands etc.

Just then I was able to reproduce it with Carthaginians as well. So it doesn't seem to be related to civilisation.

Both civilian soldiers and champion soldiers are getting the +2 attack from the 'Heroism' tech

Link to comment
Share on other sites

Interesting, that tech affects all units, and even buildings.

I investigated the code, first take a look at the technology definition. You see that there is no general "affects" part, as in most other technologies (f.e. the first infantry hack armour tech). But there are affects per modification.

Now, in the code, these two affects get combined. The combination looks like [ [ ], ["Champion", "Melee"] ]. To check if the technology applies, it loops over the sub arrays, and checks if the entity has all classes of those sub array. So you could read it as "nothing OR ("Champion" AND "Melee")". Here, the "nothing" means that there is nothing required, so everything entity is affected.

Now, I don't know who's wrong. If the "affects" per modification is supposed to further refine the general "affects", then the code is wrong. But if the "affects" is supposed to work as an "OR" combination (and thus generalise the original "affects"), the code is right, but the template is wrong. In that case, the template should have set a general "affects" to "Champion Melee Ranged".

I can see both cases wanted. So before changing it, we need to find out if a change won't break other technologies.

Thanks for reporting this.

Link to comment
Share on other sites

I would imagine the intention for coding the Heroism tech that way is so Melee Champions only get a hack damage bonus, while Ranged Champions only get a pierce damage bonus. Surely there must be a way to make it work as intended, though it seems like you are on the case.

Apparently, its counterpart in the champion vs citizen soldier damage tech pair, Will to fight, is also coded the same way.

Edit: I figured it out, there is no need to specify Melee and/or Ranged, affects Champion, or CitizenSoldier for Will to fight, for the tech itself is all that is needed, because the way the modifications work was well thought out.

Edited by Zeta1127
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...