Page MenuHomeWildfire Games

Workshop templates reorganization
ClosedPublic

Authored by mimo on Nov 13 2017, 5:57 PM.

Details

Summary

Unify the old (mace) and new workshop templates in a military_workshop one (no need to inherit from barracks).

As introduced by Lordgood, i've kept the possibility to garrison siege units in workshop, but limit its number to 2. And not done in this patch, we could also add an Aura to repair garrisoned siege (as done for ships in shipyard).

Test Plan

Check that everything works, and templates validate.

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

mimo created this revision.Nov 13 2017, 5:57 PM
Owners added subscribers: Restricted Owners Package, Restricted Owners Package.Nov 13 2017, 5:57 PM
Vulcan added a subscriber: Vulcan.Nov 13 2017, 5:58 PM
Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 399| »   »   »   let·ratioMax·=·0.70·+·randFloat(0.,·0.1);
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '0.'.

binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 404| »   »   »   »   ratioMax·=·0.85·+·randFloat(0.,·0.1);
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '0.'.

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

mimo updated this revision to Diff 4168.Nov 13 2017, 6:36 PM

patch reuploaded without the two removing of files which will have to be done when commiting, as this seems to be the origin of the build failure (mace_siege_workshop and military_barracks_workshop)

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

Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 399| »   »   »   let·ratioMax·=·0.70·+·randFloat(0.,·0.1);
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '0.'.

binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 404| »   »   »   »   ratioMax·=·0.85·+·randFloat(0.,·0.1);
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '0.'.
mimo updated this revision to Diff 4169.Nov 13 2017, 6:42 PM

Try again with the stupid phabricator, now removing the map file because of blanks in the name.

elexis added a subscriber: elexis.Nov 13 2017, 6:55 PM

Thanks for removing the dupes! I didn't review every detail nor tested for completeness (the XML map files should be checked, there is no random map with them), but I definitely agree with and accept with the approach.

