Skip to content

RSB File Format RUS

AlexEA edited this page Jan 29, 2017 · 11 revisions

Unofficial RSB File Format description

Date: 2017.01 | Version: 0.1

Глоссарий

GR - игра Ghost Recon,
GRE - игровой движок игры Ghost Recon,
RSB - Red Storm Bitmap (формат файла текстур игры)

Оглавление

1. Ведение

2. Обзор

3. Секции

  3.1. Заголовок файла

  3.2. Пиксельные данные

  3.3. Свойства текстуры

  3.4. Дополнительные каналы текстуры

4. Аппендикс A

5. Аппендикс B

Введение

Этот документ описывает структуру формата файла RSB, используемого GRE. RSB файлы хранятся в папке "Texture" оригинальной игры и имеют расширение ".rsb".

Обзор

** RSB ** является файлом изображения, используемым для хранения растровых цифровых изображений. Вы можете открывать и сохранять RSB файлы с помощью официального плагина для программы Photoshop.

Структура файла

** RSB ** формат файла разделен на три секции (см Табл. 1).

Таблица 1 . Структура файла RSB

Секция Ссылки
1 Заголовок файла См. Таблица 2.0
2 Пиксельные данные
3 Дополнительные каналы
4 Свойства текстуры

Секции

Заголовок файла

Размер заголовка файла в зависимости от версии находится в пределах от 28 до 45 байт.

Таблица 2.0 Структура заголовка файла
Размер Тип Описание Значение
4 integer Версия файла 1,2,4,5,6,8,9
Размер текстуры
4 integer Ширина 1..2048
4 integer Высота 1..1024
Для версий больше или равных 7ой добавляются три переменные
4 integer Неизвестная константа 0
4 integer Неизвестная константа 0
1 integer Неизвестная константа 0
Битовая маска
4 integer Количество красные бит на один пиксель 0, 5, 6, 8
4 integer Количество зеленых бит на один пиксель 0, 5, 6, 8
4 integer Количество синих бит на один пиксель 0, 5, 6, 8
4 integer Количество битов прозрачности на один пиксель 0, 5, 6, 8
Для версий больше или равных 9ой добавляются две переменные
4 integer Неизвестная константа
4 integer Неизвестная константа

Размеры текстур, используемые в игре.

Таблица 2.1 Размеры текстур
Размер
1 16 x 16
2 16 x 32
3 16 x 64
4 32 x 32
5 32 x 64
6 32 x 128
7 64 x 64
8 64 x 128
9 64 x 256
10 128 x 128
11 128 x 256
12 128 x 512
13 256 x 256
14 256 x 512
15 256 x 1024
16 256 x 2048
17 512 x 512
18 512 x 1024
19 512 x 2048
20 1024 x 1024
21 1024 x 2048

Пиксельные данные

Пиксельные данные в RSB файлах представляют собой массив пикселей в цветовой модели RGB. Один пиксель массива содержит значения яркости красной, зеленой и синей компоненты цвета, а также прозрачность пикселя, т.н. альфа канал (см. Табл. 3). Значение всех переменных пикселя изменяется в пределах от 0 до 255 (см Табл. 3.1). Количество пикселей текстуры рассчитывается как произведение ширины на высоту текстуры.

Таблица 3. Битовые маски
Маска бит на пиксель Описание
1 R5G6B5 16 Красный - 5 бит, Зеленый - 6 бит, Синий - 5 бит
2 R8G8B8 24 Красный - 8 бит, Зеленый - 8 бит, Синий - 8 бит
3 A4R4G8B8 24 Альфа - 4 бита, Красный - 4 бита, Зеленый - 8 бит, Синий - 8 бит
4 A8R8G8B8 32 Альфа - 8 бит, Красный - 8 бит, Зеленый - 8 бит, Синий- 8 бит
Table 3.1 Структура пикселя
Размер Компонента Значение
0..8 Красный 0..255
0..8 Зеленый 0..255
0..8 Синий 0..255
0..8 Альфа 0..255

Свойства текстуры

Прозрачность

Анимация

** RSB **

Table 4 Texture tags.
Length Description Index (in file)
1 Gunshot Transparent Bullets can pass through the texture. ex. a wire fence. } 1
2 Grenade Transparent Grenades and bombs can pass through (with damage effects) 2
4 Line-of-sight Transparent Enemies can see the player through it. 4
5 Foliage This hinders the enemy's line of sight and causes leaves to fall if the surface is shot through. 8
7 Water 16
8 Damage Texture This feature does not yet work properly.
9 Surface Type gives the RSB an appropriate sound effect when walked on and an appropriate
damage texture when shot.

