View Full Version : ARRG!! Anti_Units.txt seems to be worthless..

08-27-2001, 02:43
Well, I've been fooling around with it, and it seems to have absolutely NO effect on the game. Why is it there?? To tease us? I dunno, but I sure am disappointed.


08-28-2001, 12:38
Maybe it is a listing of the hardcoded modifiers? I've glanced at it, but nothing seems to hop out at me about what it is used for.

08-28-2001, 17:47
as has been suggested elsewhere by someone else - It is a list of certain units relative effectivness against other units...not sure about the truth in this statement, but I am off to test, (just to make sure)

08-28-2001, 21:37
Ok, if anyone else wants to take a glance. I pulled these numbers for SA and Japanese cav out of troopstats and antiunits and I cannot see a pattern.

Melee Bonus

Defense Bonus

Armor Level

Honor (actually morale) Level

SA attacking (SA on top)

SA being attacked (SA on side) by

Assuming larger positive numbers are beneficial to the attacker, what falls out is that the best cav to attack SA from best to worst are: HC, YC/NC, CA. Ok, I'll buy that, seems reasonable to me.

Reversing it, the SA is better off attacking, from best to worst: YC, CA, HC/NC.
I can take that also, since once inside the yari's range, the SA should get an advantage.

However, trying to make this fit in a comparison of MB, DB, AL of the respective units doesn't make any sense to me. In the being attacked case, YC and HC should be equivalent and they aren't.

It the attacking case, CA should be worse off than YC and they aren't. No, I'm not contradicting myself, I can believe that CA have a slight advantage over YC in defending themselves vs SA, but the troop stats might imply the opposite.

Given the huge difference between NC and HC defensive stats, NC should be at a disadvantage and not equal when being attacked.

I don't know if the antiunits file is a collection of variables or just a listing of the constants, but it would be interesting to breakdown the matchups. We all know paper, scissors, rock analogy and this might let us know when the paper is tissue or heavy cardboard and when the scissors are sharp or dull. http://www.totalwar.org/ubb/smile.gif

If it acts as a "to hit/kill" bonus then it might be using dimishing returns by being a percentage bonus of a percentage chance in the base calculation. Check Anssi's second post in this thread: http://www.totalwar.org/ubb/Forum1/HTML/001989.html

08-28-2001, 22:13
I am almost sure these are not the base for any calculations but are relativly minor weighted modifiers, after 'extensive' testing (check the time between my last post and this one http://www.totalwar.org/ubb/wink.gif)I have seen that by editing the numbers in the file...

Heavy Cavalry against Yari Samurai, H2, No bonuses, MI Default Morale.
Control (average of 12 results):
YS Kills:11.5
HC Kills:54

YS Adv from 0 to 30
YS Kills:6
HC Kills:51

YS Adv from 0 to 60
YS Kills:5
HC Kills:55

almost conclusive, but not quite...I think it proves something, but am not sure

08-29-2001, 07:10
Well, Whitey's numbers so far indicate no noticeable pattern. Plus if he was modifying numbers in YS's ROW, not their column, then according to my original theory he would've been disadvantaging them.


08-29-2001, 12:14
Khan7, I just looked again at the antiunits file. How did you derive your association for the columns? The rows are obvious, but I don't see how you decided the column headings. It looks like you (quite logically) assumed that column headers are in the same variation as row headers. IMO, what we are seeing so far is providing evidence that the columns cannot be in the same order as the rows.

Gahhhh, you are going to make me reinstall Excel on my machine and I thought I had banished it forever from my life (or at least to my wife's machine http://www.totalwar.org/ubb/biggrin.gif).

Some random thoughts on assigning column headings (I'm going to bed in a couple of minutes and not starting on this tonight) :

1) Spears are good against Cav.

2) NC is good against spears compared to other Cav.

3) SA should be best against Arq, Musk, Xbow and TB(?). Combination of light armor and non melee weaponry.

4) Arq, Musk, Xbow and TB(?) should be the wimpiest (lowest mods) vs everything else.

