Page MenuHomeWildfire Games

clean up structure templates build restriction categories, sounds etc
ClosedPublic

Authored by Nescio on Sep 25 2020, 11:11 AM.

Details

Reviewers
Freagarach
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP24104: Clean up structure templates.
Summary

This patch cleans up some template_structure* lines.
Split off from D2855:

  • Defines attack sounds only in those structure templates that define an <Attack>.

Split off from D2993:

  • Defines <BuildingAI> only in those structure templates that define an <Attack>.

Split off from D3000:

  • Removes <Sound> from template_structure_special.xml, since most of its children have different values.
  • Removes <Health/Max> from template_structure_special.xml, since that's already present in most its children.
  • Removes <TerritoryInfluence> from template_structure_special.xml, since that belongs in most of its children too.
  • Purges unused <BuildRestrictions/Category> lines.
Test Plan

Check for completeness and correctness.

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
SeverityLocationCodeMessage
Warningbinaries/data/mods/public/simulation/components/BuildRestrictions.js:147JSHintBearJSHintBear
Warningbinaries/data/mods/public/simulation/components/BuildRestrictions.js:150JSHintBearJSHintBear
Warningbinaries/data/mods/public/simulation/components/BuildRestrictions.js:152ESLintBear (default-case)ESLintBear (default-case)
Warningbinaries/data/mods/public/simulation/components/BuildRestrictions.js:152JSHintBearJSHintBear
Warningbinaries/data/mods/public/simulation/components/BuildRestrictions.js:219ESLintBear (object-curly-spacing)ESLintBear (object-curly-spacing)
Warningbinaries/data/mods/public/simulation/components/BuildRestrictions.js:219ESLintBear (object-curly-spacing)ESLintBear (object-curly-spacing)
Warningbinaries/data/mods/public/simulation/components/BuildRestrictions.js:221ESLintBear (object-curly-spacing)ESLintBear (object-curly-spacing)
Warningbinaries/data/mods/public/simulation/components/BuildRestrictions.js:221ESLintBear (object-curly-spacing)ESLintBear (object-curly-spacing)
Warningbinaries/data/mods/public/simulation/components/BuildRestrictions.js:243JSHintBearJSHintBear
Warningbinaries/data/mods/public/simulation/components/BuildRestrictions.js:248ESLintBear (no-shadow)ESLintBear (no-shadow)
Warningbinaries/data/mods/public/simulation/components/BuildRestrictions.js:257ESLintBear (no-shadow)ESLintBear (no-shadow)
Warningbinaries/data/mods/public/simulation/components/BuildRestrictions.js:278ESLintBear (no-shadow)ESLintBear (no-shadow)
Unit
No Unit Test Coverage
Build Status
Buildable 13316
Build 26672: Vulcan BuildJenkins
Build 26671: Vulcan Build (macOS)Jenkins
Build 26670: Vulcan Build (Windows)Jenkins
Build 26669: arc lint + arc unit

Event Timeline

Nescio created this revision.Sep 25 2020, 11:11 AM
Owners added a subscriber: Restricted Owners Package.Sep 25 2020, 11:11 AM
Nescio edited the summary of this revision. (Show Details)Sep 25 2020, 11:12 AM
Nescio requested review of this revision.Sep 25 2020, 11:19 AM
Freagarach added inline comments.Sep 25 2020, 11:31 AM
binaries/data/mods/public/simulation/components/BuildRestrictions.js
9

Why this?

Nescio added inline comments.Sep 25 2020, 11:37 AM
binaries/data/mods/public/simulation/components/BuildRestrictions.js
9

"<Category>Special</Category>" is actually unused, keeping it only for this example is rather unnecessary.
CC was chosen as replacement because of line 11.

Nescio updated this revision to Diff 13537.Sep 25 2020, 1:05 PM
  • forgot other/ structures (not the first time)
Nescio updated this revision to Diff 13545.Sep 26 2020, 11:23 AM
Nescio retitled this revision from clean up structure templates sounds etc to clean up structure templates build restriction categories, sounds etc.
Nescio edited the summary of this revision. (Show Details)
  • remove unnecessary campaign_city_* <Attack> lines

Successful build - Chance fights ever on the side of the prudent.

