Author Topic: ELV and TYP files?  (Read 1493 times)

Offline gatso

  • Silver Member
  • ****
  • Posts: 1279
ELV and TYP files?
« Reply #30 on: February 21, 2003, 02:52:09 PM »
Quote
Originally posted by Voss
A drop down list box will allow a user to select ordinarily unacceptable tiles, just in case.


OK. Got it. Apart from the above. There's only 7 tiles, what do you mean by 'ordinarily unacceptable'?

Gatso

Offline Shiva

  • Silver Member
  • ****
  • Posts: 966
      • http://members.cox.net/srmalloy/
ELV and TYP files?
« Reply #31 on: February 21, 2003, 03:48:21 PM »
Quote
Originally posted by Voss
I am creating a system to rapidly and automatically place terrain tiles. It will allow users to modify the range and interval to which tiles are placed. A drop down list box will allow a user to select ordinarily unacceptable tiles, just in case. Also, the user should be able to designate a source directory (bitmaps) and output directory (typ files). The whole reason for this is to speed up the creation of typ files.


Voss, can you email me the internal file formats of the .ELV and .TYP files? I've got some ideas about algorithms for distributing the terrain tiles, and would like to take a crack at implementing them, but I'd rather not have to reverse-engineer the file format if I don't have to.

Offline NHawk

  • Silver Member
  • ****
  • Posts: 1787
ELV and TYP files?
« Reply #32 on: February 21, 2003, 03:55:46 PM »
Quote
Originally posted by Shiva
Paint Shop Pro has a function to do this, so Photoshop should too.
My God you just made my life sooo much easier. I have them both.:D
Most of the people you meet in life are like slinkies. Pretty much useless, but still bring a smile to your face when you push them down the stairs.
-------------------------------
Sometimes I think I have alzheimers. But then I forget about it and it's not a problem anymore.

Offline pokie

  • Silver Member
  • ****
  • Posts: 841
      • http://s7.eastlink.ca/~tscott
ELV and TYP files?
« Reply #33 on: February 21, 2003, 06:22:31 PM »
Quote
NUTTZ
The snow tile NEVER shows on my maps randomly or at any specific alt. I don't remember snow tile EVER showing up in my map unless I place it.


Right now it seems that ROCK is the higest elevation tile with either using the MapMaker or the Bmp2map program.

Quote
NUTTZ
The TE and Wabbit's program auto tiles now. A few things that would help and hurt at the same time would be the tiles to automatically place ONE land tile against water. this would help AND hurt. I often use more than one tile to transition with water and on some maps used snow to transition with water. we could have some user control on what tile would transition with water I would welcome it to auto tile with grass BUT would like even more that the USER could pick this tile or multiple tiles.


One of the things to think about is we are only dealing with 6 Tiles ....  water, grass, farm, forest, grassyrock and rock and a possible 7th tile snow, if we can get the TYP file to make the TE to except it.  The transition tiles will look after themselves automatically.  With the 6 or 7 tiles we have 256 color scale numbers to work with.  ( RGB numbers of grayscale from 0 to 255 )  So with that in mind maybe we could enter those numbers to gives us what we want?
Example: Maybe I only want grass, Forest and Rock on my terrain and I don't have water!
Quote
Voss
Gatso I think it needs to be 1024x1024. I don't think that combining an older typ and elv would be a good idea. I can see problems there. I'll have to revisit the akbmp2map program as I didn't see that kind of functionality, and it seemed restricted in other ways. However, you have a good point about 0k ground not being water.


Work with the 1024 X 1024 bmp, the TE can place tiles every 2640 ft, Idealy it would be every 5280 ft but if you notice in the TE that any tile place while mouse cross is at North, NorthEast or East will still place that texture in the Center of the Gridsquare.

I can't see how you can work around the 0 ft alt ground not being water with out changing the Bmp image.  I think that this would be easier corrected in the Te after.  Just don't make land less than 1 ft alt and you can eliminate this.


Quote
Voss
Other things could be added later. Getting the thing working with this first functionality would seem to be the biggest time saver, but I will be glad to offer the code with the program. Someone else may have to provide web space for it, though.

Web space for the program shouldn't be a problem, I'll volunteer as I'm sure others will.  FIELD OF DREAMS "Build it, and they will come"

P.S  I'll sorry if this is a little scrambled, I'm been interrupted several times at home here while making this up that I've loss some of my train of thought :(

Pokie

Offline Voss

  • Silver Member
  • ****
  • Posts: 1261
      • http://www.bombardieraerospace.com