The Index (in file) is the GameProperties variable's value in RSB file. It is equal to the summ of all indices (unless Water property).

Tags set in the Map Editor in 3ds MAX will override any corresponding properties in RSB file.

Scrolling Properties

Scrolling properties animates an RSB texture by moving it horizontally, vertically or rotate, an RSB cannot have animation frames and scroll at the same time, an RSB cannot rotate if its moving Horizontal and Vertically.

Table 4. Texture properties structure
Length Type Description Value
if File Version > 5 one more value
4 integer Unknown variable
For all File Versions
1 byte Alpha Blending 1 - on, 0 - off
1 byte Alpha Testing 1 - on, 0 - off
1 byte Sampling 1 - on, 0 - off
1 byte Animation 1 - on, 0 - off
1 byte Scrolling 1 - on, 0 - off
1 byte Tiled 1 - on, 0 - off
1 byte *** Compression 1 - on, 0 - off
1 byte *** Distortion 1 - on, 0 - off
if File Version > 7 (one more value)
4 integer TextureTags see Table 4.7
if File Version not 7 (two more values)
1 byte Unknown variable
2 integer Unknown variable
For all File Versions
4 integer Source Function see Table 4.2
4 integer Destination Function see Table 4.3
4 integer Compare Function see Table 4.1
1 byte Reference Value
Texture scrolling
4 integer Scrolling Type see Table 4.5
4 float Horizontal Rate (moves texture horizontally)
4 float VerticalRate (moves texture vertically )
Animation params
4 integer Animation Type see Table 4.4
4 float Animation Interval (play speed of an animation)
4 integer Frames Count 0..9
(if Animation > 0 and TextureCount > 0) Frames Array list, repeated for Frames Count
4 integer Frame Texture Name Length
string Frame Texture Name
if File Version > 4 two more values
4 integer Maps Count
4 integer *** Subsampling Priority
1 byte Damaged
For all File Versions
if Damaged > 0 one more value (It doesn't work properly. Do not use)
4 integer Texture Name Length
string Texture Name
if File Version > 2 one more value
4 integer Surface Type see Table 4.6

*** It’s best to leave these parameters alone unless you like crashing.

Table 4.1 COMPARE FUNCTION PARAMETER
Texture size
0 Zero
1 Less
2 Equal
3 Greater Equal
4 Always
Table 4.2 Source function parameter
Texture size
0 Zero
1 One
2 Source Alpha
3 Inverse Source Alpha
4 Source Color
5 Inverse Source Color
6 Destination Color
7 Inverse Destination Color
8 Both Source Alpha
9 Both Inverse Source Alpha
Table 4.3 Destination function parameter
Texture size
0 Zero
1 One
2 Source Alpha
3 Inverse Source Alpha Source Color
5 Inverse Source Color
6 Destination Color
7 Inverse Destination Color
8 Both Source Alpha
9 Both Inverse Source Alpha
Table 4.4 ANIMATION TYPE
Texture size
0 Cycle
1 Oscillate
2 Constant
  • Cycle - a repeating pattern that starts over when it finishes. But if its attached to a billboard object it stop at the end and the billboard will disappear.
  • Oscillate - ping pong pattern
  • Constant - similar to cycle but wont disappear if attached to a billboard
Table 4.5 SCROLLING TYPE
Texture size
0 Rotate
1 Degrees Seconds
Table 4.6 SURFACE TYPE
Texture size
0 NONE
1 Carpet
2 Concrete
3 Wood
4 Metal
5 Asphalt
6 Sand
7 Lowgrass
8 Highgrass
9 Puddle
10 Water
11 Drywall
12 Thin Metal
13 Thick Metal
14 Metal Gas Tank
15 Steam Pipe
16 Electrical Panel
17 Snow
18 Safety Glass
19 Bullet Resistant Glass
20 Ice
21 Mud
22 Glass
23 Foliage
24 Gravel
25 Glass Shards

Surface Property Channels

The RSB can store additional surface channels which apply surface properties to portions of the texture. This is useful when there are several different images on a single texture, some may be wood surfaces, some may be metal, etc.

Surface property corresponds to the sounds that are made when bullets impact the surface or when the player character walks on it.

Appendix A.

File Sections sizes in bytes

File header section

File version Size
1 1, 2, 4, 5, 6 28
1 8 37
1 9 45

Texture properties section (minimumal size)

File version Size
1 1 0
2 2, 3 46
3 4 53
4 5, 6 61
5 6 65
6 8, 9

Appendix B

Version History:

0.7         
0.6
0.5 
0.4
Clone this wiki locally