builderr-debug-macos.txt
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:155:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
In file included from ../../../source/simulation2/tests/test_SerializeTemplates.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/simulation2/tests/test_SerializeTemplates.h:39:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        3, 0, 1, 4, 1, 5
                        ^~~~~~~~~~~~~~~~
                        {               }
In file included from ../../../source/graphics/tests/test_Camera.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/graphics/tests/test_Camera.h:168:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CVector3D(-101.0f, -101.0f, 101.0f),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
1 warning generated.
builderr-release-macos.txt
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:155:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libsimulation2.a(precompiled.o) has no symbols
In file included from ../../../source/simulation2/tests/test_SerializeTemplates.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/simulation2/tests/test_SerializeTemplates.h:39:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        3, 0, 1, 4, 1, 5
                        ^~~~~~~~~~~~~~~~
                        {               }
In file included from ../../../source/graphics/tests/test_Camera.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/graphics/tests/test_Camera.h:168:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CVector3D(-101.0f, -101.0f, 101.0f),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
1 warning generated.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/1586/display/redirect

Freagarach added inline comments.Sep 30 2020, 6:45 PM
binaries/data/mods/public/simulation/components/BuildRestrictions.js
9

Using the same as below kind of implies that they ought to be the same. I'd say just leave this file.

binaries/data/mods/public/simulation/templates/campaigns/campaign_city_minor_test.xml
11

Although the entity is unused, better not change effectively any templates.

binaries/data/mods/public/simulation/templates/campaigns/campaign_city_test.xml
11

Idem.

Nescio added inline comments.Oct 2 2020, 1:10 PM
binaries/data/mods/public/simulation/components/BuildRestrictions.js
9

It could also be changed to e.g. Structure. Keeping Special suggests it exists and is used elsewhere.

binaries/data/mods/public/simulation/templates/campaigns/campaign_city_minor_test.xml
11

What do you mean? The entity is used (campaign_test_map.xml), but removing these lines does not change anything: see parent.

Freagarach added inline comments.Oct 2 2020, 1:24 PM
binaries/data/mods/public/simulation/templates/campaigns/campaign_city_minor_test.xml
11

If I see it correctly the parent has a minrange of 0?

Nescio added inline comments.Oct 2 2020, 1:28 PM
binaries/data/mods/public/simulation/templates/campaigns/campaign_city_minor_test.xml
11

It does, however, setting <MinRange> to 1 has no effect in practice, or even 10 in this case, since it's much smaller than the footprint radius.

Nescio added inline comments.Oct 2 2020, 1:39 PM
binaries/data/mods/public/simulation/templates/campaigns/campaign_city_minor_test.xml
11

See also D611/rP19747.

Freagarach added a comment.EditedOct 8 2020, 6:47 PM
binaries/data/mods/public/simulation/components/BuildRestrictions.js
9

We have more bogus examples in the codebase? (Reason I nag about this is if this is unneeded we don't need to touch the file at all ^^ This my last one on this -- if you still don't agree we can just make this Structure and be done with it xD)

219–221

Unrelated and not close to changed code.

binaries/data/mods/public/simulation/templates/campaigns/campaign_city_minor_test.xml
11

Convinced.

binaries/data/mods/public/simulation/templates/structures/ptol_lighthouse.xml
50–51

Isn't a radius of 0 equal to just disabled?
EDIT: Moreover this fails since the node is incomplete.

Nescio updated this revision to Diff 13608.Oct 9 2020, 10:58 AM
binaries/data/mods/public/simulation/components/BuildRestrictions.js
9

It's an example and thus shouldn't be misleading.
For comparison, the entries in line 35 were also corrected in D2549/rP23853.

binaries/data/mods/public/simulation/templates/structures/ptol_lighthouse.xml
50–51

Nice catch!

Nescio updated this revision to Diff 13612.Oct 9 2020, 12:03 PM
  • removed unnecessary <TerritoryInfluence> from ptol_lighthouse.xml
Freagarach accepted this revision.Oct 9 2020, 12:54 PM
  • Units demo loads fine.
  • Changes are complete.
  • Changes are nice (cleans up nicely; we can add categories when needed).

Reverts: rP8854, partly rP7547, refs. rP8836.

binaries/data/mods/public/simulation/components/BuildRestrictions.js
9

Different, but okay.

This revision is now accepted and ready to land.Oct 9 2020, 12:54 PM
This revision was automatically updated to reflect the committed changes.