5) MHC should be the overall best unit (largest modifiers on attack) but should be weaker against spear units.

6) We need to find where MLC would rank, better than all Japanese Cav or somewhere else?

I think we can pull the "best" unit out that is relatively weaker against spears as the MHC. Cav should generally be good against all foot troops except spears. The SA should be the unit that is strong against the pure missile units, but weak against everything else.

08-29-2001, 12:46
YOU (you in the general sense, not you personally necessarily) deciding what column headings will be based on what YOU think they SHOULD be based on inherently IMPERFECT observations you have made about the game and your own SUBJECTIVE analysis will do no one any good, hehe :-)

Trust me, the column headings are the EXACT same order as row headings. The order in which units go, both in rows and columns (there are several files that specifically label columns, such as unit_choice.txt), is consistent throughout ALL of the files. The arrangement I rendered in my Archive is totally correct in this respect.

And again, you or I, as lowly mortals trying to understand the game mechanics better, coming in with our own essentially ungrounded perceptions and trying to second-guess the developers is going to be futile and fruitless (or at least quite unscientific) :-)


08-29-2001, 20:45
Nah, I'll take it personally, after all I replied directly to you. http://www.totalwar.org/ubb/smile.gif

As I mentioned you made the same conclusion I did when I originally looked at the file and when I looked at work you had done on the files. The column and row values should match. However, altering the values don't seem to do anything to the game according to you and Whitey and I haven't tested it yet myself, so I'm taking both of your word on it.

If there is no effect to changing the values when testing units, then I see some possibilities:

A) they are hardcoded values defined in the program and we are seeing a constant listing.

B) the rows and columns don't match for whatever reason (i.e. - we are playing with the wrong numbers).

C) the effect is minor compared to other modifiers.

D) we are totally braindead on what the table means. http://www.totalwar.org/ubb/tongue.gif

What bothers me is that no pattern jumps out of the chart at me. Maybe it is the format I'm looking at it in. Even looking at the small piece I did a few posts ago, I see a minor pattern in the antiunits table relating to the few values I compared.

One thing looking at Whitey's numbers (which have to be from the row since they start at 0), it might be possible that these are negative modifiers. As the numbers went up the average number of kills by the YS dropped!

I'll know more later today.

08-30-2001, 02:28

The anti_units.txt file doesn't do anything as I posted 2 weeks ago. Thanks for the corroborating results. You can delete the file, and the game still runs fine. You can also delete TroopStats.txt, and the game runs fine. However, that file is used by the game if it exists. So, all these unit stats are coded into the main exe.

It looks to me like the anti_units file shows the melee bonus the unit that falls in that position on the line gets against the unit listed at the beginning of the line. I think this because I looked at YS and cav values. YS does very well against all types of cav in the game. However, not all the numbers make sense to me. I'm not going to spend any more time trying to understand those numbers in ant_units.txt since you can't be sure that they are the same as the values actually being used inside the game.


Because of the high statistical noise in a 60 man vs 60 man test, you really have to run the test many times and average the results to see a small diference. I typically run a tst 10 times. Using 120 man units also helps increase accuracy by increasing the number of individual combats taking place.

MizuYuuki ~~~
Clan Takiyama ~~~

08-30-2001, 03:30
its true puzz, I found a huge amount of noise and also learned a lot about testing, in itself it was a rewarding expierence - when I was half way through I thought that a higher number of men-per-unit would be preferable...is it possible to increase individual combats - I tend to find the AI in MI exceedingly annoying - changing its tactics almost every game is all well and good but really when your trying to test something it really messes around with figures http://www.totalwar.org/ubb/smile.gif

as I ran the test in that order it may in fact be conclusive proof that the AI does in fact learn, seeing as the unit lossed for YS go down each time...interesting thought