binaries/data/mods/public/simulation/templates/structures/cart_workshop.xml
12 ↗(On Diff #4168)

(thanks)

binaries/data/mods/public/simulation/templates/structures/mace_workshop.xml
1 ↗(On Diff #4168)

(A bit confusing with these new files. As long as no C++ code is changed we don't really need the build output. No need to reupload the patch, just be sure of what you commit. Also might want to svn propset svn:eol-style native filename when committing in case there is a new file)

binaries/data/mods/public/simulation/templates/template_structure_military_workshop.xml
32 ↗(On Diff #4168)

(Maybe something like Build siege engines to destroy your opponents buildings. Research technologies to improve the effectivenes of these weapons.)

40 ↗(On Diff #4168)

syntax issues

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

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Relax-NG validity error : Extra element props in interleave
/public/art/actors/structures/carthaginians/stable_elephant.xml:0: Relax-NG validity error : Element variant failed to validate content
/public/art/actors/structures/carthaginians/stable_elephant.xml:0: Relax-NG validity error : Element group has extra content: variant
Relax-NG validity error : Extra element group in interleave
/public/art/actors/structures/carthaginians/stable_elephant.xml:0: Relax-NG validity error : Element actor failed to validate content
Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 399| »   »   »   let·ratioMax·=·0.70·+·randFloat(0.,·0.1);
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '0.'.

binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 404| »   »   »   »   ratioMax·=·0.85·+·randFloat(0.,·0.1);
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '0.'.
mimo updated this revision to Diff 4172.Nov 13 2017, 7:33 PM

Update following elexis comments. The only map with workshop is the mace demo one, which should be updated when committing because of phabricator issues

mimo updated this revision to Diff 4173.Nov 13 2017, 7:36 PM

and fix typo

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

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Relax-NG validity error : Extra element props in interleave
/public/art/actors/structures/carthaginians/stable_elephant.xml:0: Relax-NG validity error : Element variant failed to validate content
/public/art/actors/structures/carthaginians/stable_elephant.xml:0: Relax-NG validity error : Element group has extra content: variant
Relax-NG validity error : Extra element group in interleave
/public/art/actors/structures/carthaginians/stable_elephant.xml:0: Relax-NG validity error : Element actor failed to validate content
Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 399| »   »   »   let·ratioMax·=·0.70·+·randFloat(0.,·0.1);
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '0.'.

binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 404| »   »   »   »   ratioMax·=·0.85·+·randFloat(0.,·0.1);
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '0.'.

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

Updating workspaces...
Build (release)...
Build (debug)...
Running release tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Running debug tests...
Running cxxtest tests (307 tests)...................................................................................................................................................................................................................................................................................................................OK!
Checking XML files...
Relax-NG validity error : Extra element props in interleave
/public/art/actors/structures/carthaginians/stable_elephant.xml:0: Relax-NG validity error : Element variant failed to validate content
/public/art/actors/structures/carthaginians/stable_elephant.xml:0: Relax-NG validity error : Element group has extra content: variant
Relax-NG validity error : Extra element group in interleave
/public/art/actors/structures/carthaginians/stable_elephant.xml:0: Relax-NG validity error : Element actor failed to validate content
Executing section Default...
Executing section Source...
Executing section JS...

binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 399| »   »   »   let·ratioMax·=·0.70·+·randFloat(0.,·0.1);
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '0.'.

binaries/data/mods/public/simulation/ai/petra/headquarters.js
| 404| »   »   »   »   ratioMax·=·0.85·+·randFloat(0.,·0.1);
|    | [NORMAL] JSHintBear:
|    | A trailing decimal point can be confused with a dot: '0.'.
Nescio added a subscriber: Nescio.EditedNov 14 2017, 12:30 PM

Question: why “workshop” and not the more precise “siege workshop”? I associate workshop with a place where furniture, pottery, sculpture, etc. are produced, not necessarily with siege engines. Besides, the only template currently being used, the Macedonian, is called “*_siege_workshop.xml”, therefore it would make sense to adjust those new ones to the existing, instead of the other way around.
template_structure_civic_civil_centre_military_colony.xml is an example of the use of longer, more precise names (when template_structure_centre_colony.xml could have been sufficient).

mimo added a comment.Nov 14 2017, 6:09 PM
In D1031#40666, @Nescio wrote:

Question: why “workshop” and not the more precise “siege workshop”? I associate workshop with a place where furniture, pottery, sculpture, etc. are produced, not necessarily with siege engines. Besides, the only template currently being used, the Macedonian, is called “*_siege_workshop.xml”, therefore it would make sense to adjust those new ones to the existing, instead of the other way around.
template_structure_civic_civil_centre_military_colony.xml is an example of the use of longer, more precise names (when template_structure_centre_colony.xml could have been sufficient).

You are mixing two things: in the templates directory, the names indicates inheritance "civil_centre_military_colony.xml" because the colony has the civil_centre as parent. Here, the workshop does not inherits from siege. And we already have military_workshop, so we don't expect to make potery there. And anyway, i think siege is too restrictive as mods could produce other units.
Then in the structure templates, that's another story. I've no strong opinions about a good name, except that i don't like siege_workshop as too restrictive. If people feel workshop is not clear enough, we could have military_workshop (as we already have military_colony).

(I can review it in detail if you want, but I wouldn't complain if you commit this if you convinced yourself that this works as you wish.)

mimo added a comment.Nov 14 2017, 7:41 PM
In D1031#40735, @elexis wrote:

(I can review it in detail if you want, but I wouldn't complain if you commit this if you convinced yourself that this works as you wish.)

ok i'll double check it and commit later. Only remaining point is the naming of the civ specific workshop in the structures directory: {civ}_workshop.xml or {civ}_military_workshop.xml or anything else? I'll wait a bit to see if some nice propositions.

bb added a subscriber: bb.Nov 14 2017, 7:50 PM

Some art is still named siege_workshop don't know if you also wan't to remove that

binaries/data/mods/public/simulation/templates/structures/brit_workshop.xml
13 ↗(On Diff #4173)

are you sure?

mimo added a comment.Nov 14 2017, 8:03 PM
In D1031#40739, @bb wrote:

Some art is still named siege_workshop don't know if you also wan't to remove that

Yes the icon and some iber stuff. I'd rather leave it for another patch, but it's important to settle quickly the naming of that to avoid to further diverge. (same thing for the stable vs stables templates which will have to be standardized in a following patch also).

binaries/data/mods/public/simulation/templates/structures/brit_workshop.xml
13 ↗(On Diff #4173)

thanks for spotting it.

I would have chosen {civ}_siege_workshop.xml intuitively too. I suspect mods might want to use a new template.
But since we now have template_structure_military_barracks_stables.xml, template_structure_military_barracks_workshop.xml, using {civ}_military_barracks_workshop.xml or a subset thereof would be ok for me as well. (Though not sure why a workshop counts as barracks.)
Just take care about the important part, files ending with a newline and svn propset svn:eol-style native files :P

In D1031#40737, @mimo wrote:
In D1031#40735, @elexis wrote:

(I can review it in detail if you want, but I wouldn't complain if you commit this if you convinced yourself that this works as you wish.)

ok i'll double check it and commit later. Only remaining point is the naming of the civ specific workshop in the structures directory: {civ}_workshop.xml or {civ}_military_workshop.xml or anything else? I'll wait a bit to see if some nice propositions.

In D1031#40744, @elexis wrote:

I would have chosen {civ}_siege_workshop.xml intuitively too. I suspect mods might want to use a new template.
But since we now have template_structure_military_barracks_stables.xml, template_structure_military_barracks_workshop.xml, using {civ}_military_barracks_workshop.xml or a subset thereof would be ok for me as well. (Though not sure why a workshop counts as barracks.)
Just take care about the important part, files ending with a newline and svn propset svn:eol-style native files :P

Making the barracks a parent for the workshop seems to be a bad idea to me; keep it directly as a military structure. And the naming in the structures/ folder typically follows the naming of the generic template.
So if template_structure_military_workshop.xml then also structures/{civ}_workshop.xml.
(Personally I would prefer template_structure_military_siege_workshop.xml and structures/{civ}_siege_workshop.xml though.
The suggestion template_structure_military_military_workshop.xml and structures/{civ}_military_workshop.xml I don't like at all (if I have to name the first which comes to my mind when encountering “military workshop” I'd say “armoury”, which is called a “blacksmith” in 0 A.D., but not really a siege engineers' structure).)

The exact naming is not that important; what matters is that's done consistently.

(I think it's quite obvious that Nescio has more insight on this than me)

This revision was automatically updated to reflect the committed changes.