Ok so a little background... I made a MOD, a good one, it was pretty much "done" in 2007, but I had a harddrive crash BOO!

So I found a semi-recent backup from late '06 or early '07, and decided to give it a whirl over the holidays @ 1080P... I was blown away by the fact that a silly 15yr old game could run resolutions that high, and that my mod was still so much fun.

I decided I had to RE-finish it!

Anyway, I had also written a script called "check.tcl" originally to help save my sanity, which later evolved into "mapcheck.tcl" and later still into "aicheck.tcl"... you can kinda see the progression of purpose.

Very early on, before Deezire was "the man" I was modding the AI as best I could, using my knowledge of tactics and balance, it was wonderous and fun, I just never shared publicly... only some early maps I made.

Just FYI I was also heavily involved in both the testing and feature requests during the last few versions of FinalAlert development, before Westwood bought it... if that gives me any credibility, one guy knows me hahahah

So here's my scripts, give em a whirl... you'll have to edit them both to set your path correctly, and unfortunately it only "works" for RA2 and doesn't do YURI...

Feel free to ask questions...

Oh and you'll have to download the ActiveTCL runtimes from ActiveState for windows to use em...

aiclean-screen.jpg

Description:

Filesize:

323.73 KB

Viewed:

10479 Time(s)

aicheck-screen.jpg

Description:

Filesize:

130.71 KB

Viewed:

10479 Time(s)

Last edited by G-E on Sun Feb 22, 2015 5:52 pm; edited 2 times in totalQUICK_EDIT

This is the general cross-checker, great for finding unit/declaration errors, things you've forgot, or renamed without remembering some other instance.

This one should be the go-to script you run after a round of edits or rules.ini .. it will make sure you know you forgot to update art.ini

Make sure you read the "check.log" it creates, you might be surprised how bad the unaltered RA2 was when it shipped... total mess really.

Thanks to this one, the only Exception errors are the virtual address ones caused by corrupted .mix resources...

Since I also name my maps consistently athse-*.mpr, I added a quick commandline option to check them all, but you could just as easily run it:

tclsh aicheck.tcl *.mpr

It does some basic dependency checks, including the AI, which is easily forgotten, I find AI errors were my #1 cause of ingame crashes... but then my AI is heavily modded, I have some 600 triggers, lots of them house specific..

Script 2: AICLEAN

This one is your post-mod cleanup, if you want it to be, otherwise it's a great way to review the scripts used by your AI...

It outputs a "translated.log" of the entire [ScriptTypes] section, so you can read in plan english wtf is going on..

For the OCD types, it alphabetically sorts the entire ai.ini except the triggers, and removes all comments, to make it nice and clean.

The best part for a novice will be the translator, but it will also come in handy to veterans with giant AI's like me

CAVEATS: Neither script can extract any of the INI's from .mix files, not the Westwood ones, not a mod's... so you'll have to make sure you've extracted them all:

Ok I took a break from modding to roll my AICHECK updates into the YR version, only to realize I don't need to keep 2 forks of the code if I just properly re-format the YR AI...

Sooooo, I updated AICLEAN to handle the garbage that is YR and make it cohesive again!

The new AICLEAN will reorganize your aimd.ini so that declarations come first, the code that belongs in that section after, and also makes the order match the RA2 ai.ini.

Some minor fixes, and error handling have been cleaned up, it should remove all comments and blank lines like "2=" in a script for example. It still re-numbers all the declarations, but now adds all the tags that weren't declared, instead of simply deleting them as previously.

As mentioned above, you will have to edit the scripts to point to your installation, and set some options.

Please report any bugs or crashes Last edited by G-E on Sat Apr 04, 2015 8:59 am; edited 1 time in totalQUICK_EDIT

Now checks Aircraft, Terrain and Smudge sections for invalid/missing objects, I stopped short of adding Overlays since I figured you aren't likely messing with bridges and ore being so finicky to get right (using something premade).

I ran through all my maps, found 1 missing building which I had commented out in rules.ini, so it seems to work nicely