I have also had further looks at the file and have to agree with you now (after being stubborn previously http://www.totalwar.org/ubb/smile.gif) and say that it does nothing and is merely a dump of figures from the exe to tease us http://www.totalwar.org/ubb/smile.gif

should've listened in the first place, but it does give me testing expierence and thankyou for the advice puzz

as for you kahn...no comment...EVER

08-30-2001, 08:33
puzz3d (yuuki :),

isnt it possible that that file, the anti one is hooked the same way that the troopstats file is? since it seems to be a defensive stat wouldnt that be a bit harder to detect in the observance of results on the field? have you tried pumping it WAY up or WAY down and run with it that way? it just seems curious to me that they'd include these other files that do seem to work and then include this one that doesnt.

if it really doesnt work, then perhaps the dev guys werent really so magnanimous as we may have thought. perhaps this was just some development thing they were working on and had to drop it before it was finished and thus that file never got hooked?

ah well,


I'm sorry, but i never apologize.

08-30-2001, 08:37
Well, all I know is that certain things like the advantage of spears over cavalry is HARD CODED, and the somewhat drastic changes I've made in anti_units.txt seem not to make a difference. Will have to try with different unit matchups, and will have to try with spears vs. cavalry with values way, WAY out of wack, then maybe we'll see something :-)


08-31-2001, 01:13

I basically tried two different things with that anti_units file. The very first unit matchup I tested on my LAN when I got WE was MHC vs JHC. The MHC is a 4/4 att/def, and the JHC is a 2/6. These units should be fairly close in melee. However, they are actually extremely different. MHC will kill 60 JHC, and only loose a few men; something like 5 or 10 men. I could make MHC roughly equal to JHC by reducing them to a 0/0 unit in TroopStats. I thought this roughly 8 point advantage might be coming from anti_units.txt once I looked at the file. So, I edited the file and made the MHC and JHC lines the same. I made them both like the JHC. Well it made no difference in the gameplay. MHC still crunched JHC by the same large difference.

The other thing I did was reverse the values for YS and YC. That should be pretty noticable, I thought. However, once again, I saw no difference in the gameplay. I repeated this stuff at least twice, but couldn't see anything different about the effectiveness of the units. It certainly looks like each value corresponds to an opposing unit because there are exactly the same number of units as there are values, and you can see the YS bonus against each cav type, and the lack of bonus each cav type gets against the YS.

I would say these numbers are used directly in the combat formula, and some of them are really big. If so, they are a big factor in determining a unit's effectiveness in melee, and it's too bad we can't control these parameters. We can't even be sure that those numbers are correct. The game could have different hard coded values. The lack of documantation of how to use these files does give the impression that they were just left behind by the programmers. However, they well may have been intentionally left behind. If this was a planned way of leaving us modding capability, these programmers must be under incredible time constraints to move on to the next thing. I suppose they could be running something like 2 years behind schedule. http://www.totalwar.org/ubb/smile.gif


Glad to see you trying out some testing stuff. I missed the fact that your numbers above were the average of 12 runs. That was kind of stupid of me to advise you to average multiple runs when you were dong just that. Could you explain what you did in your test? It looks like the YS are beating the HC. Oh, these must be MHC. http://www.totalwar.org/ubb/smile.gif You tried giving the YS an advantage by changing which number? If you changed the last number in the YS line, then I think you are giving an advantage to the MHC.

It's interesting that each unit has a number for itself. If these are combat bonuses, I guess it wouldn't matter what the number was because they would offset each other.


Now I understand the trouble you had with morale in your ACW mod. If you make it right for custom, then it's way off in the single player campaign because that 12 point morale bonus is not being applied to both. I really think it's imperative that they get rid of that morale bonus, and let the multiplayer morale level be determined by how much koku you spend on honor upgrades.


08-31-2001, 06:00
In my ACW Mod I solved the morale problem flat-out-- there is a troopstats.txt for MP/Custom, and one for SP Campaigns. You change them out based on what you want to do. Any other solution either would've left SP Campaign units unusable or MP/Custom units irreprably fanatical (there is no way thru koku to fix the prob, even h0 is ridiculous).


08-31-2001, 23:35
Ha ve you tried to inverse the values in Anti_Unit?

I mean: changing X values with -X