Duke John
12-13-2004, 15:11
Modding Resource Header
Title: Unit Formations
Posted by: Duke John
Modding area: Units (in battle)
Required programmes: Image editor capable of editing .tga files
Hardcoded limits: There can only be one formation set here. Any formation added will replace the Hord formation
Summary: The Horde formation is generated using dots in an image file. By re-arranging these dots, the shape of the formation can be changed, but you can only edit the existing horde formation. No new formations can be added.
__________________________________________________
Unit Formations
Horde
There is a file called horde.tga in \Data\battlefield\formation. From the dots I figured that this image acted as a template for the horde formation used by peasants and such. I tried several possibilities until I discovered that the different colours (there are about 55 green colours) didn't mean anything.
The horde formation is build up from the center of the image: x=367,y=373 and then some code is run that starts with ever growing circles (or a spiral) and each dot it finds is represented on the battlefield as an soldier.
So to test out the theory I made a grid of green dots in the center of the image:
http://chronicles.metw.net/org/guides/formation_horde_1.jpg
And the unit appeared on the battlefield in this formation:
http://chronicles.metw.net/org/guides/formation_horde_2.jpg
(Blue dot representing officers, and red dot the general.)
The center of the image should correspond with the center of the frontline of the unit.
The placement of the soldiers are horizontally mirrored. So if you want a gap in the formation on the left, you should leave out dots on the right.
Officers and generals are placed after all the soldiers and as such will always be placed on the outerside. Too bad since you cannot use this formation to place the general in the middle of the unit (which I had hoped for). The general is placed after the officer.
Title: Unit Formations
Posted by: Duke John
Modding area: Units (in battle)
Required programmes: Image editor capable of editing .tga files
Hardcoded limits: There can only be one formation set here. Any formation added will replace the Hord formation
Summary: The Horde formation is generated using dots in an image file. By re-arranging these dots, the shape of the formation can be changed, but you can only edit the existing horde formation. No new formations can be added.
__________________________________________________
Unit Formations
Horde
There is a file called horde.tga in \Data\battlefield\formation. From the dots I figured that this image acted as a template for the horde formation used by peasants and such. I tried several possibilities until I discovered that the different colours (there are about 55 green colours) didn't mean anything.
The horde formation is build up from the center of the image: x=367,y=373 and then some code is run that starts with ever growing circles (or a spiral) and each dot it finds is represented on the battlefield as an soldier.
So to test out the theory I made a grid of green dots in the center of the image:
http://chronicles.metw.net/org/guides/formation_horde_1.jpg
And the unit appeared on the battlefield in this formation:
http://chronicles.metw.net/org/guides/formation_horde_2.jpg
(Blue dot representing officers, and red dot the general.)
The center of the image should correspond with the center of the frontline of the unit.
The placement of the soldiers are horizontally mirrored. So if you want a gap in the formation on the left, you should leave out dots on the right.
Officers and generals are placed after all the soldiers and as such will always be placed on the outerside. Too bad since you cannot use this formation to place the general in the middle of the unit (which I had hoped for). The general is placed after the officer.