berto -> RE: AGElint first "official" 1.00 release (12/31/2011 4:04:05 PM)
|
quote:
ORIGINAL: Chliperic Another possible false positive: ChgUnitPoolInfos = $uni_DON_Amt1d;-999;75 The command accepts values from -999 to 999 for variation of force pool Interesting. Indeed, the AGEWiki page http://www.ageod.net/agewiki/ChgUnitPoolInfos says: quote:
<variation of Force Pool> Integer (-999 to 999) Changes the pool value by this amount Currently, txt.y has: chgunitpoolinfos: _CHGUNITPOOLINFOS eq val sc intpos
| _CHGUNITPOOLINFOS eq val sc intpos sc intpos
{
/*
http://www.ageod.net/agewiki/ChgUnitPoolInfos
Syntax: ChgUnitPoolInfos = <UnitDef>|<variation of Force Pool>|<AI Pool Ratio> .
*/
}
; I must change that to
chgunitpoolinfos: _CHGUNITPOOLINFOS eq val sc int sc pct (and possibly also add a CHKINT() to ensure that the second argument, the int, falls between -999 and 999). Note the removal of the first alternative
_CHGUNITPOOLINFOS eq val sc intpos The AGEWiki page clearly requires three arguments for the ChgUnitPoolInfos command. Why do I list the two-argument case? It's because in actual usage across all AGEOD games, I saw the following exceptions: [root@telemann agelint]# ./kwddat ChgUnitPoolInfos | awk -F\; 'NF!=3' 1 ChgUnitPoolInfos = $uni_GBR_Inf_1850C_Bde;2 1 ChgUnitPoolInfos = $uni_GBR_Inf_1870_Ghurkas_Rgt1;1 1 ChgUnitPoolInfos = $uni_GBR_Med_Med1;2 1 ChgUnitPoolInfos = $uni_GBR_Mix_1850_Bde;1 1 ChgUnitPoolInfos = $uni_GBR_Sig_Sig1850;3 1 ChgUnitPoolInfos = $uni_IND_Cav_1850_Bde;1 1 ChgUnitPoolInfos = $uni_IND_Inf_1850C_Bde;2 1 ChgUnitPoolInfos = $uni_IND_Mix_1850_Bde;2 1 ChgUnitPoolInfos = $uni_IND_Sup_Sup1;5 1 ChgUnitPoolInfos = $uni_MUG_Art_1840;2 1 ChgUnitPoolInfos = $uni_MUG_Cav_1850_Bde;5 1 ChgUnitPoolInfos = $uni_MUG_FortArt_1840;5 1 ChgUnitPoolInfos = $uni_MUG_Inf_1840C_Bde;15 1 ChgUnitPoolInfos = $uni_MUG_Mix_1840_Bde;10 1 ChgUnitPoolInfos = $uni_MUG_Sup_Sup1;10 1 ChgUnitPoolInfos = $uni_WH3_Mil1;0 When first coding txt.y, whenever I saw many usage counterexamples (where "many" is loosely defined), I inferred that the counterexamples might be acceptable alternative usages. It could be that - The AGE code had been extended to allow different alternative usages (in the ChgUnitPoolInfos example, allowing two arguments instead of three), and the AGEWiki docs had not been updated to reflect the extension.
- The AGEWiki doc is just flat out wrong; the actual usages are right.
- The AGE code recovers from the syntax errors gracefully, and defaults to some sensible behavior (in the ChgUnitPoolInfos, defaulting say to an assumed value of 100 (percent) for the missing third argument).
- The AGE 3.0 game, PON, might be extended to support alternative usages (but the AGEWiki was not yet edited to reflect that).
- Most peculiarly, when I saw usage exceptions in RUS -- there were more discovered in RUS than in any other game -- at the time I thought that the agreement with SEPRUS was that Pocus had farmed out the AGE coding to a SEPRUS programmer, thus that the RUS AGE engine code had forked from the mainline, standard AGEOD AGE (2.0) code.
I had learned from experience that directing explicit questions to the devs, requesting for clarification of this or that technical point directly, seldom got answered. (We can assume that the insiders were (a) too busy (quite likely) and/or (b) for whatever reason didn't care to respond.) I was more or less on my own to deal with the ambiguities I found, in some cases just guess, in many cases code the parser "loosely" in order to reduce the "false positivess" -- not always really "false"! In the above two-argument ChgUnitPoolInfos cases, if I had not coded the syntax rule exception, if I had gone strictly with the overwhelming usage consensus -- use three arguments (and had scrutinized the AGEWiki page; didn't always have time for that; or if I did, I didn't always trust its accuracy for reasons stated above) -- if I had omitted the two-argument parser case, then those lines would have been reported as "syntax error ...". Then afterwards complained about as "false positives"? Do you begin to understand how, if the people you are working with complain about false positives too much, I over-react by coding the parser too loosely, by sanctioning in-fact erroneous usage cases, cases of "true positives"? What's worse? (a) a false positive, or (b) an unreported true positive (actual error)? In the AGElint README file, I write: quote:
When deciding the txt.y parser rules, I am guided primarily by the AGE Wiki documentation (where it exists, which is not always), and secondarily by actual usage as demonstrated by the game data files. They are not always in agreement! And there is much ambiguity and nuance. Bear that in mind when reviewing/critiquing the txt.y parser specification. Going forward, and as I review and refine the txt.y parser, I will have to base "truth" on - The AGEWiki pages.
- Actual usage (across all games).
- Experienced dev/modder feedback (now possible, since I at least have your attention and active cooperation).
- Actual experimentation (don't just speculate; "look in the horse's mouth!") (but I really don't have time for it).
in that order of authority. Another long-winded response, I know. I would apologize for all the blah blah, but if we are to take AGElint further, we need to discuss where we are going with it. And the discussions need to consider nuance and complexities, hence a lot of blah blah. Anyway, thanks for pointing out the error. I will revisit and revise the ChgUnitPoolInfos (and many other) parser rules in the next and all future AGElint releases.
|
|
|
|