Page MenuHomeWildfire Games

redo rP23804
ClosedPublic

Authored by Nescio on Jul 5 2020, 9:21 PM.

Details

Summary

The same idea, the same values, a different implementation, no rounding errors.
Also easier to maintain: if we want to apply the same modifications to other elephant templates, simply add a class.
See also D2685 and D2865.

Test Plan

Check for mistakes.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Nescio created this revision.Jul 5 2020, 9:21 PM
Owners added a subscriber: Restricted Owners Package.Jul 5 2020, 9:21 PM
Vulcan added a comment.Jul 5 2020, 9:22 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2589/display/redirect

Stan added a subscriber: wraitii.EditedJul 5 2020, 9:32 PM

mul_round should work too.

See D268 and rP22003 for history and the controversy.

To make it simple what it does is the following

Operation -> To Integer -> ToCharacterString()
ex: 300 * 1.1 -> 330 -> "330"
Operation -> ToCharacterString()
ex: 300 * 1.1 -> "330.0000"

Note that @wraitii forgot to update checkrefs.pl too. Might be obsoleted by the Python conversion of the script.

Not sure about the performance impact of using techs.

borg- added a subscriber: borg-.EditedJul 5 2020, 9:40 PM

@Nescio i can remove elephant loot of D2816, and keep only 300?

Nescio added a comment.Jul 5 2020, 9:46 PM

Not sure about the performance impact of using techs.

Technologies are global and permanent and don't really affect performance (see also advanced and elite technologies). Auras are temporary and local, so having too many of them could have an impact.

@Nescio i can remove elephant loot of D2816, and keep only 300?

Yes.

Stan added a comment.Jul 5 2020, 9:49 PM

They are however applied everytime something changes, (eg, if you change some stats of any units) While I believe template changes are not, but it's likely irrelevant yes.

If it were noticeable we wouldn't have technologies. Or civ bonuses. Or ranks.

Nescio edited the summary of this revision. (Show Details)Jul 5 2020, 10:09 PM
Stan added a comment.Jul 5 2020, 10:15 PM

If it were noticeable we wouldn't have technologies. Or civ bonuses. Or ranks.

Sure. Ranks change the templates :)

Can we actually see the tooltip somewhere? If not that means useless translation work.

The tooltip is there for consistency (and in case someone makes it automatically displayable in the future; cf. civ bonus files).

Stan added a comment.Jul 5 2020, 10:42 PM

Patch makes it work as expected (as in not breaking templates and keeping the default values) works no matter the civ (even gaia). My last concern is that if it might influence people into using more decimals which will lead to issues with rounding in the looting component (using mul_round doesn't have this issue)

Well, I suppose loot is supposed to be an integer, but then again, see advanced and elite technologies:

		{ "value": "Loot/food", "multiply": 1.2 },
		{ "value": "Loot/wood", "multiply": 1.2 },
		{ "value": "Loot/stone", "multiply": 1.2 },
		{ "value": "Loot/metal", "multiply": 1.2 },
		{ "value": "Loot/xp", "multiply": 1.2 }
Stan added a comment.Jul 5 2020, 10:49 PM

Yeah, I'm just being more careful this time, as I blindly trusted the previous patch, which I shouldn't have done.

Blind trust is rarely a good thing. Better be critical.

Stan added a comment.Jul 5 2020, 10:56 PM

Sure. But if I can't trust the people doing the reviews i can't merge the balancing patches :)

Stan added a comment.Jul 5 2020, 11:49 PM

Will give it another look tomorrow and commit it after that.

Stan accepted this revision.Jul 8 2020, 1:14 PM
This revision is now accepted and ready to land.Jul 8 2020, 1:14 PM
This revision was landed with ongoing or failed builds.Jul 8 2020, 1:21 PM
This revision was automatically updated to reflect the committed changes.
Owners added a subscriber: Restricted Owners Package.Jul 8 2020, 1:21 PM