ELV and TYP files?
« Reply #34 on: February 22, 2003, 12:26:12 AM »
I'll email you if you want, but I think it's fairly simple. The typ files are just numerical representations of the tiles for a given point (the center of a given polygon I'm guessing). The file is written in reverse order, so the upper left tile of a given terrain is written last. Water is 00, grass 01, etc. There is no angle data in a typ file.

I think! I haven't tested it, but that seems to hold. At least that's what my analysis indicates.

The elv files are a little more difficult. Again, I haven't tested this thoroughly, but it makes sense that it would be vertices data, probably a normal vector, and probably in reverse order again. It's not really important, because you can let the editor create the elv file.

You can test this by creating a dummy input file and checking the results, which is precisely what I intend to do (and did preliminarily, but I also ran into several editor/system crashes doing it). It would be nice if HT just opened up and let us in on the makeup of the elv files, but I believe I have all the information I require.

I said I would post a sample of the application form, but I haven't had the time to sit down and make it yet (takes just a few minutes anyway). I am intending to have a single form where the user selects the input image and sets his choices for altitude changes between tiles and the tiles to be used for each of six altitudes. Additionally, I intend to allow some turbulation of tiles, so they are a little mixed around the edges (again user defined). There will also be an output window and a thumbnail on import. So, each of six different altitudes can be set by the user and have a tile assigned to it. Tests for 0 versus 1 alt, and error handling, etc.

Did I miss anything? (More tomorrow as time permits)
« Last Edit: February 22, 2003, 12:40:01 AM by Voss »

Offline Shiva

  • Silver Member
  • ****
  • Posts: 966
      • http://members.cox.net/srmalloy/
ELV and TYP files?
« Reply #35 on: February 22, 2003, 12:45:08 AM »
Quote
Originally posted by Voss
Did I miss anything?


Taking a hint from VistaPro, I would suggest that you add a 'cliff' setting, which would automatically apply the 'rock' texture to any tile that had a slope greater than a user-defined value. This would let you automatically get bare rock mountains from sufficiently-sharp elevation changes in the terrain.

Offline gatso

  • Silver Member
  • ****
  • Posts: 1279
ELV and TYP files?
« Reply #36 on: February 22, 2003, 06:19:26 AM »
I just found out you can open .typ files as images. I don't know why I didn't think of this before.

For a 512x512 map,

copy the .typ file to somewhere safe.

rename it to .raw

Use the settings below and you can open it in Paint Shop Pro and I assume photoshop. (see pic)

RGB,

0,0,0 is Water
1,1,1 is Grass
2,2,2 is Grassy Rock
3,3,3 is Farm
4,4,4 is Rock
5,5,5 is Forrest
6,6,6 is Snow

It'll look completely black so I change it to 16 mill colours and swap each RGB to an obvious colour, (blue for sea, green for grass etc)

I just fixed ALL the coastlines on a 512x512 map in less than 2 hours using this method. One use, I assume you could find others.

Before saving take it back to RGB 0,0,0 to 6,6,6 and 8 bit colour. Also remember to flip the top and bottom.

Gatso

Offline BenDover

  • Platinum Member
  • ******
  • Posts: 5803
ELV and TYP files?
« Reply #37 on: February 22, 2003, 10:32:16 AM »
works in ifranview as well

although you can only edit :(

Offline BenDover

  • Platinum Member
  • ******
  • Posts: 5803
ELV and TYP files?
« Reply #38 on: February 22, 2003, 10:37:36 AM »
d'oh, the image didn't attach

Offline Voss

  • Silver Member
  • ****
  • Posts: 1261
      • http://www.bombardieraerospace.com
ELV and TYP files?
« Reply #39 on: February 22, 2003, 10:55:28 AM »
Gatso, you might try setting up a special palette for editing purposes and importing that every time you edit a typ. Save the original palette before you start, import the edit palette, do your work, and then import the original before saving your work. That would save you having to reset each individual color.

I'll think about including this as a method.
« Last Edit: February 22, 2003, 11:20:59 AM by Voss »

Offline Voss

  • Silver Member
  • ****
  • Posts: 1261
      • http://www.bombardieraerospace.com
ELV and TYP files?
« Reply #40 on: February 22, 2003, 11:31:47 AM »
Actually, I just thought of a much easier way to do this.

The bitmap used as input could be used as a height_field bitmap and rendered in Pov-Ray with the appropriate colors applied to different height values. It would be clumsy and confusing to guys that don't use Pov, though.

The process would involve rendering, color reduction, importing a greyscale pallette, saving as raw data, and renaming the file *.typ.

I still like the editor idea.

Offline NAD

  • Zinc Member
  • *
  • Posts: 1
ELV and TYP files?
« Reply #41 on: March 19, 2003, 06:33:50 PM »
Voss, I would appreciate if you can e-mail  me the  file formats of  *.ELV and *.TYP files, and inform me about any tool that opens and reads the data.
Thanks.

Offline Shiva

  • Silver Member
  • ****
  • Posts: 966
      • http://members.cox.net/srmalloy/
ELV and TYP files?
« Reply #42 on: March 19, 2003, 07:45:54 PM »
Quote
Originally posted by NAD
Voss, I would appreciate if you can e-mail  me the  file formats of  *.ELV and *.TYP files, and inform me about any tool that opens and reads the data.


Same here, except that you can just e-mail the file formats; I'm sure I can write my own code to read/write the data.

ADVthanksANCE