Results 1 to 20 of 20

Thread: Farm_Tile_Templates Research

  1. #1
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Farm_Tile_Templates Research

    Farm Tiles

    The Farm Tile Templates are used by the Engine to create Fields but also the "Cities" on the Campaign Battle Maps.
    There are several Templates for nearly each region, like America and India.
    So understanding those templates enables us to change the look of the campaign Battles.

    Here you have a partial assemblied puzzle of those tiles (This is the upper right corner of a 2048*2048 map, with the zero point nearly there where the red dummy is):




    Structure

    The overall structure is rather easy and straight forward, the names already indicating what each "list" does.

    You have Entries for:


    1. Farm List
    2. Wall List
    3. Road List
    4. Wall Post List
    5. EF Line List
    6. Farm Tree List (2x)

    After those Lists there is a bunch of coordinates where i actually don't know what they are doing.
    If you type them in they sometimes are resutling in a closed ring and sometimes open.
    Atleast those <u> are the number of the entries.




    If you open up such a farm_list entry you have always the same structure:


    1. FARM_LIST
      1. FARM_DATA_ITEM_OWNER
        • Name (Field13)
        • <u> 0
        • <u> 1
        • FARM_DATA_COLLECTION



          1. ID LIST (244 245 247 248 249)
          2. ID LIST (65, 506, 507)
          3. FARM DATA ITEM LIST (Here are the field props placed like a cart)
          4. FARM DATA ITEM LIST (Mostly empty)
          5. FARM DECAL LIST
          6. ID LIST
          7. ID LIST



        • FARM_DATA_COLLECTION (same as above, empty)
        • FARM_DATA_COLLECTION (same as above, empty

      2. FARM
        • Postionend_wall_handle_list

          • Wall_List_Section
            • Number of the Postion of the Wall in the Template File (eg 35, 65,0)


        • road_handle_list
        • id_list (46)
        • id_list
        • Farm_Collision (More later on this one)

    To be continued.

  2. #2
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Farm_Tile_Templates Research

    A Field Entry consists of two parts - the Farm Data Item Owner which handles the objects and the look of a field and the Farm Part, which seams to controll, how the field "interacts" with other fields and walls.


    Field Collision:

    The Field Collision defines the size and the borders of a field.



    The three v2 entries are spanning up a plane on wich the texture get placed, the size of the plane corrospondents with the size of the field texture, means one pixel of the plane is one pixel on the map.

    The v2_array is a collection of coordinates, which defines the "route" of a closed spline (The Thin Green Line on the edge of a field).
    It's obvioulsy the border of the field, but what happens if 2 borders are overlapping, isn't known yet.

    What the U and i4_array entries are doing, i don't know. But after a quick check there seams to be a muster. The U often has a 17,1 and 3 there and the i3_array either 0, or 0,3,2 or 0,3,1.
    So maybe those are used to tell the engine when a field is allowed to be placed (eg the "town field" when you fight in a city, or the "warehouse" field, when you are fighting on a slot)




    POSITIONED WALL HANDLE LIST

    (Later)

  3. #3
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Farm_Tile_Templates Research

    Instead of posting dozens of pics i decided to upload a commented XML of the EU_North_template_tile

    There are still things unkown, so if you have an idea what something could be or if i made somewhere a mistake, feel free to update it and upload it again.

    Attachment 141566

  4. #4
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,308

    Default Re: Farm_Tile_Templates Research

    I probably broke your tutorial, but I added support for three tags (farm_tree, wall_post, id_list), and some xml splitting.

    It should be a lot cleaner now. If you need any more help with this kind of changes, just tell me which tags you'd like to see cleaned up.

  5. #5
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Farm_Tile_Templates Research

    When its needed that the xml folder has the same format as the newly exported one, then yes, you did .

    But thank you anyway, it's now easier and faster to work with .

    I finally recognized what the <flt> tags in front of the wall coordinates are doing. Those flt are the distance between the starting and end point of a wall. If those floats don't fit with the lenght of the wall ingame, the texture gets strechted.



  6. #6
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Farm_Tile_Templates Research

    Found out what ID thingies mean:




    Those refering to the farm_tree list while the first ID List belongs to the first Farm Tree List and the second ID list belongs to the second Farm Tree List.
    So the Number 1024 is the 1025st Tree entry.

  7. #7
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,308

    Default Re: Farm_Tile_Templates Research

    I haven't been following this too closely - how far are we wrt modding battle maps and creating new battle maps?

    From what I remember Medieval 2 maps were far more interesting than Empire maps, but with some modding it should be fixable, right?

  8. #8
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Farm_Tile_Templates Research

    I haven't been following this too closely - how far are we wrt modding battle maps and creating new battle maps?
    hmm, i would say it's completly possible to make valuable changes to existing templates but creating a compelte set, while doable, a lot of work since you have to type all values by hand^^.

    The heightmaps is another thing, the game uses some preset templates to generate the terrain and those are atm designed that way that hills and other things are on the outside field, while the inside is mostly "plains".
    Though CA was so friendly and left the colour code inside of the packs, so propably it would be possible add eg an ocean near a harbor map (atm the "slot templates" don't have a template with ocean "painted" inside, so you always get land map, when attacking an harbor).
    Though it's hard to say if such changes are really working, because of the random map generation, so you have to play a lot of hours till you get the map you created.


  9. #9
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Farm_Tile_Templates Research

    No idea if someone is interested, but i was able to place a usable wall on a custom map.


  10. #10

    Default Re: Farm_Tile_Templates Research

    This thread may be quiet, but it will prove invaluable to people making maps. Don't let the radio silence slow your progress
    My Tools, Tutorials and Resources

    Was running out of space, so see the full list here!

    Consider the postage stamp: its usefulness consists in the ability to stick to one thing till it gets there.- Josh Billings
    The creatures outside looked from pig to man, and from man to pig, and from pig to man again; but already it was impossible to say which was which.- George Orwell

  11. #11
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,308

    Default Re: Farm_Tile_Templates Research

    Quote Originally Posted by Primergy View Post
    No idea if someone is interested, but i was able to place a usable wall on a custom map.
    So, what can be done so far?

    I've been playing some M2TW lately, and it seems to have a lot more interesting and varied maps than ETW.

  12. #12
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Farm_Tile_Templates Research

    I think more varied heightmaps is a db entry (or atleast how likly a landscape type appears).

    The Farm templates itself are completly editable, it's only a lot of handwork (to place a wooden fence on my map i have to type 1080 numbers )
    Possible usage would be to to get a road network on the maps between the villages (it really upsets me..^^) or if possible to add a new subculture and add vineyards to vine regions

  13. #13
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,308

    Default Re: Farm_Tile_Templates Research

    Quote Originally Posted by Primergy View Post
    I think more varied heightmaps is a db entry (or atleast how likly a landscape type appears).

    The Farm templates itself are completly editable, it's only a lot of handwork (to place a wooden fence on my map i have to type 1080 numbers )
    Possible usage would be to to get a road network on the maps between the villages (it really upsets me..^^) or if possible to add a new subculture and add vineyards to vine regions
    1080 numbers? Not that I have any free time, but in alternate universe when I had some, does it sound like it could be automated?

  14. #14
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Farm_Tile_Templates Research

    Of course it can, walls in the xml, fences are technically not more then splines (lines) where you have to insert the coordinates of the knots. For stonewalls you have to insert only four coordinates, for wood fences nknots = length(wall)/2.

    My actual workflow is, to place a spline within 3ds max, divide it with the number of needed knots, and then select one by one and copy the coordinates to the xml.
    If someone knows maxscript it would be possible to extract the coordinates with few clicks in the needed format, so it would be only a copy and paste affair... but well i dont know maxscript .

  15. #15
    Artifex
    Patrician

    Join Date
    Oct 2008
    Location
    London, UK
    Posts
    1,308

    Default Re: Farm_Tile_Templates Research

    One minor thing that might help all of this - u2* types just got fixed,
    so now you have <angle> type, conveniently expressed in degrees 0..360.

    It makes so much more sense now:

    Code:
         <rec type="FARM_DATA_ITEM">
          <s>grassmud</s>
          <v2 x="201.26654" y="559.64008"/>
          <angle>269.802</angle>
          <v2 x="10.0000581741333" y="10.0000085830688"/>
         </rec>

  16. #16
    The Hedge Knight's Avatar Fierce When Cornered
    Artifex

    Join Date
    Oct 2009
    Location
    England
    Posts
    5,875

    Default Re: Farm_Tile_Templates Research

    I think the probability of tiles appearing may be in battleterrain (or etw equiv)/tiles/metadata.idx

    Cant see any tables on it anyway.

  17. #17
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Farm_Tile_Templates Research

    I assume they are choosen more or less randomly in the "field" area which is definied in the tile templates (the red areas). But there seam to be some l4-xyz entries which "specalize" a field for a certain "usage", so that the city template gets placed when attacking or fighting near city, some others are placed when you are fight on a slot (eg the "warehouse" tile"

  18. #18

    Default Re: Farm_Tile_Templates Research

    Hello

    Could you reupload your images ( the hosting site has removed them)

  19. #19
    Primergy's Avatar Protector of the Union
    Join Date
    Mar 2009
    Location
    Augsburg
    Posts
    2,487

    Default Re: Farm_Tile_Templates Research

    They will get reactivated tomorrow^^.

  20. #20
    CrisGer's Avatar Civis
    Join Date
    Nov 2011
    Location
    Colorado and California
    Posts
    140

    Default Re: Farm_Tile_Templates Research

    This is a very interesting thread, it is amazing to see what detail is possible.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •