Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: terrain tiles and splines?

  1. #1

    Icon3 terrain tiles and splines?

    This relates to Topcat's thread on splines, but I'm starting this thread because it's an offshoot...

    I've been trying to discover how terrain templates work.
    Right now I'm trying to discover how the game places stone walls on battle maps.
    I've created a custom battle map (see the WIP thread here: http://www.twcenter.net/forums/showthread.php?t=370390)
    The only thing it lacks is stone walls. The Lordz map modding tools aren't able to do it.
    One thing we know is that stone walls are rigid splines, placed on 2D map coordinates -- there's a file in battleterrain.pack/walls called wall01_xs.rigid_spline.
    Originally I was thinking it would be impossible to place walls because we have no current tool for placing splines.
    But now I'm thinking that stone wall splines may already be pre-defined in ETW on its system of terrain tiles.
    For example, each battle map's battleterrain folder contains a file called farms.farm_manager. When I open in in Notepad I see a lot of garbage characters, but I can read a lot of filenames listed, and they include all the farm tiles, splines and textures for walls and fences. So I think this manager file controls which farm tiles show up on the map.
    Maybe a certain farm tile -- for example, american.farm_template_tile, already has a square border of walls on it. Then the only question is how to invoke that particular tile in farms.farm_manager, and have it display where we want it to on our battle map.
    Any thoughts?

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

    Default Re: terrain tiles and splines?

    I agree with you, that those walls and farm textures are predefined, also buildings and village layout.. Those layouts are defintily stored in those farm_tile templates, which seams to be some sort of container with different layouts stored inside, which loads the engine random. There is also a DB File, which assigns those farm tiles to their corrosponding area (eg ottoman, or north west europe), but this isnt openenable in the PFM.
    But you would definitly need a programmer, perhaps you can find some help by the internation programmatic laboratoy
    http://www.twcenter.net/forums/showthread.php?t=376297

    Problem for a possible toolmaker, is the fact that the map Algier of Empire used walls, but since all Empire maps were locked (the NTW ones not, but here no map is using those walls), makes it pretty difficult to find out how this farms manager works with those wall splines.

    But i'm also interested in any progress on this field.

  3. #3

    Default Re: terrain tiles and splines?

    Good thoughts, Primergy -- let's work together to try and solve this puzzle. The first step I think is just finding a way to open and read the farms.farm_manager file, so we can really see everything in it without the garbage characters.

    Here is one you can look at if anyone wants to experiment and see what can open/read it:

    http://www.filefront.com/17195815/farms.farm_manager

    My theory is that we might not need a tool, if we can read farms.farm_manager and discover how it is switching on and controlling the appearance of farm tiles on a battle map. For example, it might just be a matter of inputting certain numbers (say, x,y,z and rotation coordinates) into the settings for the existing textures or splines listed in a farms.farm_manager file. And if we are able to do that, we would be able to experiment and see whether/how changing certain settings makes certain tiles appear in the game.

    So we may never be able to get into the spline editing or db editing or tile editing -- but maybe we don't really need to. We could just work with the existing ones already set up in the game, if we can simply figure out how to switch them on or off in places where we want them.

    Please PM me anytime if you have ideas or suggestions, too.
    Last edited by Flavious; August 12, 2010 at 02:57 PM. Reason: attachment

  4. #4

    Default Re: terrain tiles and splines?

    I PMed Andrey at that programming thread, asking him if he wants to experiment with trying to open/read the file.
    Last edited by Flavious; August 12, 2010 at 03:04 PM. Reason: spelling

  5. #5
    alpaca's Avatar Harbinger of saliva
    Join Date
    Sep 2005
    Location
    Germany
    Posts
    4,811

    Default Re: terrain tiles and splines?

    If you find someone to take a look at cracking it for you, tell him that it seems to be encoded like the ESF format, with a byte telling the game what type of data it's going to read followed by the actual data.

    For example 0D 0000803F 00000000 0000CA43 is a set of three floats (float 3d point if you like). Here's the file types we know with their format bytes:

    ONE_OF_MANY_TYPE = 256
    SINGLE_NODE_TYPE = 128
    MULTI_NODE_TYPE = 129
    SHORT_TYPE = 0
    BOOL_TYPE = 1
    INT_TYPE = 4
    BYTE_TYPE = 6
    USHORT_TYPE = 7
    UINT_TYPE = 8
    FLOAT_TYPE = 10
    FLOAT_POINT_TYPE = 12
    FLOAT_3D_TYPE = 13
    UTF16_TYPE = 14
    ASCII_TYPE = 15
    UNKNOWN_TYPE = 16

    Can't give you much more help right now as I don't have the time to really look into it.

    Edit: Actually, I can help you. Simply open the files in ESF editor
    I guess I'd better go to sleep.
    Last edited by alpaca; August 12, 2010 at 03:43 PM.

    No thing is everything. Every thing is nothing.

  6. #6

    Default Re: terrain tiles and splines?

    Thanks Alpaca -- this is another step forward. I was able to open farm.farm_manager in the esf editor, and to see the directory tree structure. But as soon as I click on any of the files, I get an unhandled exception error. I also tried exporting the files to an ETW esf file, then opening that with esf editor. But I also get the same errors when trying that. Is there something I'm overlooking here?

  7. #7

    Icon14 Re: terrain tiles and splines?

    Never mind -- I was lacking the net.framework and now I can open everything without an error.
    OK, here's what the two files in farms.farm_manager look like when opened in esf editor:





    I have no idea what any of this means, of course. But at least we have the pieces of the puzzle clearly in front of us. In the first image we see a list of all the hedges, fences and walls, etc., that appear in this particular farm tile -- which confirms my suspicion that farms.farm_manager controls the appearance and location of these in a battle map.

    Now here's my question: If I open my battle map in PnP Terrain Creator (which I used to identify and export all the map locations for my rigid mesh buildings) I can locate the x, y and z coodinates for any given spot on the map. What if I were to pick a "stand-in" object -- let's say a wheelbarrow -- and place it wherever I want a farm tile to go. In theory, I could export that list of points to a text file. Could there be a way to use those coordinates from the text file, somehow, as inputs to these tables to make certain farm tiles show up on the map in a certain place? Any ideas?

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

    Default Re: terrain tiles and splines?

    Thank you very much Alpaca for having a quick look into it!

    Now here's my question: If I open my battle map in PnP Terrain Creator (which I used to identify and export all the map locations for my rigid mesh buildings) I can locate the x, y and z coodinates for any given spot on the map. What if I were to pick a "stand-in" object -- let's say a wheelbarrow -- and place it wherever I want a farm tile to go. In theory, I could export that list of points to a text file. Could there be a way to use those coordinates from the text file, somehow, as inputs to these tables to make certain farm tiles show up on the map in a certain place? Any ideas?
    I doubt its that easy. Personally i believe that the farm_field_tile_texture are textur maps, which are working similar to all those Blend and colour maps of the singleplayer custom map. Atleast those for grass and colour map, which define which colour is where, which grass type grows where.

  9. #9

    Default Re: terrain tiles and splines?

    But does it matter what the farm_field_tile_texture files are, if we don't need to open or edit them? The whole point of a tile is that it's pre-designed off the shelf with all its elements, and doesn't need to be designed or edited for each map. It seems to me what we really need to know is what these numbers mean, and their effect (if any) in making something appear on a map. If we can call up a tile -- any tile -- even if it looks odd and in a funny place on the map -- we will have a major breakthrough. And then we could start to adjust settings to get what we want. One thing is certain: There's no other file or setting in a map's battleterrain that could be controlling stone walls and other rigid spline objects. I've worked with and tweaked all of them, and the process of elimination means it has to be this one.

  10. #10

    Default Re: terrain tiles and splines?

    Andrey says he is working on the problem, so maybe we'll hear something interesting from Russia soon.

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

    Default Re: terrain tiles and splines?

    But does it matter what the farm_field_tile_texture files are, if we don't need to open or edit them?
    I want to open and edit them, if possible . Have some ideas but to know if those possible i need a deeper look.
    Besides that, i always want to have a full picture of whats going on.

  12. #12

    Default Re: terrain tiles and splines?

    That would be great if we could open and edit tiles, Primergy -- I'm with you all the way. For now, though, wouldn't it be great as a first step if we could just get stone walls, etc., to appear on custom battle maps and not have to do anything more than adjust some settings to call the tiles up? Walls affect tactics a lot. Especially in the American Revolution, where militia units really need to fight behind cover of walls and fences. Otherwise the militia rout too quickly after just a few casualties. Walls were also everywhere in the Colonial American landscape, so they would make the terrain look and play a lot more realistically. You might be right though -- I know I may be naive about how feasible this might be.

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

    Default Re: terrain tiles and splines?

    Well, sometimes its also easier to see how things working if you can have a visual look on them.

    Btw: You can also open the dat files of the compressed empire maps with the ESF Editor, perhaps opening the algeria map helps, since this is the only map where walls and fences are placed.
    Last edited by Primergy; August 16, 2010 at 03:56 AM.

  14. #14

    Default Re: terrain tiles and splines?

    Primergy - your suggestion to look in CA's Algeria presets folder and to try opening its farm_manager with the esf tool was a fruitful one!

    I was able to open and view all the elements of farm_manager and see deeper inside its workings:

    Here's the top level, with the farm_manager directory selected. I don't know what the values mean, but look at the entries for Field17, Field18, etc. I think the main directory is defining farm fields that will appear on the map and saying where those fields will be located.



    Next we have the template specified to be used for farms on this map - Ottoman style farmland.
    After that are two farm_tile_set subdirectories. Maybe one for farms, and one for walls?
    Here's what a farm_tile_set contains:


    Next there are many subdirectories called either farm_instance or wall_instance. I haven't counted them, but maybe each instance corresponds to and defines a farm or field number that was specified in the top level of farm_manager.
    Here's the top level of a wall_instance:

    Again, I don't know what the numbers do or what they mean here. They're setting up a particular wall, obviously.

    And underneath the each wall_instance is a farm_data_item_owner_instance file:



    The number of entries make it look as if this file is specifying actual coordinates (header, x, y, z) perhaps?

    Anyway, that's the structure of a working farm_manager file in a battle map that definitely has walls on it. I throw the topic open for more public speculation and analysis...

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

    Default Re: terrain tiles and splines?

    Nice research!

    Since i dont have acess to my main PC (broken) i cant look for myself. But is it possible to extract the information of the ESF File? Didnt worked with the Editor much, so maybe this question is more or less stupid.

    It would be definitly intersting to see how this file would work on another map.. especially how the coordinates work.

  16. #16

    Default Re: terrain tiles and splines?

    Quote Originally Posted by Primergy View Post
    Nice research!

    Since i dont have acess to my main PC (broken) i cant look for myself. But is it possible to extract the information of the ESF File? Didnt worked with the Editor much, so maybe this question is more or less stupid.

    It would be definitly intersting to see how this file would work on another map.. especially how the coordinates work.
    Yes, that was my next thought -- why not just place Algeria's farm_manager file into the battleterrain folder of a battle map (like the custom one I made, Whiteplains), and then just see what happens and see what shows up in what locations?

    The easiest option would be to just use the unedited algeria farm_manager in the new map and see if it works. I think that's likely to crash, since I think specific textures and objects are linked to specific climate types and geograpic areas. So if that doesn't work, my next step would be to find a way to edit the farm_manager file and change the farm_template from ottoman to american.farm_template_tile.

    I think there's also a corresponding change that would have to be made in the textures.xml file. The version depicted in the Lordz tutorial (and the one I've used successfully) has a blank entry for this setting:

    farm_tiled_detail_map=''

    I think something needs to go there, in order for the farm_manager to work. But what goes there? Maybe it's the same american.farm_template_tile ? or some other entry?

    Even if we did get Algeria's farm_manager to work in a map (and that would be a big breakthrough), we'd still have to find a way to edit the settings intelligently so the maps would look the way we want them to.

  17. #17

    Default Re: terrain tiles and splines?

    I just tried using the esf Editor to open Algeria's bmd.dat file, select the farm_manager subdirectory, and then and do a "save as." But the "save as" menu item seems locked on the original name of bmd.dat. It doesn't seem to give me a way to save the subdirectory under a new name.

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

    Default Re: terrain tiles and splines?

    I was able to copy the algeria map walls to a custom map.... the placement is rather random but it's going forward.


  19. #19
    Ordinarius
    Join Date
    Jul 2009
    Location
    Italy
    Posts
    737

    Default Re: terrain tiles and splines?

    Quote Originally Posted by Primergy View Post
    I was able to copy the algeria map walls to a custom map.... the placement is rather random but it's going forward.

    What do you mean with Algeria map walls?

  20. #20

    Default Re: terrain tiles and splines?

    Great nick PietroMicca, he saved my town

    Primergy, which file you copy to the custom map? buildings list or the props list?

Page 1 of 2 12 LastLast

Posting Permissions

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