The output for map checking now shows unit totals used on the map for reference, and I also modified some of the error messages to make it more obvious if you set the variables wrong too Last edited by G-E on Sun Apr 05, 2015 12:35 am; edited 1 time in totalQUICK_EDIT

Not exactly, AICHECK does more than find errors, or missing entries, it also tells you what's unused, or house dependency errors in the AI. It can also run through a map you specify on the commandline for invalid buildings/units based on your rules.ini, which can help you if you're adapting someone else's map to your mod.

AICLEAN will strip out all the junk/comments from rules.ini and ai.ini if you want it to. It also re-organizes the sections in ai.ini with proper declaration lists, but also provides an english output for the ScriptTypes section.

MAPCLEAN is a new script I just added, it removes redundant sections from multiplayer maps added by FinalAlert, although you can customize what sections are removed by editing the removetags in the script. Naturally it supports batch operation like *.mpr to clean all of them in one go.

They all run very quickly, and the output generated is meant for someone to quickly glance through looking for the important stuff. There's no need for a fancy GUI when you just want to know if you screwed anything up in your last update._________________http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-aiQUICK_EDIT

I setup a batch file to launch AICHECK since that's the important one:

Code:

@tclsh aicheck3.tcl
pause
@start check.log

I add pause when I work on the scripts or do a fresh install, it will show the dos box waiting for a key press, if it crashes you'll know why then, or can show my a screenshot to tell you why. Then once it completes in about 0.8sec it pops up the log to show the things it didn't like.

I should also add that both AI editors linked elsewhere on the site fail to work on my machine, one crashes, the other refuses to operate citing string errors. My scripts are very tolerant, and work on any version of windows or I imagine emulated windows.QUICK_EDIT

Were you around on federation studios? If so I think I recognize your username. Regardless, thanks for posting this here, I look forward to playing around with it when I get my windows computer set back up. Welcome back._________________PreRA2 Dev LeadQUICK_EDIT

Maybe, honestly I was on more of the C&C/RA1 forums of the day, I regularly used to make maps. I did join a bunch of RA2 focused sites of course, but I didn't frequent most of them, most voxels were garbage, most ideas were regurgitated, the tools were still in their infancy. Once again I focused on maps and rules.ini modding, so I made friends with Matze and was one of his closest beta testers, along with whatever features/changes I inspired him to add... I still have a copy of FA2 0.97a here

Now as per RP's insistence of the numerical ordering of the lists, I did indeed verify what's to the left of equal doesn't really matter, so it can't be subtracting 1.

Therefore I'm updating my AICLEAN to re-order all the major lists in rules.ini starting from 0, if that option is enabled. I'll also add an option to keep inline comments. Inline meaning at the end of a line rather than on their own lines, it could be useful to keep alternate values or other data.

If you open the .tcl in notepad, you'll see there's a few set lines with descriptions, namely the directory and the filenames of the inis. Each of the .tcl scripts need those variables set correctly to function, as each one is launched by itself.

Since there's no actual structural difference with rules vs rulesmd, it just needs to know which one to open.

Note there will be some false-positive errors, and irrelevant errors, but it's a good habit to eliminate all the errors it finds, so that any modding mistakes aren't compounded._________________http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-aiLast edited by G-E on Thu Dec 01, 2016 7:03 am; edited 2 times in totalQUICK_EDIT

Unlike the other scripts, this one isn't so much an error checker, it corrects some obvious issues, but nothing substantial. It is for preparing the vanilla ai.ini/aimd.ini for first editing, or cleaning for public release, because who wants to release a sloppy AI with comments and garbage all over?

The script can be set to create ai(NEW).ini as the output, or to rename the original to a timecode, and output the new file in place of the original. It will use whatever filename your ai.ini actually is, you just have to set the variable in the script, even if it's myfunkyai.ini for use with your Ares mod.

There's also a weee option called cleanrules, this allows the script to remove all the comments from rules.ini simultaneously since it has to open it and read it to figure out what the script action numbers refer to._________________http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-aiLast edited by G-E on Thu Dec 01, 2016 7:02 am; edited 1 time in totalQUICK_EDIT

