RHOMBS.RES LAYOUT For making new tile sets in SS2 texture schemes RHOMBS.RES contains the texture tiles making up the basic landscape in SS2. It consists of pure non-compressed data, each image 1024 bytes in size. Index and definition of these tiles are found in RHOMBS.EDT and palettes in RHOMBS.PL. In Standard SS2, RHOMBS.RES and RHOMBS.PL is located in GAME_SCHEMEx.SUE and RHOMBS.EDT in EDIT_SCHEMEx.SUE. File structure of RHOMBS.RES 1..n tiles, 1024 bytes of data each Each data byte represents a position in the palette (a color). The alignment of these data is another matter however, as they are stored in a rhomb, not a square. As shown above, every tiny square represent a pixel, making the first line consist of three pixels, hence the first three bytes of data. In the next line there is 7 pixels, third line 11 pixels and so on. For every line between 1 and 15 the number of pixels is increased by 4. Following this, line 16 consists of 63 pixels. Now we start to decrease the number of line pixels by two for line 17, which gives it a total of 61 pixels. The following lines up to 32 is decreased by 4. You can compare your decoding with these two tiles from GAME_SCHEME1, which is rendered using the brightest palette and in 5:1. CODE procedure ReadTile(brightness: byte); var color,k,x,y: byte; begin k:= 2; for y:= 0 to 31 do begin for x:= 0 to k do begin Read(color,1); Bitmap(31-k div 2+x,y):= palette[brightness][color] end; if y = 15 then dec(k,2) else if y > 15 then dec(k,4) else inc(k,4) end end; A small example on how to read data for a single tile and turn them into pixels in a bitmap. File structure of RHOMBS.PL 64 * 512 byte palettes This file holds 64 standard 512 byte palettes representing the 64 levels of brightness one is able to set within the editor. That means that the only difference between the 64 palettes is the brightness of the color entries. The first palette is dark and number 64 is brightest. File structure of RHOMBS.EDT Contains information on terrain tiles for a given texture scheme. The state of a tile represent blending between two terrain tiles. Sudden Strike II has 12 different blending options as shown in the picture above. CODE type TTerrains = packed record count: integer; terrain: array of packed record name: array[1..32] of char; default: integer; offset: word; count: integer; values: array[byte] of byte end end; Well, I just had a brief look at rhombs.edt in a hexeditor and frankly, I can't figure out how I over a year ago came to that conclusion, that offset represented an offset for the texture tiles in rhombs.res. When I figure it out I'll let you know. For more indepth info on RHOMBS.EDT, please refer to structure of map files. Making tiled textures Making Rectangular and Isometric Tiles Tiled Terrain. Questions answered QUOTE(JOSS/WildCat/) About RHOMBS... I want create all SS2 universal schemes (8 type of grounds ...) I am understand how but so more routines work in HEX! That's true. But I wouldn't recommend using a lot of time automating the process if your goal is to combine existing schemes into one. For that purpose a good hex editor would do. I myself uses Hex Workshop. QUOTE(JOSS/WildCat/) 2. Why count of tiles in SSF-summer scheme are 429? Simple math, with a filesize of 439296 bytes divided by 1024 bytes per tile, mappic.rs2 holds 429 tiles. This number correspond correctly with the sum of texture tiles found in mappic.sb2, as grass has 18, grass2 has 21, pashnya 58, swamp 80, ground1 with 24, ground2 with 69, water 98 and sand 61, together they equal 429. QUOTE(JOSS/WildCat/) Its "script" for ripper and it work not propertly jet...on output it create rubbish BMP... What wrong? CODE var i,j,width,height,colcount,r,g,b; openfileas('*.raw'); setpos(0); width:=63; height:=32; setsize(width,height,0); colcount:=read(0); First, I'll assume that the file you're reading here is rhombs.pl and not mappic.rs2 or rhombs.res. The number of colors is always 255, which means that the first byte in rhombs.pl contains a color entry and not the number of colors. QUOTE(JOSS/WildCat/) CODE for i:=0 to 31 do begin r:=read(1); g:=read(1); b:=read(1); setcolortable(i,rgb(r*8,g*4,b*8)); end; Palettes are always in 16bit color format (R5-G6-B5), which means that you have to convert the palette into 24bit colors (RGB) before drawing. (See chapter Palettes and color conversion and RHOMBS.RES for details.) Here you read the file as 24bit RGB, which is wrong. QUOTE(JOSS/WildCat/) CODE for j:=0 to height-1 do for i:=0 to width-1 do setpixel(i,j,read(1)); Mappic.rs2 and rhombs.res only contains index data reffering to the palette. Eg. if the byte read has a value 55, then the color of that pixel would be palette[55]. But the above will still not work as you read the tile as a square. What you should do is to read it as shown in chapter RHOMBS.RES. QUOTE(JOSS/WildCat/) 1. What pallete use standing objects? 2. What structure of most (dom).res? I think in one file are some .col files and .hot. 3. What structure of zabor.res? 4. Is bred.res - for what purposes? File for configuration or not used? So Can we use it in editor or in game? As answer above, all palettes are 16bit color entries. Which do you mean, most.res or dom.res? But anyway, you're right, dom.res contains both color palette and among other things infantry placement for each house within the file. I'll post the structure on zabor.res as soon as I find time. None, really. It only contains a single picture as I recall, looked a bit like some overlay graphics. This post has been edited by mzach: Aug 25 2005, 07:57 PM