Results 1 to 16 of 16

Thread: Formations

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member Senior Member Duke John's Avatar
    Join Date
    May 2003
    Location
    Netherlands
    Posts
    2,917

    Default Formations

    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:


    And the unit appeared on the battlefield in this formation:

    (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.
    Last edited by Myrddraal; 07-26-2005 at 16:15.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO