Matrix Games Forums

Forums  Register  Login  Photo Gallery  Member List  Search  Calendars  FAQ 

My Profile  Inbox  Address Book  My Subscription  My Forums  Log Out

AGElint -- an AGE debugging toolkit

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums >> [Current Games From Matrix.] >> [World War I] >> Revolution Under Siege Gold >> Mods and Scenarios >> AGElint -- an AGE debugging toolkit Page: [1] 2 3 4 5   next >   >>
Login
Message << Older Topic   Newer Topic >>
AGElint -- an AGE debugging toolkit - 12/10/2011 2:05:52 AM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

Here, for your debugging and gaming pleasure, is AGElint.

What is AGElint? Akin to the well-known C programming language utility lint. ("Lint: A Unix C language processor which carries out more thorough checks on the code than is usual with C compilers. Lint is named after the bits of fluff it supposedly picks from programs." See here.) Similarly, AGElint is a toolkit of programs designed to discover and report bugs, problems, glitches, anomalies in the AGEOD game data files.

If anybody thinks that AGElint is poppycock, that I'm just making this up, please read this:

http://en.wikipedia.org/wiki/Static_code_analysis

http://en.wikipedia.org/wiki/Automated_code_review

Proactive, pre-execution debugging (AGElint) vs. reactive, post-execution debugging (the traditional way).

Static analysis (AGElint) vs. dynamic analysis (playtest the game, inspect the log files).

Each approach has its strengths and weaknesses, but together they've got the bugs surrounded -- no escape!

NOTE: I make no claim about the significance or insignificance of any discovered bug, problem, glitch, or anomaly. Whether or not it impacts game play, or goes entirely unnoticed. Whether in the larger scheme of things it's important, or unimportant. I just call them as I see them.

It's up for you to decide, and maybe for us as a community to determine. (If over time we agree that something is not worth reporting, or is not in fact any kind of problem, I will program it out of the toolkit.)

FURTHER NOTE: I offer no judgment about AGEOD, or its games. Nothing asserted, nothing implied. AGElint is a tool, not a weapon. We use it to build better games, not to tear down any company or anybody. Please let's keep our discussions positive and constructive, shall we?

In the spirit of sharing knowledge, empowering the players, and bettering the gaming experience, I give you AGElint:

Here is the fifth "official" AGElint version, 1.2.1 (20121110):

For changes in the most recent "official" versions, please see the distribution CHANGES file, and/or see post #198 of this "AGElint -- an AGE debugging toolkit" message thread.

See also: AGEpp -- an AGE code beautifier

Players of the world unite! You have nothing to lose but your bugs!

< Message edited by berto -- 11/25/2012 5:22:55 AM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com
Post #: 1
AGElint: What's the point? MUST-READS & README - 12/10/2011 2:06:50 AM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

AGElint MUST-READS

Here are some must-read docs for installing and making best use of AGElint:



AGElint README

===============================================================================

INTRODUCTION

Here, for your debugging and gaming pleasure, is AGElint.

What is AGElint? Akin to the well-known C programming language utility lint. ("Lint: A Unix C language processor which carries out more thorough checks on the code than is usual with C compilers. Lint is named after the bits of fluff it supposedly picks from programs." See here.). Similarly, AGElint is a toolkit of programs designed to discover and report bugs, problems, glitches, anomalies in the AGEOD game data files.

If anybody thinks that AGElint is poppycock, that I'm just making this up, please read this:

http://en.wikipedia.org/wiki/Static_code_analysis

http://en.wikipedia.org/wiki/Automated_code_review

Proactive, pre-execution debugging (AGElint) vs. reactive, post-execution debugging (the traditional way).

Static analysis (AGElint) vs. dynamic analysis (playtest the game, inspect the log files).

Each approach has its strengths and weaknesses, but together they've got the bugs surrounded -- no escape!

NOTE: I make no claim about the significance or insignificance of any discovered bug, problem, glitch, or anomaly. Whether or not it impacts game play, or goes entirely unnoticed. Whether in the larger scheme of things it's important, or unimportant. I just call them as I see them

It's up for you to decide, and maybe for us as a community to determine. (If over time we agree that something is not worth reporting, or is not in fact any kind of problem, I will program it out of the toolkit.)

FURTHER NOTE: I offer no judgment about AGEOD, or its games. Nothing asserted, nothing implied. AGElint is a tool, not a weapon. We use it to build better games, not to tear down any company or anybody.

AGElint deals directly with the game data text files, and only peripherally with the AGEOD source .xls/DB files. So AGElint works outside "the system". It might be said that if you muck with the game data text files, you are on your own and should expect no official support from AGEOD.

I might issue new releases of AGElint as circumstances -- and user enthusiasm -- warrant. AGElint is, and forever remains, a work-in-progress, improving over time. More layers of bug checking can be added, and its capabilities are far from exhausted. This is the current state of AGElint, which reflects my imperfect and evolving understanding of the AGE system and its scripting. I make my share of mistakes, but except for honest differences of opinion, I correct my goofs!

In the spirit of sharing knowledge, empowering the players, and bettering the gaming experience, I give you AGElint.

Players of the world unite! You have nothing to lose but your bugs!

===============================================================================

BEFORE YOU BEGIN

In order to install and run AGElint, you will need to use (a) Linux (or some other suitable Unix-like OS, such as FreeBSD); and/or (b) Cygwin for Windows (or some other Unix-like environment for Windows).

AGElint, at least as currently constituted, is firmly rooted in Unix/Linux. (Note: after this, I will mostly cease referring to Unix/Linux, Cygwin, and qualifying the terms. Henceforth, I will mostly just use "Linux". You should take that to mean Linux, but also any of the alternative compatible host environments. I will only qualify as necessary.)

I make no apologies for that. AGElint works on the vast amounts of AGEOD game text file data. And Linux, in countless ways, is a superior OS to Windows for raw data processing. (If you doubt that, just consider this one fact: Most of the world's financial exchanges are now Linux-based. But also: Linux is at the heart of many well known cutting edge technology companies, such as Google. And if not Linux, one form or another of Unix. Windows is okay as a consumer and gaming OS, but for back-end production work, Unix/Linux is king.)

You will see much use of Linux commands, OS capabilities, and Unix philosophy coursing through the AGElint toolkit. AGElint as a native Windows application or toolkit? There's simply no way.

To install and run AGElint, it's easiest simply to do it on Linux, with AGEOD game installations to process copied to your Linux filesystem (using rsync or scp/WinSCP over the network, for example), else installed on a USB stick (the method I preferred).

If you are not prepared to run this in Linux, there is at least one Windows-based Unix environment alternative -- Cygwin for Windows. See

http://cygwin.com/

From the Cygwin home page:

Cygwin is:

* a collection of tools which provide a Linux look and feel environment for Windows.
* a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality.

Cygwin is not:

* a way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.
* a way to magically make native Windows apps aware of UNIX® functionality like signals, ptys, etc. Again, you need to build your apps from source if you want to take advantage of Cygwin functionality.

I have installed and used Cygwin for Windows over the years on multiple Windows systems. It is easy to install. It's a nice way to get your feet wet with Unix, short of diving right into Unix/Linux.

If you are handy with Linux, indeed if you are "just" a Windows power user, installing Cygwin is not that hard. It's certainly no harder than (following the "official" AGEOD modding procedure):

--installing OpenOffice
--installing the AGE CSV splitter
--editing the "official" AGEOD DB/.xls files
--saving those files as .csv files
--running those saved .csv files through the CSV splitter
--placing the resulting game data files in their appropriate folders
--running the AGEOD game in special edit mode
--saving the game
--etc.

I will have nothing more to say about the "difficulty" of installing/running Linux/Cygwin. You decide how far your comfort zone extends.

===============================================================================

INSTALLATION

For Cygwin installation, please see the provided INSTALL_CYGWIN file.

For AGElint installation, please see the provided INSTALL_AGELINT file.

For more about the agelint compile process, read on. (If you have installed AGElint properly as described in the INSTALL_AGELINT and don't care to know the technical details, just skip the rest of this discussion and proceed to the OPERATION section.)

If you use the recommended make command

$ make clean; time make 2>&1 | egrep -iv "warning: conversion to" | tee make.log; echo; egrep -i "shift|reduce" make.log

you should see something like:

-------------------------------------------------------------------------------

[root@telemann agelint]# make clean; make 2>&1 | egrep -iv "warning: conversion to" | tee make.log; echo; egrep -i "shift|reduce" make.log
rm -f agelint *.o lex.*.c *.tab.c *.tab.h *.output make.out core
make -r agelint 2>&1 > make.out 2>&1; cat make.out | egrep -iv "with different width due to prototype|^lex.txt.c|useless"; date; ls -l agelint
make[1]: Entering directory `/home/berto/games/ageod/agelint'
gcc -O2 -Wall -Wshadow -Wconversion -Wpointer-arith -Wcast-qual -c agelint.c -o agelint.o
...
bison -d -v -p txt -b txt txt.y
txt.y: conflicts: 7 shift/reduce, 2 reduce/reduce
gcc -O2 -Wall -Wshadow -Wconversion -Wpointer-arith -Wcast-qual -c txt.tab.c -o txt.tab.o
txt.tab.c: In function ‘txtparse’:
flex -B -Caem -i -Ptxt txt.l
gcc -O2 -Wall -Wshadow -Wconversion -Wpointer-arith -Wcast-qual -c lex.txt.c -o lex.txt.o
...
gcc -O2 -Wall -Wshadow -Wconversion -Wpointer-arith -Wcast-qual -o agelint agelint.o cmd.tab.o lex.cmd.o conf.tab.o lex.conf.o txt.tab.o lex.txt.o -ly -lm
make[1]: Leaving directory `/home/berto/games/ageod/agelint'
Tue Jan 17 01:42:21 CST 2012
-rwxr-xr-x. 1 root root 6900427 Jan 17 01:42 agelint
agelint version 1.1.0.20120117

txt.y: conflicts: 7 shift/reduce, 2 reduce/reduce

-------------------------------------------------------------------------------

What's going on here?

The AGElint executable, agelint, is coded in C, lex, and yacc. The component agelint source files are:

agelint.c
agelint.h
cmd.l
cmd.y
conf.l
conf.y
Makefile
txt.l
txt.y

If you know C, the .c & .h & Makefile should be familiar. The .l are the flex (lex) lexer specifications, and the .y are the bison (yacc) parser (grammar) specifications.

The .l and .y files are C-like. flex processes the .l files, and bison process the .y files, to generate C files -- of hideous complexity -- which are then compiled by gcc, then linked together with the compiled .c components into one single executable, agelint.

If flex and bison are new to you, if you haven't programmed lexers and parsers before -- and if you wish to tweak or seriously rewrite the .l & .y files -- be prepared to have your mind blown. flex and bison programming can seem mighty weird. You will experience this if, say you make a "little" change here or there, and your conflicts line says something like:

txt.y: conflicts: 768 shift/reduce, 523 reduce/reduce

rather than the current

txt.y: conflicts: 7 shift/reduce, 2 reduce/reduce

These "conflicts" represent ambiguities in the lexer/parser specification. Ideally you want 0 conflicts of each type, but that is difficult to impossible, depending on the coding pains you take, and possibly the language (in this case, the AGE scripting language) that you are attempting to model.

I will have (much) more to say about agelint's technical innards in forum postings and possibly added doc files at a later date.

The AGElint toolkit includes a number of Bash & Perl scripts, some to invoke the agelint executable, but others to run independently. The Perl scripts

fixlint.pl
excludes.pl
chklocals.pl
chkimages.pl
chkfiles.pl
chkaliases.pl
chksel.pl (with two links to that script, chkselfac.pl & chkselreg.pl)
common.pl
conf.pl
chklint.pl

(and perhaps others) and the Bash script

dochk

(and perhaps others) should run just fine with little or no tweaking required.

===============================================================================

OPERATION

A typical agelint command

$ ./agelint -n -w +e +c5 +u +x -g rus "Events/GRNAI.sct" 2>&1 | less

to check the RUS Events/GRNAI.sct file, not showing sources or using less, not showing notices or warnings, but showing errors, with 5 lines of context, with AGE Wiki URL, with syntax summary.

(NOTE: You can take care of the pesky spaces in Windows file names either by enclosing your file specifications in "" as shown, else adding a \ before every space.)

You can run AGElint again most or all of the game data text files in Events, but also Aliases, Includes, Scens, Scripts, and any of the subfolders in the GameData directory tree.

Here is a usage summary for agelint:

$ ./agelint +h

Usage: agelint { +h | +V | {+|-}nwevsuxqXNLTG +c# | {+|-}{la|lf|li|ll}} [-S {ALL|<# ...>}] [-I {ALL|<# ...>}] [-g {acw|ncp|pon|rop|rus|wia|chk|fix} <data file>]

+h show program help
+V show program version
+|-n show/don't show notices
+|-w show/don't show warnings
+|-e show/don't show errors
+|-v show/don't show event
+|-s show/don't show sources
+|-u show/don't show AGEWIKI command URLs
+|-x show/don't show AGE command syntax
+|-q show/don't show squelches
+|-X show/don't show text files
+|-N show/don't show line numbers
+|-L use/don't use less to display output
+|-c[#] show/don't show context (# of lines, 1-9)
+|-la list/don't list alias refs
+|-lf list/don't list all file refs
+|-li list/don't list image file refs
+|-ll list/don't list localization refs
-S squelch lines
-I ignore lines
+|-T run/don't run in test mode
+|-G run/don't run in debug mode

agelint checks just one file. chklint.pl is a wrapper script to process all files (with some exclusions that you can specify in the game excludes.???.dat file).

Here is a typical chklint.pl operation:

$ ./chklint.pl -n -w +e +c9 +u +x +q -g rus 2>&1 | tee ./chklint.rus.error.out

The command-line options for chklint are much like those for agelint:

$ ./chklint.pl -h
Usage: chklint.pl {+|-}tnwevsuxqEFTG [+c#] [-S <# ...>] -g {acw|ncp|pon|rop|rus|wia|chk|fix}

The Perl scripts, and support files:

Here is a typical chkaliases.pl operation:

$ ./chkaliases.pl -g ncp 2>&1 > chkaliases_ncp_TEST_20120117_rpt.txt

Command lines for the other chk*.pl scripts are similar.

fixlint.pl is the beginnings of a script to mechanistically autocorrect many of the simpler "bugs" in the AGE data text files (such as removing extraneous trailing |). It is designed for invoking within chklint.pl to fix hundreds and even thousands of problem across all the games files en masse, in one single operation. fixlint.pl, and its association with chklint.pl, is definitely a work-in-progress. Use at your own risk!

dochk is the wrapper script for running chklint.pl and all the other chk*.pl scripts (and optionally preparing a .zip file with various report files).

A typical operation:

-------------------------------------------------------------------------------

[root@berto agelint]# time ./dochk acw TEST
doing chklint...
doing chkaliases...
doing chklocals...
doing chkimages...
doing chkfiles...
doing chkselfac...
doing chkselreg...

report files generated:

chkaliases_acw_TEST_20120117_lst.txt
chkaliases_acw_TEST_20120117_pat.txt
chkaliases_acw_TEST_20120117_rpt.txt
chkaliases_acw_TEST_20120117_sorted_rpt.txt
chkfiles_acw_TEST_20120117_lst.txt
chkfiles_acw_TEST_20120117_rpt.txt
chkfiles_acw_TEST_20120117_sorted_rpt.txt
chkimages_acw_TEST_20120117_lst.txt
chkimages_acw_TEST_20120117_rpt.txt
chkimages_acw_TEST_20120117_sorted_rpt.txt
chklint_acw_TEST_20120117_error_rpt.txt
chklint_acw_TEST_20120117_warning_rpt.txt
chklocals_acw_TEST_20120117_lst.txt
chklocals_acw_TEST_20120117_rpt.txt
chklocals_acw_TEST_20120117_sorted_rpt.txt
chkselfac_acw_TEST_20120117_lst.txt
chkselfac_acw_TEST_20120117_rpt.txt
chkselfac_acw_TEST_20120117_sorted_rpt.txt
chkselreg_acw_TEST_20120117_lst.txt
chkselreg_acw_TEST_20120117_rpt.txt
chkselreg_acw_TEST_20120117_sorted_rpt.txt

real 8m0.226s
user 1m31.938s
sys 4m22.007s

-------------------------------------------------------------------------------

I could go on at great, great length; I could write a whole manual about how to use the AGElint toolkit. Instead, I will post usage examples at the forum in the weeks and months ahead.

Whatever. Play around with agelint, experiment!

===============================================================================

POSTSCRIPT

At the moment...

I have essentially finished the process of filling out the txt.y parser file. Most of the stanzas are "finished" to sufficient detail (basing off the "definitive" AGE Wiki pages), but a few are still written in more generic style.

The txt.l lexer file is essentially complete, but I tweak it from time to time as necessary.

The other *.[lych] files are generally pretty clean.

(NOTE: I originally ported this over from my earlier Magna Mundi work, "EU3debug" -- a project internal to the EU3/Magna Mundi mod. There might be bits and pieces of EU3debug cruft remaining in the AGElint project files! And even a PIKT reference or two. [See my Open Source project: http://pikt.org.])

The various chk*.pl scripts are more or less done -- but there are always bugs, refinements, and extensions, right?

At present, AGElint is more than a beginning, but far from an ending. The dream is to code a set of utilities and capabilities to check all manner of AGEOD bugs/errors/glitches/anomalies. In agelint itself, beyond the syntax checking already in place, there are the beginnings of semantic and logic checking. Outside of agelint, there are many more QA checks we can apply to the AGE game data files.

There is a large component of the AGElint system I have omitted from this distribution: the AGE command/keyword inventory. I spent 1-1/2 days of computer processing time (no kidding!) surveying and compiling a "kwd" database of actual AGE command/keyword usage. 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.

The plan is to make the kwd database available for reference on the Web. Also to host an AGElint web services site, where you could upload files for checking without having to install and run AGElint yourself. (Other big plans, too.)

There's still much more untapped potential, much more to be done...

Good luck, and happy debugging!

Robert Osterlund
aka Berto
20120117

===============================================================================




< Message edited by berto -- 11/2/2012 9:46:00 AM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to berto)
Post #: 2
Cygwin INSTALL - 12/10/2011 2:07:36 AM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

Cygwin INSTALL


Visit the Cygwin home page:

http://cygwin.com/



In the menu, click on the Install Cygwin link, taking you to the page:

http://cygwin.com/install.html



Click on the "Run setup.exe" link.



Do not Run; instead Save setup.exe on your hard drive. I suggest in the My Documents folder.



Click on the Run button. Ignore any security warnings. It is surely safe to run setup.exe. Select Next.



Select Install from Internet.



At the Select Root Install Directory screen, go with the suggested default, C:\cygwin, and All Users (RECOMMENDED).



For the Select Local Package Directory, I suggest using the My Documents folder, not your Desktop. (Change as necessary.)



At the Select Your Internet Connection screen, use the appropriate choice, most probably Direct Connection (the default).



At the Choose A Download Site screen, select a (hopefully) nearby http (preferred) or ftp site. In the example, I have chosen http://mirrors.kernel.org. (In the past, I have always used the server at nearby Argonne National Laboratory, but for some reason it is not listed here now.)



Click on Next to proceed with the download. If you get a warning about "this is a major release" or somesuch, you can just ignore it (click on OK).

You will then proceed to the Cygwin Setup - Select Packages screen.



Search for gcc, then click on the Devel + box.



Click on the gcc-g++: C++ compiler. Note how "Skip" changes to "3.4.4-999" (or whatever).



In like fashion, do a search, and select also (click on the "Skip", thereby changing it to a selected version number), for:

make (make: The GNU version of the 'make' utility)
flex (flex: A fast lexical analyzer generator)
bison (bison: A parser generator that is compatible with YACC)

(the above should all be in the Devel tree)

perl (perl: Larry Wall's Practical Extracting and Report Language)

(in its own Perl tree)

awk (gawk: GNU awk, a pattern scanning and processing language)

(in the Base tree; probably already selected by default)

less (less: A file pager program, similar to more(1))

(in the Text tree, probably already selected by default)

zip (zip: Info-ZIP compression utility)
unzip (unzip: Info-ZIP decompression utility)

(in the Archive tree)

For editing, maybe also

vi (vim: ViIMproved - enhanced vi editor)

(in the Editors tree)

but if you are a Windows user, you will probably be more comfortable just using Notepad; vi is a standard part of any Linux install)

and possibly also (my preference!)

emacs (emacs: The extensible, customizable, self-documenting real-time display editor)

(in the Editors tree; your choice whether xemacs or ordinary emacs)

(If you learn Emacs -- highly recommended! -- you will face a steep learning curve; but you will have a very fine, extremely powerful editor indeed.)

When you are done making all your software choices, select Next at the Resolving Dependencies screen. (Leave the "Select required packages (RECOMMENDED)" box selected.)



You will then proceed with the download and install. Progress bars and statistics will display, tracking your progress. This will take a while.



...

On successful installation, you will see the Create Icons screen. Your choice, but probably best to keep both boxes checked (the default).



Before you proceed, remember the setup.exe that you (recommended) saved in your My Documents folder? You are advised to copy and paste that into your newly created C:\cygwin folder. You might need to rerun setup.exe in future, say to install missing pieces, acquire new programs, and do software updates. It's easiest to remember setup.exe's location in C:\cygwin, so do copy and paste it there.



After successful installation, you should see a Cygwin Terminal icon on your Desktop, also a Programs -> Cygwin -> Cygwin Terminal Windows menu selection. Open the terminal either way.



You should then see an open Cygwin terminal window, much like an ordinary Windows Command Prompt.



If you got this far, congratulations! You have successfully installed Cygwin. (Was that really so hard?)

< Message edited by berto -- 5/21/2013 9:44:04 AM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to berto)
Post #: 3
AGElint INSTALL - 12/10/2011 2:08:04 AM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

AGElint INSTALL

===============================================================================

Firstly:

--If Windows is your working environment, you must have installed Cygwin beforehand. See the INSTALL_CYGWIN file for details.

--If Linux is your working environment, you should make sure you have installed

gcc (C compiler, and support tools, libraries, etc.)
make
flex (lex)
bison (yacc)

You should have installed by default

perl
awk
less
zip/unzip

If anything is missing, just use your standard Linux software update facility.

Secondly:

Open a Cygwin Terminal (or Linux terminal, depending), if you haven't done so already.

Make a folder for your AGElint installation. Then cd (change directory) into that folder. (pwd stands for 'print working directory'. Note that I have resized the terminal window downward, increasing its viewing area. Your choice.)



Substitute your own user name, of course. (That will be a common understanding, so I won't refer to this need for a Berto -> [your user name] substitution hereafter.)

(Note: For now, most of the images will show installs in the Cygwin environment. Linux users should adapt accordingly.)

In your Web browser, visit

http://pikt.org/ageod/agelint/

and select either

agelint.windows.current.zip

or

agelint.unix.current.zip

depending on your preferred working environment. (That is, select agelint.windows.current.zip if you are working in Cygwin, else in Linux choose agelint.unix.current.zip.) (The agelint.*.current.zip is a link that will always point to the very latest AGElint package.)

For Cygwin, save in the folder C:\cygwin\home\Berto\Games\AGEOD\agelint.

In your terminal, list ('ls -l') the downloaded and saved package, and unzip it.



Before you proceed, you might -- but probably shouldn't -- need to tweak the provided Makefile. In Cygwin, you might use the editor vi, as in

$ vi Makefile

[the $ is the Cygwin Unix command prompt; you only type and enter commands after the $]

but probably you would prefer to use Notepad, in which case open c:\cygwin\home\Berto\Games\AGEOD\agelint\Makefile.

(Technical note: In Windows parlance, directory trees use the \ backslash; while Linux uses the / forward slash. A sometimes infuriating difference!)

If (and only if) you made any changes (probably not needed), save your edited Makefile.

Now, on to a very big step -- compiling AGElint.

In your terminal window, issue the command

$ make

or better

$ make clean; make 2>&1 | egrep -iv "warning: conversion to" | tee make.log; echo; egrep -i "shift|reduce" make.log

You should see compiler output like so:



If all goes well (it should!), you should see at the end a listing of the compiled executable, agelint, followed by a line reporting any txt.y conflicts.



Now run the command

$ ./agelint +h

to see an AGElint usage summary.



If you see that, again congratulations! You should have a working agelint.

(If you don't; if something went wrong, just post at the forum, else send me a PM or private e-mail: robert.osterlund [at] comcast.net)

Before you proceed, there is one more file to edit: agelint.conf



By default, I have gameroot set to the USB drive I use for my AGElint work (usually in Linux). If you prefer, you can copy and paste your AGEOD game install onto a USB drive, else you can work on your actual game install. Do as you wish, but I usually prefer to work off a USB drive install, for that way I am sure to leave my actual game files untouched.

(Note: In Cygwin, C:\ is equivalent to /cygdrive/c. So if you have installed your AGEOD game into C:\Games\AGEOD\Revolution Under Siege, its Cygwin equivalent would be /cygdrive/c/Games/AGEOD/Revolution Under Siege.

Also -- this can really be infuriating! -- in the Cygwin (and Linux) terminal, embedded spaces in Windows file and directory names will mess up your Cygwin (Linux) commands. You can solve that problem either by either (a) enclosing your windows file/dir names in quotes, else (b) adding a \ backslash before file/dir spaces. I will show both usages in the many AGElint examples to follow.)

As you can see, for this example, I have set gameroot to /cygdrive/c/Games/AGEOD -- i.e., specified locations of actual game installs on my game system hard drive (not on the USB installs; those lines are commented out with the # symbol).

gameroot is the parent directory of all possible AGEOD games (unless you are running AGElint in a non-standard way, e.g., using a USB installation in Linux).

So if you see something like

Berto@brito ~/Games/AGEOD/agelint
$ egrep gameroot agelint.conf
gameroot "/cygdrive/c/Games/AGEOD"

Berto@brito ~/Games/AGEOD/agelint
$ ls /cygdrive/c/Games/AGEOD
Pride of Nations
Revolution under Siege
Rise of Prussia

you know that you have set gameroot correctly.

For now, you can just ignore the dataroot setting.

If you have installed your games using the suggested AGEOD defaults, e.g., "Revolution under Siege", you may leave the rusdir etc. as is, else comment them out. You would change these settings if you want AGElint to act on games installed in non-standard folders, a mod say, as in for example:

rusdir "Revolution under Siege Fatal Years/RUS"

Be sure to save your edited agelint.conf before continuing.

Now, with your agelint executable compiled, and your agelint.conf tweaked, it's time to run your first debug session.

Try entering the command

$ ./agelint -n -w +e +c5 +u +x -g rus "Events/GRNAI.sct" 2>&1 | less

Translation: (in the current directory) run agelint, don't show notices or warnings but do show errors, show 5 lines of context, show the AGEWIKI URL, show the AGE command syntax, for the game Revolution Under Siege, processing the file Events/GRNAI.sct. (Again, best to put "" around Windows file names, to deal with possible embedded spaces.)

You should see something like this.



If you hit the 'f' key (for forward) 5 or 6 times, you should see the first error (unless you are working on a fixed version of the GRNAI.sct file!). (Hit the 'b' key to go back. 'j' goes down a line, 'k' goes back up. 'q' quits.)



If you see that, more congratulations!! You should have a working, functional AGElint installation.

(Again, if you don't just inform me via any of the methods mentioned earlier.)

One more thing...

The AGElint toolkit includes a number of Bash & Perl scripts, some to invoke the agelint executable, but others to run independently. The Perl scripts

fixlint.pl
excludes.pl
chklocals.pl
chkimages.pl
chkfiles.pl
chkaliases.pl
common.pl
conf.pl
chklint.pl

(and perhaps others)

and the Bash script

dochk

(and perhaps others) should run just fine with little or no tweaking required.

===============================================================================

< Message edited by berto -- 12/30/2011 9:14:00 AM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to berto)
Post #: 4
AGElint TODO - 12/10/2011 2:09:23 AM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

AGElint TODO



As of now, AGElint supports all current AGEOD AGE system games. You can use it just as well to debug one game as another.

Going forward, AGElint development will focus on AGEOD games in this order of priority (highest to lowest):

  • RUS, Revolution under Siege
  • ACW, American Civil War
  • ROP, Rise of Prussia
  • WIA, Wars in America
  • NCP, Napoleon's Campaigns
  • PON, Pride of Nations

This ordering is based on:

  • ongoing, active modding
  • ongoing, active, diligent fixing of bugs en masse
  • ongoing, active, useful, constructive player and modder feedback
  • player activity
  • forum activity
  • closest proximity to bug-free "perfection"
  • the AGElint developer's areas of personal player interest

Note that, in the shared AGE engine, most commands and data are common to all games. So work and improvements focusing on the top-ranked games (RUS, ACW & ROP) will spill over as well to the other, lower-ranked games (WIA, NCP, PON). But commands and data and nuances specific to the lower-ranked games -- especially PON, with its many, many new commands and data extensions -- will get less, if any attention. Eventually, perhaps, but not in the near term. In the near term, attention will be directed to where the action is.



Things still to do in agelint:

  • In the txt.y parser, reduce genericalness, increase specificity.
  • Deepen and extend the txt.y parser, refining the syntax checks, but also adding semantic and logical checks.
  • Integrate SelectFaction & SelectRegion into the semantic and logical checks.
  • In the txt.y parser, add more CHKINT() checks.
  • Better pinpoint the exact line number of reported error.
  • Better describe errors (and not so readily default to the generic, often uninformative "syntax error").
  • Improve parser 'error' recovery, for detecting all errors etc. in a given data file.
  • In names, more generally solve the problem of "foreign" (non-English, non-ASCII) characters.
  • Generally solve the problem of files not ending in EOL (end-of-line, e.g., CR/LF).
  • Present a pleasing display of blank lines for every possible combination of agelint command arguments.
  • Better pinpoint the exact DB sources file of reported error.



Things still to do in the *.pl and other (Perl & Bash) scripts:

  • Add automated setting of agelintroot & gameroot in all scripts, not just the chk*.pl ones (by, for example, universal reference to agelint.conf).
  • Check for duplication of UIDs/aliases.
  • Check inter-regional linkages.
  • Trim, or better categorize, reported "bad" aliases, localizations, graphics files, etc.



Other things still to do:

  • Extend the 'make check' to encompass still more regression tests.
  • Develop a functioning 'make install'.
  • Add still more examples to the USAGE file.
  • Host a web services site, where users can upload and check game data files without their having to install and run AGElint locally.
  • Host on the web the Kwd (AGE keyword usage) database and support programs.
  • In general, reduce false positives to a bare minimum.
  • Fix bugs!




< Message edited by berto -- 1/9/2012 11:06:46 AM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to berto)
Post #: 5
AGElint MISC - 12/10/2011 2:09:53 AM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

AGElint MISC



Some basic Cygwin/Linux commands (using Cygwin for the example operating environment):

exit the Cygwin/Linux command 'shell' (terminal):

$ exit

change to the agelint directory:

Berto@brito ~
$ cd Games/AGEOD/agelint

Berto@brito ~/Games/AGEOD/agelint
$

print working directory:

$ pwd
/home/Berto/Games/AGEOD/agelint

change to the 'home' directory (default, with no command arguments):

Berto@brito ~/Games/AGEOD/agelint
$ cd

Berto@brito ~
$

list current directory (default, with no command arguments):

$ ls
CHK chkfiles.pl conf.tab.h lex.conf.c
FIX chkimages.pl conf.tab.o lex.conf.o
INSTALL chklint.pl conf.y lex.txt.c
Makefile chklocals.pl dochk lex.txt.o
NOTES cmd.l excludes.acw.dat make.log
README cmd.output excludes.ncp.dat make.out
TODO cmd.tab.c excludes.pl squelches.chk.pl
agelint.c cmd.tab.h excludes.pon.dat trimrpt.pl
agelint.conf cmd.tab.o excludes.rop.dat txt.l
agelint.exe cmd.y excludes.rus.dat txt.output
agelint.h common.pl excludes.wia.dat txt.tab.c
agelint.o conf.l fixlint.pl txt.tab.h
agelint.windows.current.zip conf.output lex.cmd.c txt.tab.o
chkaliases.pl conf.tab.c lex.cmd.o txt.y

list only Perl files:

$ ls *.pl
chkaliases.pl chkimages.pl chklocals.pl excludes.pl squelches.chk.pl
chkfiles.pl chklint.pl common.pl fixlint.pl trimrpt.pl

list only excludes files:

$ ls excludes*
excludes.acw.dat excludes.pl excludes.rop.dat excludes.wia.dat
excludes.ncp.dat excludes.pon.dat excludes.rus.dat

list contents of CHK directory:

$ ls CHK
Aliases Events GameData Includes Scripts Settings

show a long listing of the CHK directory:

$ ls -l CHK
total 0
drwxr-xr-x+ 1 Berto None 0 Sep 14 14:50 Aliases
drwxr-xr-x+ 1 Berto None 0 Sep 14 14:18 Events
drwxr-xr-x+ 1 Berto None 0 Sep 14 04:01 GameData
drwxr-xr-x+ 1 Berto None 0 Sep 14 15:28 Includes
drwxr-xr-x+ 1 Berto None 0 Sep 28 03:47 Scripts
drwxr-xr-x+ 1 Berto None 0 Sep 14 03:58 Settings

show the man (manual) pages for the ls command:

$ man ls
[output omitted here for brevity]

['q' quits, exits you out of, the man page; see the 'less' instructions below for moving about the ls (and all other) man pages]

change to the CHK directory, then change back to the parent directory:

Berto@brito ~/Games/AGEOD/agelint
$ cd CHK

Berto@brito ~/Games/AGEOD/agelint/CHK
$ pwd
/home/Berto/Games/AGEOD/agelint/CHK

Berto@brito ~/Games/AGEOD/agelint/CHK
$ cd ..

Berto@brito ~/Games/AGEOD/agelint
$ pwd
/home/Berto/Games/AGEOD/agelint

report file system disk space usage:

$ df -h
Filesystem Size Used Avail Use% Mounted on
C:/cygwin/bin 112G 31G 82G 28% /usr/bin
C:/cygwin/lib 112G 31G 82G 28% /usr/lib
C:/cygwin 112G 31G 82G 28% /
C: 112G 31G 82G 28% /cygdrive/c

display the chklint.pl program file:

$ less chklint.pl

and while in the 'less' display:

f -- to go forward [tap the 'f' key]
b -- to go backward
j -- to go one line down
k -- to go one line back
G -- go to end of file
1G -- go to beginning of file
/rus -- to search forward for all instances of string 'rus'
?rus -- to search backward for all instances of string 'rus'
n -- to jump from one instance to the next (backwards or forwards) of the found string
q -- quit the 'less' display

show the man (manual) pages for the less command:

$ man less

['q' quits, exits you out of, the man page]

edit the agelint.conf file:

$ vi agelint.conf

(else just use Notepad)

show the man (manual) pages for the vi (aka vim) command:

$ man vim

list all files with the string 'revolution' therein (case insensitive):

$ egrep -il revolution *
NOTES
agelint.exe
agelint.h
agelint.windows.current.zip
chklint.pl
cmd.tab.o
common.pl
dochk
fixlint.pl

show lines with string 'revolution' therein (case insensitive) in the common.pl file:

$ egrep -i revolution common.pl
$GAMEROOT .= "/Games/AGEOD/Revolution\ Under\ Siege/RUS";

make a backup copy of the agelint.conf file:

$ cp agelint.conf agelint.conf.bak

diff (show the differences) between two files:

$ diff agelint.conf agelint.conf.bak

determine all of the differences between two different AGEOD game installations, from one release to another:

Robert@roberto /cygdrive/c/Games/AGEOD
$ diff -r "Revolution under Siege" "Revolution under Siege FY" 2>&1 | tee RUS.diff

The Cygwin (Unix/Linux) 'tee' command outputs to both screen and the specified file. If you prefer, you could instead avoid the screen output and just capture to the file with:

$ diff -r "Revolution under Siege" "Revolution under Siege FY" 2>&1 > RUS.diff

You could then inspect the RUS.diff file, with either of:

$ less RUS.diff

$ view RUS.diff

or use NotePad (or your preferred Windows editor or file viewer) as you wish.

mv (rename) a file:

$ mv agelint.conf.bak agelint.conf.BAK

[ ... and as I think of it, much more to follow ...]




< Message edited by berto -- 1/30/2012 9:08:47 PM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to berto)
Post #: 6
AGElint USAGE - 12/10/2011 2:10:17 AM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

AGElint USAGE



agelint (and other script) command examples:

show errors only (no text, etc.):

$ ./agelint -n -w +e +v +c3 -u -x -X -g rus "Events/GRNAI.sct" 2>&1 | less

ERROR: in /cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/GRNAI.sct, at (or before) line 102: syntax error: #A# (0x41), #Aera#

in event evt_nam_AI_GRNzoneKuban:

99 CheckAILevel = 1
100 MinDate = 1917/11/01
101 MaxDate = 1923/01/01
102> SelectSubUnits = Aera $Area_Kuban;FactionTags $GRN;Domains $Land
103 EvalSubUnitCount = >=;1
104
105 Actions


ERROR: in /cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/GRNAI.sct, at (or before) line 119: syntax error: #A# (0x41), #Aera#

in event evt_nam_AI_GRNzoneKuban:

116 MinDate = 1917/11/01
117 MaxDate = 1923/01/01
118 EvalEvent = evt_nam_AI_GRNzoneKuban;=;1
119> SelectSubUnits = Aera $Area_Kuban;FactionTags $GRN;Domains $Land
120 EvalSubUnitCount = =;0
121
122 Actions

[ ... ]

show errors only (no text, etc.), using the 'less' command internally (to agelint):

$ ./agelint -n -w +e +v +c3 -u -x -X +L -g rus "Events/GRNAI.sct"

(Note: Do not use the +L agelint option if you are piping or redirecting to a file agelint output!)

show errors, with text (but nothing else):

$ ./agelint -n -w +e -v +c3 -u -x +X -g rus "Events/GRNAI.sct" 2>&1 | less

(then, within the 'less' display, use the less key commands to move about the file, e.g., '/ ERROR' to search for all instances of error)

show warnings & errors (but nothing else):

$ ./agelint -n +w +e -v -c -u -x -X -g rus "Events/GRNAI.sct" 2>&1 | less

ERROR: in /cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/GRNAI.sct, at (or before) line 102: syntax error: #A# (0x41), #Aera#

ERROR: in /cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/GRNAI.sct, at (or before) line 119: syntax error: #A# (0x41), #Aera#

ERROR: in /cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/GRNAI.sct, at (or before) line 139: syntax error: #A# (0x41), #Aera#

[ ... ]

(note that you don't need to pipe output to less; but then excess output will scroll up and off the top of your terminal window)

show warnings & errors, with context & syntax usage, across all RUS files:

$ ./chklint.pl +t -n +w +e +c3 -u +x -g rus 2>&1 | less

Aliases/Abilities Kind.ini, Mon Jul 12 2010 10:02:02

Aliases/abi_Alias.ini, Sun Sep 4 2011 21:10:36

Aliases/Actors.ini, Fri Jun 18 2010 16:27:06

Aliases/AI Variables.ini, Thu Oct 8 2009 12:06:30

[ ... ]

Aliases/NATO Families Images Steam.ini, Fri Jun 11 2010 15:25:08

ERROR: in /cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Aliases/NATO Families Images Steam.ini, at (or before) line 2: syntax error: #s# (0x73), #symbol_general_2.png#

1
2> $Imgfam0 = symbol_general_2.png
3 $Imgfam11 = symbol_armyHQ.png
4 $Imgfam12 = symbol_hq1.png
5 $Imgfam21 = symbol_inf.png

[ ... ]

check aliases across all RUS game data files:

$ ./chkaliases.pl -g rus 2>&1 | less

/cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/2-CzechLegion1918.sct:2922: Fergana not found
/cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/3-November1918.sct:5508: mdl_WH5_Sup not found
/cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/3-November1918.sct:5512: mdl_WH3_Sup not found
/cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/3-November1918.sct:5556: mdl_WH3_Sup not found
/cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/3-November1918.sct:5558: mdl_WH3_Sup not found
/cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/3-November1918.sct:5679: mdl_WH3_Sup not found
/cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/3-November1918.sct:5681: mdl_WH3_Sup not found
/cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/3-November1918.sct:5760: Area_Tzaritsyn not found
/cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events/3-November1918.sct:9603: uni_WH3_Bat not found
[ ... ]

[ ... and as I think of it, many more example usages to follow, in this message, and subsequent ones ...]




< Message edited by berto -- 12/30/2011 10:05:12 AM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to berto)
Post #: 7
AGElint FIX, Cygwin rsync - 12/10/2011 3:24:44 PM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

AGElint FIX

What's with that AGElint FIX directory?

The FIX directory is where you can fix, edit, experiment with copies of game data files outside of your normal installation. In that way, 'fix' is a sort of pseudo game environment, much like the actual 'acw', 'ncp', 'pon', 'rop', 'rus' & 'wia' (all of which AGElint supports).

Let's copy some of the RUS game data files into the FIX directory. For that, best to use rsync.

(Note: It is not necessary to rsync, or otherwise copy, files en masse into your FIX directory tree. It is perfectly okay to copy files in singly, and debug just one file at a time.

Note also: For file copying en masse, you don't really need to use rsync, of course. Just use Windows Explorer if you prefer.)

Berto@brito ~/Games/AGEOD/agelint
$ which rsync
which: no rsync in (/usr/local/bin:/usr/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem)

Uh, oh: no rsync.

No problem. Remember that Cygwin setup.exe you saved in your C:\cygwin directory? Run it now. Accept all of the default choices (specified by your earlier install run) until you get to the Select Packages Screen. Do a search on rsync, then select it (as shown).



Click the Next button, and Finish your Cygwin setup.exe session. Then check to see if you have rsync installed properly:

Berto@brito ~/Games/AGEOD/agelint
$ which rsync
/usr/bin/rsync

Got it!

Let's copy into FIX all files in the actual-install RUS/Events directory:

Berto@brito ~/Games/AGEOD/agelint
$ pwd
/home/Berto/Games/AGEOD/agelint

Berto@brito ~/Games/AGEOD/agelint
$ ls FIX
Aliases Events GameData Includes Scripts Settings

We can rm (remove) any contents in the FIX/Events directory first:

Berto@brito ~/Games/AGEOD/agelint
$ rm -rf FIX/Events/*

Or just use the --delete option of rsync to achieve the same purpose:

Berto@brito ~/Games/AGEOD/agelint
$ rsync -vap --delete /cygdrive/c/Games/AGEOD/Revolution\ Under\ Siege/RUS/Events FIX
sending incremental file list
Events/
Events/01Tutorial.sct
Events/03Tutorial.sct
Events/1-IceMarch1917.sct
Events/2-CzechLegion1918.sct
Events/2-CzechLegion1918Demo.sct
Events/3-November1918.sct
[ ... ]
sent 4713500 bytes received 1441 bytes 496309.58 bytes/sec
total size is 4708069 speedup is 1.00

(NOTE: For the rsync command, you should not prepend ./ as you have done with your agelint commands. The ./ says to look for the file in the current directory, but rsync is someplace else, in a standard command directory, which your command invocations will find without your having to exactly specify rsync's whereabouts. This is also true of ls, cd, less, rm, etc., which are also in standard command directories, hence don't require the use of directory paths to run them.)

Note the use of \ backslashes before the file/dir name spaces in the previous command. If you prefer, you could instead do

$ rsync -vap --delete "/cygdrive/c/Games/AGEOD/Revolution Under Siege/RUS/Events" FIX

using "" to surround the file path.

List the contents of FIX/Events:

Berto@brito ~/Games/AGEOD/agelint
$ ls FIX/Events
01Tutorial.sct REDAI1918_8.sct
03Tutorial.sct REDAICZECHLEGION.sct
1-IceMarch1917.sct REDAIICEMARCH.sct
2-CzechLegion1918.sct REDPolishrussowar.sct
2-CzechLegion1918Demo.sct REDPolishrussowar2.sct
3-November1918.sct RGDAI.sct
[ ... ]

We can repeat the earlier agelint commands (shown in the AGElint USAGE post), but instead on files in the FIX directory:

$ ./agelint -n +w +e -c -u -x -X -g fix "Events/GRNAI.sct" 2>&1 | less

You will note the substitution of '-g fix' instead of '-g rus' in the earlier example command.

You are now free to cd into the FIX/Events directory and make edits and fixes (using vi; or you might prefer to use Windows Notepad) to your heart's content -- without fear of mucking up your actual game files.

< Message edited by berto -- 12/30/2011 9:41:25 AM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to berto)
Post #: 8
AGElint CHK - 12/10/2011 3:34:41 PM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

AGElint CHK

And what's with that AGElint CHK directory?

The CHK directory tree is filled with intentionally buggy game data files, used for regression testing changes to the AGElint program code (and data).

Recent changes have broken the AGElint CHK testing procedure! (The AGElint program code itself is not broken; just the CHK validation procedures.)

For now, just ignore CHK (and the Makefile 'make check' procedure). We'll get around to fixing this, and saying more about this, sometime in the future.

< Message edited by berto -- 12/18/2011 1:13:05 PM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to berto)
Post #: 9
AGElint required tweaks - 12/10/2011 4:53:00 PM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

I have tied up some loose ends involving file/directory path issues (thereby making AGElint installation and setup much easier), and released a new version incorporating these fixes late in the day on 20111211.

Henceforth, you should only have to specify filepaths in agelint.conf, in particular

agelintroot
gameroot

There might still be a few minor issues, but my porting of AGElint from Linux to Windows Cygwin is now largely finished.

If you have any installation or configuration problems, just post them here, else send me a PM (or possibly an e-mail to: robert.osterlund [at] comcast.net).

< Message edited by berto -- 12/12/2011 7:45:00 PM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to berto)
Post #: 10
agelint.conf - 12/12/2011 8:36:15 AM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

agelint.conf

agelint.conf is the common AGElint configuration file. It sets all AGElint operational defaults, which you can override with command-line options as you wish (e.g., ./agelint -X -n +w +e -c +u -x ...).

By default, agelint.conf is located in the agelintroot directory.

But what if you update your AGElint installation? If you fail to make a backup copy of your carefully tweaked agelint.conf file, the update process might overwrite it.

If you prefer, you can also locate your customized agelint.conf file in the directory /usr/local/games/etc:

$ mkdir -p /usr/local/games/etc 2>/dev/null

[/usr/local/games might already exist]

$ cp agelint.conf /usr/local/games/etc

[i.e., copy agelint.conf to the /usr/local/games/etc directory]

All programs in the AGElint toolkit will look first for /usr/local/games/etc/agelint.conf, then if not found, for agelint.conf in the agelintroot (installation) directory. Which implies that /usr/local/games/etc/agelint.conf takes precedence over <agelintroot>/agelint.conf.

If you tweak <agelintroot>/agelint.conf and your modifications seem to have no effect, remember to change your /usr/local/games/etc/agelint.conf too. (Else omit /usr/local/games/etc/agelint.conf, and just go with <agelintroot>/agelint.conf.)

Here (as of AGElint 1.0) is the default agelint.conf:



# agelint.conf -- default AGElint configurations

# for the following configs, may be any of:
#
# yes|YES|true|TRUE|on|ON
# no|NO|false|FALSE|off|OFF
#
# omitting any config (perhaps by commenting out) defaults its setting to 'no'

show_notice no
show_warn no
show_error no
show_event no
show_sources no
show_url no
show_syntax no
show_squelch no
show_text no
show_lineno yes
use_less no
list_aliases no
list_files no
list_images no
list_locals no
squelch no
ignore no
test no
debug no

# show_context is like the above; context should be any digit from 1 to 9;
# if show_context is no, context should be commented out (or omitted)

show_context yes
context 5

# for the following configs, set the appropriate directory (folder) path
# agelintroot & gameroot are required, dataroot is optional

agelintroot "/home/Berto/Games/AGEOD/agelint"
#agelintroot "/home/berto/games/ageod/agelint"

gameroot "/cygdrive/c/Games/AGEOD"
#gameroot "/media/KINGSTON/Games/AGEOD"

dataroot "/cygdrive/c/Documents and Setting/Berto/My Documents/Games/AGEOD"

# for non-default game installations, change the following configs as needed
# all of these are optional (may be commented out or omitted)

acwdir "AGEod\'s American Civil War/ACW"
ncpdir "Napoleon\'s Campaigns/NCP"
pondir "Pride of Nations/VGN"
ropdir "Rise of Prussia/ROP"
rusdir "Revolution under Siege/RUS"
wiadir "Wars in America/WIA"



The commented doc lines should be self-explanatory.

(As always, substitute your own username instead of my username, Berto.)

Be sure to set agelintroot and gameroot, and set them properly! Otherwise, agelint and any of the other toolkit Perl and Bash scripts will not run properly, or will not run at all.

Setting dataroot is optional (hence may be commented out). It is only of interest to devs/modders working with the "official" AGEOD DB/.xls files. AGElint assumes that you are working with the game data text files only.

If you have installed your games using the suggested AGEOD defaults, e.g., "Revolution under Siege", you may leave the rusdir etc. as is, else comment them out. You would change these settings if you want AGElint to act on games installed in non-standard folders, a mod say, as in for example:

rusdir "Revolution under Siege Fatal Years/RUS"

For modifying agelint.conf, you may use the Linux editor vi (or some other preferred Linux editor); else Windows Cygwin users might prefer to use Notepad (or some other preferred Windows editor) -- your choice.

< Message edited by berto -- 12/29/2011 10:23:45 PM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to berto)
Post #: 11
RE: agelint.conf - 12/12/2011 3:22:28 PM   
Chilperic


Posts: 964
Joined: 3/21/2010
Status: offline
Installing Cygwin and Agelint tomorrow, once I'm sure the CTD is definitely gone, my top priority for my few free moments today :-)

_____________________________


(in reply to berto)
Post #: 12
RE: agelint.conf - 12/12/2011 7:41:40 PM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

Good luck. Don't be afraid to ask questions. I hope I've been clear and comprehensive enough in my instructions and images.

< Message edited by berto -- 12/12/2011 7:42:01 PM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to Chilperic)
Post #: 13
RE: agelint.conf - 12/12/2011 7:46:01 PM   
Chilperic


Posts: 964
Joined: 3/21/2010
Status: offline
It seems at first glance. No frankly, I'm not that frightened by command line stuff and Linux. If I had time, I would reinstall my Ubuntu on my HD. Howewer, I will use Cygwin, for quicker results.

_____________________________


(in reply to berto)
Post #: 14
RE: agelint.conf - 12/12/2011 8:06:42 PM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

Cool. You have experience with Ubuntu Linux? You should have no difficulty then.

IMHO, Windows Cygwin is not as good as "the real thing" -- (Ubuntu or other) Linux -- in that you have, by default, more power and OS tools at your disposal with Linux. (Processing runs faster in Linux, too.)

BUT, Windows Cygwin does have the advantage that you can side-by-side debug and test your debugs in the actual AGEOD game(s) without having to copy from one system to another.

Whatever works best for you.

(I'm no OS bigot; far from it. At our house, we run Windows 7 & XP, Mac OS X, and several flavors of Linux (sometimes even FreeBSD) -- standalone, dual boot, and virtualized. But I have a special fondness for Linux; been an enthusiastic Linux user for, yes!, 20 years. AGElint is a good way to tout Linux, too.)

< Message edited by berto -- 12/15/2011 8:25:46 AM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to Chilperic)
Post #: 15
RE: agelint.conf - 12/17/2011 2:39:43 PM   
Chilperic


Posts: 964
Joined: 3/21/2010
Status: offline
After some delays, I'm currently configuring agelint.conf

More later

_____________________________


(in reply to berto)
Post #: 16
RE: agelint.conf - 12/17/2011 3:38:41 PM   
Chilperic


Posts: 964
Joined: 3/21/2010
Status: offline
Ok I've run into problem :-)

I get this when trying to run agelint:


Laurent@Laurent-PC ~/Games/AGEOD/agelint
$ ./agelint
(null), at or near line 1: syntax error: #

The first time I used it after modifying agelint.conf, Agelint started but replied " such file doesn't exist". So I closed Cygwin, modified the paths in the agelint.conf file, openaed back cygwin And I get this error.

_____________________________


(in reply to Chilperic)
Post #: 17
RE: agelint.conf - 12/17/2011 3:51:01 PM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

Please, if possible, post your agelint.conf here. (If not possible, then send it to me as is in a private e-mail attachment.)

From your reported error message, it looks like some kind of error in agelint.conf (which should indeed begin with a '#' beginning line 1).

Also, note that you ran the program without arguments. './agelint +h' (for 'help') should display the usage summary (as should omitting the '+h').

If you have set things up properly, this command

$ ./agelint -n -w +e +c3 -u -x +X -g rus "Events/GRNAI.sct" 2>&1 | less

(with or without the '| less') should give you output.

< Message edited by berto -- 12/30/2011 9:38:30 AM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to Chilperic)
Post #: 18
RE: agelint.conf - 12/17/2011 4:03:20 PM   
Chilperic


Posts: 964
Joined: 3/21/2010
Status: offline
here the file

Attachment (1)

_____________________________


(in reply to berto)
Post #: 19
RE: agelint.conf - 12/17/2011 4:38:27 PM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

Here is a diff of your agelint.conf with mine:



[root@telemann Downloads]# diff agelint.conf /home/berto/games/ageod/agelint/agelint.conf
38,39c39,43
< agelintroot "/cygdrive/c/cygwin/home/Laurent/Games/AGEOD/agelint"
< #agelintroot "/cygdrive/c/cygwin/home/Laurent/Games/AGEOD/agelint"
---
> agelintroot "/home/Berto/Games/AGEOD/agelint"
> #agelintroot "/home/berto/games/ageod/agelint"
>
> gameroot "/cygdrive/c/Games/AGEOD"
> #gameroot "/media/KINGSTON/Games/AGEOD"
41,43c45
< gameroot "/cygdrive/c/Revolution under Siege mode"
< #gameroot "/cygdrive/c/Revolution under Siege mode"
< dataroot "/cygdrive/c/Documents and Setting/Berto/My Documents/Games/AGEOD"
\ No newline at end of file
---
> dataroot "/cygdrive/c/Documents and Setting/Berto/My Documents/Games/AGEOD"



For one thing, note the

\ No newline at end of file

which probably explains the '#' syntax error.

Make sure that your agelint.conf terminates in a newline. In Notepad, for instance, make sure that when you cursor to the end of the file, the cursor is on a line by itself, on the left margin.

Also, it looks like your gameroot is set wrong.

On my Linux system:



[root@telemann agelint]# egrep gameroot agelint.conf
gameroot "/media/KINGSTON/Games/AGEOD"

[root@telemann agelint]# ls /media/KINGSTON/Games/AGEOD
Revolution under Siege



And on my Windows Cygwin system:



Berto@brito ~/Games/AGEOD/agelint
$ egrep gameroot agelint.conf
gameroot "/cygdrive/c/Games/AGEOD"

Berto@brito ~/Games/AGEOD/agelint
$ ls /cygdrive/c/Games/AGEOD
Revolution under Siege



As you can see

  • gameroot is the parent directory of your Revolution under Siege root directory, and
  • the game must be installed as (the default) Revolution under Siege

Sorry that you have done your installations differently, and that AGElint doesn't yet support different directory and naming schemes like what you apparently use. I can make this all supremely flexible and accommodating, but at the expense of still more agelint.conf entries.

(Note: Since AGElint supports all AGEOD games, not just RUS, I have gameroot as the parent directory of all possible AGEOD games.)

For now, would you please just

  • rename
    Revolution under Siege mode
    to (exactly; note the case)
    Revolution under Siege
  • change your gameroot to "/cygdrive/c"
  • make sure your agelint.conf ends with a proper newline.

Then report your progress, if any.

< Message edited by berto -- 12/17/2011 4:46:16 PM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to Chilperic)
Post #: 20
RE: agelint.conf - 12/17/2011 4:54:39 PM   
Chilperic


Posts: 964
Joined: 3/21/2010
Status: offline
Solved. It wasn't lack of a new line but strange invisible characters at the start of the file. I've got the idea to open the file in word to check if this sort of thing had happened. Bingo :-). Now working

_____________________________


(in reply to berto)
Post #: 21
RE: agelint.conf - 12/17/2011 5:03:56 PM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

Cool.

Sorry that you're the guinea pig, but from experiences like yours, I can code in more flexibility, and make the instructions clearer still.

I'm multitasking (working on my early music website this afternoon), so I'll be available here for further Q&A as needed.

Good luck.

_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to Chilperic)
Post #: 22
RE: agelint.conf - 12/17/2011 5:09:05 PM   
Chilperic


Posts: 964
Joined: 3/21/2010
Status: offline
Working as a charm.

Time to fix bugs.

Thanks

:-)

_____________________________


(in reply to Chilperic)
Post #: 23
RE: agelint.conf - 12/17/2011 5:15:13 PM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline
<thumbs up>

_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to Chilperic)
Post #: 24
RE: agelint.conf - 12/17/2011 5:36:50 PM   
Chilperic


Posts: 964
Joined: 3/21/2010
Status: offline
ANAAI file fixed. IMHO there are maybe some false bug report, but I will investigate further before signalling them. However, it rports real bugs too ;-)

_____________________________


(in reply to berto)
Post #: 25
RE: agelint.conf - 12/17/2011 5:59:41 PM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

AGElint reports

  • real errors (of greater or lesser importance)
  • possible errors (maybe or maybe not real, due to ambiguity or difference of opinion)
  • false positives

False positives might have many different causes. To be discussed later.

Where we determine the false positives, they will be removed or suppressed.

(Historical note: In AGElint's early development, every step of the way, I acknowledged the problem of false positives. AGElint was sometimes attacked for its false positives. But if I am overly diligent at squelching possible false positives, there is a danger of squelching true positives, reports of real bugs. Refining the code is an iterative, approximative, arduous process. "There Will Be Blood." And we must not forget: "Never let the pursuit of perfection obstruct progress." Right? )

_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to Chilperic)
Post #: 26
RE: agelint.conf - 12/17/2011 6:03:53 PM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

It deserves repeating:

Please bear in mind that, for all of its current sophistication, AGElint is a work-in-progress, more than a beginning but far from an ending.

The parser (txt.y) still needs much filling out, and deepening. For now, it’s like the parser understands grade school French. I/we need to teach it high school or college French. The deeper AGElint’s understanding of “French”, the more errors it will detect.

Beyond syntax and semantic errors, there are logic errors. For now, AGElint checks for just a small handful of logic errors, like for instance if MaxDate < MinDate (AGElint also already checks for mangled dates, such as 188031/l2). It is checking for logic errors where AGElint will really shine. (For the record, using AGElint, I found four instances in three different AGEOD games where MaxDate < MinDate.)

There are still many, many more things that AGElint might check. Really, the possibilities are almost boundless.

I will have more, possibly much more, to say about this, and about AGElint's inner workings, if there is sufficient interest.

_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to berto)
Post #: 27
RE: agelint.conf - 12/17/2011 6:16:04 PM   
Chilperic


Posts: 964
Joined: 3/21/2010
Status: offline

quote:

And we must not forget: "Never let the pursuit of perfection obstruct progress." Right? )


I don't see what you mean here

Only point which matter in my mind are:

1) test before assessing about one thing
2) test will always reveal flaws
3) flaws are worth considering
4) but in the end, if test shows flaws don't overpower the advantages, keep the tool.

Even if Agelint would remain unchanged, I would use it. Mispelling is so easy in AGE engine, especially when you use XLS FILES ( unless of course, you're doing one event a month ) and AGELINT is until now unrivaled for squashing them.

_____________________________


(in reply to berto)
Post #: 28
broken region links - 12/18/2011 4:47:37 AM   
berto


Posts: 20708
Joined: 3/13/2002
From: metro Chicago, Illinois, USA
Status: offline

broken region links

Another item for the to-do list. It should be possible to code automated checks of inter-regional links. (Indeed, I had begun to do this during ROP's development.)

< Message edited by berto -- 12/18/2011 1:14:50 PM >


_____________________________

Campaign Series Legion https://cslegion.com/
Campaign Series Lead Coder https://www.matrixgames.com/forums/tt.asp?forumid=1515
Panzer Campaigns, Panzer Battles, Civil War Battles Lead Coder https://wargameds.com

(in reply to Chilperic)
Post #: 29
RE: broken region links - 12/18/2011 8:03:51 PM   
Chilperic


Posts: 964
Joined: 3/21/2010
Status: offline
Here a false positive:

EvalRgnWeather: Weather in region 712 Ekaterinodar against 2 - Operator: >= Result: True

EvalRgnWeather is working with numerical aliases located in the various aliases file:

// Weather types
$Fair = 0
$Mud = 1
$Snow = 2
$Frozen = 3
$Freeze = 3
$Blizzard = 4
$HarshWeather = 3
$VHarshWeather = 4
// same with typo included ;)
$Blizard = 4

_____________________________


(in reply to berto)
Post #: 30
Page:   [1] 2 3 4 5   next >   >>
All Forums >> [Current Games From Matrix.] >> [World War I] >> Revolution Under Siege Gold >> Mods and Scenarios >> AGElint -- an AGE debugging toolkit Page: [1] 2 3 4 5   next >   >>
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts


Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.717