OK kids, here's the stuff on the text files as promised:
troopstats.txt
This is the file that contains all the important information about how the troops behave on the battlefield - Their combat abilities, their movement, their spacings between each other, etc etc etc. Here's a quick rundown of what all the attributes refer to:
NOTE: The order of these stats at the top of the text file ( and in my original posting ) is slightly wrong. "Max Turning Angle" and "Speed at which soldier..." are teh wrong way round. I've editted it in the list below but bear it in mind when you're modding your troopstats.txt file. Cheers to "Eagle-Eye" Kraellin for spotting that one.
Projectile type:
Specifies if this unit is a projectile unit ( archer, gunner, bomber ). The number refers to an entry in projectiles.txt - more on that file elsewhere, and tells the unit which projectile weapon it wields. These are:
1 = Longbow ( normally used by Archer Infantry )
2 = Mounted Longbow ( used by Archer Cavalry )
3 = Arquebus ( for Arqubusiers )
4 = Musket ( for Musketeers )
5 = Ninja Star ( Battlefield Ninja )
6 = Javelin ( Mongol Javlineer
7 = Grenade ( Thunder bombers )
8 = Crossbow ( Ashigaru Crossbowmen )
Unroutable:
Doesn't actually make them "unroutable", but actually flags them as samurai in the code which makes the honourable, meaning they get bonuses in their routing check codes. Ashigaru and Mongols are basically peasants and rabble, so they aren't given samurai status
true = 1, false = 0
Marching speed: 1 - 24
Normal marching speed in a straight line( single click move command on the mouse ).
Running speed: 1 - 24
Running speed in a straight line( double click move command on the mouse )
Charging speed: 1 - 24
Not a commandable speed. Units attacking the enemy while running and occasionally when units are told to run downhill automatically shift up to this speed.
Minimum turning speed: 2 - 8
The speed at which a marching unit will slow down to in order to change direction. Individual soldiers will speed up and slow down accordingly in order to maintain rank positions.
Maximum turning speed: 2 - 8
The speed at which a running or charging unit will slow down to in order to change direction.
Speed at which soldier turns towards the direction of motion 8 - 8
Actually, this value appears not to be a speed value but a distance value. It seems to be used to determine how far away an individual soldier needs to be from his destination point before he;ll turn to look at it.
Max turning angle whilst in motion: 8 - 256
The maximum degree a unit can pivot per movement tick. This is a bit complicated. This number isn't exactly degrees, it's an approximation, which was used in order to save memory space. A full circle of 360 degrees is represented at 256, a half circle is 128, 90 degrees is 64 and so on - I'm sure the programmers among you can see why this method was used. A value of 1 represents roughly 1.4 degrees, but don't do trying to enter fractions in here to get exact degrees - only whole numbers will work.
Space between neighbours left and right: 30 - 125
Set's the width distance between soldiers in the ranks. Changing this number will alter the overall width of a formation.
Space between neighbours back and front: 30 - 125
Set's the depth distance between soldiers in the ranks. Think of this and the previous value as te amount of personal space each soldier gets. More personal space = more effective fighting but more prone to routing.
Enemy engagement proximity threshold: 500 - 2000
Distance at which a unit decides to engage the enemy. Also decides when a unit should break into a charge.
Charge bonus: -6 - 12
Attack bonus added on to a unit while it's charging in to attack.
Melee bonus: -6 - 12
Once 2 units have met, close quarter fighting takes over. This sets how good each unit is at hand to hand combat.
Defence bonus: -6 - 12
A unit's inate ability to parry and deflect blows. Excellent for melee combat, no good for projectile attacks.
Armour level: 1 - 12
One of 2 things that help against being killed by arrows and bullets - Armour is one, not being there is the other. Also helps a little in melee combat.
Honour level: -4 - 8
Think of honour as battlefield experience. Affects all attacking, defending and morale. Also helps against projectile attacks - veterans have a better sense of when to sidestep.
Ammo ( arrows or bullets ): 0 - 255
How much ammo a projectile unit is carrying. No point in setting this if the unit only has a sword or polearm.
Unit size (based on 60)
Number of men in this unit, based on a default size of 60. This number will get altered in Single player mode if you decide to shift the default unit size in the Options->GameSettings menu in the Shogun front end.
Projectiles.txt
This file sets up some of the data for the bullets arrows and bombs fired by some of the units:
Length
The length of the projectile - used for the graphics routines when drawing them.
Frequency
Heh - not actually used anywhere in the code at all. This value just sits in memory. That's all it does.
Range
The range of the projectile. Used to calculate when to turn the mouse cursor green when floating over a unit to indicate when it's in range. Range should be about (speed/2) squared. Make sure it's always less than this value.
Speed
Used to calculate the distance a projectile can travel. Be careful about changing this for arrows and bombs, because they travel in an arc. Increasing speed to some asrtonomical number will allow you to shoot the length of the map, but the archers won't be able to hit anything that's quite close to them because they have a fixed ( unmoddable ) trajectory. Bullets and crossbowbolts travel in a flat trajectory, so they don't have this problem.
Accuracy
How likely the projectile is to hit what the soldier was aiming at. The higher value the more lethal. The honour of the unit also affects this.
Power
How much damage the projectile does to the guy it hits.
Reload
Length of time between shots for this projectile weapon.
Is a gun? true = 1, false = 0
Tells the projectile if it should fire in a flat trajectory or in an arc ( I think ).
Is Waterproof? true = 1, false = 0
Can this weapon fire in the rain.
Anti_units.txt
Anti-units is used as part of a large function to enable the daimyos to decide which units to build. Basically the file works as a big matrix containing weightings ( or deciding factors ) that aid an AI daimyo to make up his mind what he wants to build.
The anti-units comes in to play when a daimyo observes the units on his from line and tries to find a unit combination to counter them. The numbers represent unit types in this order:
LS = Light Samurai ( AKA Samurai Archers )
SS = Samurai Spearmen ( AKA Yari Samurai )
NA = Naginata
NO = No-Dachi
LC = Light Cavalry ( AKA Cavalry Archers )
HC = Heavy Cavalry
LA = Lancers ( AKA Yari Cavalry )
AS = Ashigaru Spears ( AKA Yari Ashigaru )
AQ = Arquebusiers
MM = Musketeers
MO = Monks
BN = Battlefield Ninja
SW = Sword Saint ( Kensai )
MJ = Javliners ( Korean Skirmishers )
MS = Mongol Spears
MP = Mongol Polearms ( Korean Guardsmen )
GR = Grenadiers ( Thunder Bombers )
AX = Ashi Xbowmen
NC = Naginata Cavalry
MLC = Mongol Light Cav
MHC = Mongol Heavy Cav
for example, taking the first line in anti_units:
lsamuraibeingattacked
{
LS SS NA NO LC HC LA AS AQ MM MO BN SW MJ MS MP GR AX NC MLC MHC
5, 2, 5, 4, 6, 12, 10, 5, 0, 0, 0, 3, 3, 1, 2, 5, 0, 2, 10, 15, 10
}
This line reads that if the enemy have light Samurai ( or Samurai archers to you and me ) then WE want 5% Sam Archers, 2% Yari Sam 5% naginata, etc, etc, etc
building choices.txt
This dictates the weighting that each daimyo personality tends towards. There are some game events that will alter their decisions - for example, when a Geisha arrives on the scene, all active clans will start building ninja houses and turfing out ninjas like no-one's business in an effort to keep Geishas on the move or take them out of the picture all together. The file itself seems self explanatory, so I'll cover the personalities mentioned in the file instead.
The personalities dictate how an AI daimyo acts. What buildings he constructs, what units he trains, whether he'll break alliances or come to allies' aid and how he conducts his invasions. Each daimyo is set up with a hard-coded personality at the start of the game - subsequent heirs are given random personalities to keep the game interesting.
The personalities are:
balanced
No real personality at all. Builds a bit of everything, won't invade unless absolutelty sure he'll win. The grey man of Shogun
p_crispy_critter
tends to throw soldiers into battle, trying to win by weight of numbers rather than nurturing skills. Tends to train cheap units and not bother too much with upgrading buildings
p_nutter
Favours shock tactics and the element of speed. Eager to make war - alliances mean virtually nothing. Will take the effort to build up ranks of monks and no-dachi.
p_h4x0rz
virtual opposite of the nutter, h4x0rz will go for heavily armoured and defensible units such as Naginata and spearmen, and then use steam-roller tactics to win over. Assimilation is the key-word here, if you catch my drift.
p_rook
The toad that sits in it's pond. Will build castles and then sit in them not bother anyone. Values alliances highly, mainly because he wants a quiet life.
p_yuppy
The gadget gatherer - making a beeline for the top-most unit types and building upgrades. Tends to construct the fastest out of all the personalites and then output the high class units. Easy to defeat in the early stages of the game, but quite tough if left to his own devices for a few years.
p_l337
Tends to go for the even approach, much like balanced, except he is far more asssertive. Looks after his allies, but will attack neutrals and enemies with the same aggression. Armies are solid, not favouring any one aspect but making sure all the units available complement each other.
p_secret_service
Rather than use strong arm tacts, secret_service prefers the subterfuge approach. Will rely on Shinobi to capture territory and gains treaties for protection. Favours causing uprisings in rival regions to soften them up for an invasion.
p_yakuza
The personality that uses ninja and geisha the most. Most assassination attempts stem from this daimyo type, although he builds a formidable army as well - mainly from projectile units. Will look after allies well.
p_diplomat
The diplomat relies on emissaries heavily. Will embrace foreign traders at the earlies opportunity, allowing him to introduce guns into his ranks. He will not provoke allies or rivals unless pressed to do so - he wishes for a life almost as quiet as rook's.
p_troop_hoarder
Tends to build large standing armies and fortifications but often does nothing with them. Will occasionally lead an assault but more often than not will wait for the enemy to come to him.
p_technologist
Like the yuppy, the technologist will aim for the more advanced buildings and units, but unlike the yuppy he isn't adverse to using them. Will use the units available to him in a balanced fashion, and not adverse to a little diplomacy when the mood takes him.
p_splendid_isolation
On par with the diplomat as far as treaties are concerned, the isolationist will favour the more religious units. As the name suggests, he craves peace and will not go into battle unless under the most extreme circumstances. Excellent alliance prospects.
p_stalin
Tends to go for the more opulent buildings whilst keeping his armies large but poorly equipped and badly trained. An opportunist invader - not one you'd consider for a friend.
p_mao
Favours the common man for the bulk of his armies. Won't spend too much money upgrading troops facilties, he'd prefer to simply throw more peasants at the problem until it goes away. Won't think twice about going against an ally, and definately will attack neutrals and rivals.
p_blitzkrieg
The antagoniser. Once he's decided to attack a region he will continue to attack it until the region is his or his ranks are decimated. Tends to favour the loud units and the heavy attacker, but will also resort to ninja to get his way. Not the best prospect for an alliance.
Here are the personalities for the daimyos that are active at the start of the game. Remember, subsequent heirs get given random personalities:
Rebels and ronin = p_standard
Shimazu = p_splendid_isolation
Mori = p_stalin
Oda = p_h4x0rz
Imagawa = p_yakuza
Takeda = p_blitzkrieg
Hojo = p_rook
Ueusugi = p_yuppy
Mongols = p_h4x0rz
major_invasion_thresholds.txt
opp_invasion_thresholds.txt
These files set the weightings for the different invasion styles open to the AI - major_invasion deals with the AI's planned invasions ( usually taking several turns ) and opp_invasion.txt deals with opportunist invasions.
A major invasion occurs when the AI has decided to invade a neighbouring region and begins to stockpile his troops to do just that. The weighting help him decide when he has enough men and the time is right to invade. The most obviod example of this is the famous "Hojo Wall".
An opportunist invasion occurs when the AI scans his from lines and sees a region that, for whatever reason, is not too well guarded.The AI may decide that turn to attempt to take the region with no real plan or tactic in mind - almost a spur of the moment action, you might say.
Different criteria come into play when dealing with invasions, but mostly it's down to the relationship between the AI daimyo and the daimyo who owns the region - whether they are Allied, Neutrals or At War with each other. Even then, the decisions that the AI makes aren't always that cut and dry. Changing the values in any of the external text files may not produce the effect you were expecting. Even though the these values are taken into account, there are lots of other calculations taking place that also affect the outcome, and these are values you can't get to.
Right, that's all the info from the external files. Hope it's been of some help to you guys. If there's any more info you want, don't hesitate to ask.
Target.
Editted to include stuff I'd forgotten first time around.
------------------
Quote MagyarKhans Cham:
i even suspect Target is coming here to hype things up.[/QUOTE]
[This message has been edited by Target (edited 12-07-2001).]
Bookmarks