Simple script to remove all the junk FinalAlert adds to new multiplayer maps. Not exactly critical, but things like AITriggerTypesEnable, and adding copies of all the houses, adds a fair chunk of useless data.

Had a weird problem, turned out I corrupted a section of ai.ini so it had nothing to do with it, but I updated AICHECK in the meantime.

Now checks for unused art.ini objects, live vestigial leftovers from TS, and now checks that all declared animations exist in art.ini, including animations only declared within art.ini itself, like activeanims.

It also does more thorough duplicate checking, and has the option to ignore the Bibshape and Buildup animations errors, because as we know, many are never declared in rules.ini as animations.

AICheck had some minor glitch that didn't process triggers correctly for something with dupes, I forget the details. There were also a some improvements to ownership matching with the taskforces/triggers.

AIClean has been updated with some new options, better comment/data filtering, and a new option that will sort all the options within Aircraft/Vehicles/Infantry to be in the same order for each. I had contemplated having it add missing default entries, but that gets messy with all the special cases.

i would like to run your aicheck but both the cleaner and the aicheck give me the same error message.

- I set the paths
- I set the filenames (YR)
- I downloaded and installed the recommended files
- I first run the cleaner, it creates a clean.log, the translated.log and a new rules(NEW).ini and ai(NEW).ini (while giving out the error message)
-then i run the check still on rulesmd.ini etc.
-then i run the check on the new cleaned versions

Ok updated with imrproved Sides handling, should be able to accept more than 3 sides as well now. The error above is indeed related to the value in the trigger, which is why I never caught it, as I never had an out of range value in mine.

I am still quite happy about your superb program; it catapults the cleanliness of my mod to new standards - thank you!

What I did was:

1. Run the Cleaner - it gave the old error from above (first or second pic I send) but created the clean.log anyway.
2. Run the checker that created the same error as above BUT now (after you updated it) created the check.log!
3. After cleaning most errors the check program started to give the new error at the different position (Parsing Trigger...) before it always gave the old one.
BTW I am using windows 7 64Bit. And I am not using the Ares include function.

PS: I mentioned this in the other thread the cleaner or checker scrambles Ares Tags within each unit all over the place - (survior tags for example) it is a minor disadvantage but can get pretty hard to deal with if you ordered hundred+ units before and now have to go through all of them again to recreate order - just for your developement of the program - i will still take that risk for it's overwhelming advantages in error fighting and cleanliness!.
Oh yea and the checker doesnt recognise occupy weapons as belonging to someone or being in use wich creates some false positives (all minor things). Just so you know .QUICK_EDIT

I should mention this was developed for my own needs, and my own needs did not include unique YR functions. So YR support is still only developing, starting with the glaring errors first, then working towards the less important. Up until recently I could only call it "compatible" with YR as it didn't crash at least haha!

Personally, I would throw the scripts and batch files into your game directory, there's no real reason to have them off in the bushes, the TCL engine is already in the system.

I see one of the batch files you have has a pause in it, the other doesn't, if the error goes by too fast, add the pause or remove the REM to make that one pause too. If you show me TCL errors, I can fix em asap.

no errors occured with the checker if I put the files in the game directory!
I am curious if you could tweak the program a little to the Yuris Revenge users. Most of the people use Yuri anyway. I personally would love to see it evolve

Things that i recognized:

1. Occupier weapons that are only used when occupying aren't checked as in use [ONeutronRifle] -> WEAPON exists but is unused.
2. Custom added Superweapons are looked at as orphan tags (even though they are listed in the rulesmd.ini under the superweapons list)
[AmerTankParaDropSpecial] -> unknown object/heading.
3. No crash or incompatibility with my modded Ares Yuris Revenge when starting up !
4.Of course Ares alternate Prerequisite Groups aren't recognized ([YSPPPT] -> undefined prerequisite BUILDING: HIGHTECH)
4. Scrambling of Ares Tags.
5. Reordering of Scripts has a more randomizing effect.
6. TechTypes that use Image= are listed as undefined [CATIME] -> BUILDING not found or no data.
7. Barracks,Tech etc. are labeled as undefined [DOG] -> undefined prerequisite BUILDING: Barracks.
8. Everything else works golden!

Oh the generic prerequisites have to be all uppercase, others have to match the casing of the original. This might seem silly but I wanted to make sure it enforced object names as they were, to make everything consistent. As always the output is there to assist you, if you think it's ok, then ignore it.

I doubt I will add any Ares features, because there is already a decent debugger in it from what I see, and because it gets messy trying to filter what's correct for RA2 vs YR vs Ares.

I will add the infantry weapons checks now, and I will look into doing something with the superweapons, right now they are ignored.

*EDIT* Ok updated with the above, and I've deleted obsolete links in the thread, here are all four current scripts for download...

2)
Warhead special (you know for rocket launchers and such is labeled as undefined)
[HornetLauncher] -> WARHEAD not found or no data: Special

3) Just an Idea - one could put the animation and building and art list at the end of the output, for most of those will (i guess) never be fixed because westwood made most of em - so you do not have to scroll through parts you most likely seldom need. BUt that is up to taste and it's your effort.

4) MapClean did not create the log - it started - pause was enabled but when i press a button it says cannot create maps.log.
Thanks !!QUICK_EDIT

Warhead special (you know for rocket launchers and such is labeled as undefined)
[HornetLauncher] -> WARHEAD not found or no data: Special

Again probably a letter case issue, all warheads must be defined and populated soooo....

Ich-Henker wrote:

3) Just an Idea - one could put the animation and building and art list at the end of the output, for most of those will (i guess) never be fixed because westwood made most of em - so you do not have to scroll through parts you most likely seldom need. BUt that is up to taste and it's your effort.

You might think art.ini errors are less important, but when adding new units or weapons it is as important as rules.ini errors, it is the ai.ini that is less connected to them. The logging engine records each group of errors linearly, categorized for each ini, then outputs them rules->art->ai, splitting up the output within a group doesn't make sense.

Ich-Henker wrote:

4) MapClean did not create the log - it started - pause was enabled but when i press a button it says cannot create maps.log.
Thanks !!

Again, probably permissions, throw it in the game directory like the rest, Win7+ have weird security rules where non-admin processes can write files. If it did successfully modify your map, the map will have a new comment header at the top..._________________http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-aiQUICK_EDIT

I am still using this scripts and think they are phenomenal - no more crashes relating to my coding.
Now I wonder: can you tell me how to include Ares Tags in the AI-Clean script to reorder the rulesmd including buildings and units - I am trying on my own right now but cannot find the buildings section within the editor.

This would be great,
-A-

Edit_1: I could arrange the new Ares tags into the list and it works - but how can I add a Segment for Buildings?QUICK_EDIT

Notes:
- now has the unit tag sorting in an external .cfg for easy arranging
- now supports tag sorting on buildings as well
- replaces missing Name= tags with a missing string including the heading
- automatic configuration defaults if .cfg or options are missing/invalid
- improved output neatness
- more Yurified_________________http://www.moddb.com/mods/scorched-earth-ra2-mod-with-smart-aiLast edited by G-E on Fri Apr 13, 2018 3:30 pm; edited 1 time in totalQUICK_EDIT

How to put the Building section - does it go into the cfg. file simple under [Buildings] or are the buidling tags in the same line as the [unit]-tags? BTW. great job on doing away with the set ucnt 0 it was hell of a work to implement before

2-And somehow this version of clean merged the first heading in the rulesmd into its title:
; cleaned output generated by AICLEAN by G-E?[GenericPrerequisites]

it's an Ares tag that must be in the beginning so...

3-and it labeled the new rulesmd file rules, i do not know if there are underlying consequences to that - i think before it labeled it as rulesmd but that may be ai-check.

4- with my testing it sorts the buildings wrong and the units correct - it puts UIName at the end and DeathWeapon or Explosion in the very beginning, I think they are not ordered at all[at least in my file] even though the same tags are placed correctly in the units. And it is not because of Ares Tags i encorporated them in the cfg.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum