Skip to content

RSB File Format

Alexander Evdokimov edited this page Aug 27, 2018 · 55 revisions

Unofficial RSB File Format description

Date: 2017.01 | Version: 0.8b

Glossary

GR - Ghost Recon,
GRE - Ghost Recon engine
RSB - Red Storm Bitmap

Links

  1. RSBtoBMP.1sc - convert RSB to BMP or needs 010 Editor.

Table of contents

1. Introduction

2. Overview

3. Sections

  3.1. File Header Section

  3.2. Image Data Section

  3.3. Texture properties

  3.4. Surface Property Channels data

4. Appendix A

5. Appendix B

Introduction

This document describes the structure of the RSB file format used by the GRE. The GR game RSB files are stored in "Texture" folder of the original game and have an extension of ".rsb".

Overview

The RSB is an image file used to store bitmap digital images. You can create the RSB files with an official developer plugin for Photoshop.

Overall file structure

The RSB file format is divided into three sections as shown in the RSB file structure.

Table 1. RSB file structure

Section Description
1 File Header Section File header
2 Image Data Section Image data
3 Surface Property Channels data section
4 Texture properties section texture (in-game) properties

Sections

File Header Section

The file header is 28..45 bytes long.

Table 2.0 File header structure
Length Type Description Value
4 integer File Version. 1,2,4,5,6,8,9
Texture size
4 integer Image Width 1..2048
4 integer Image Height 1..1024
if File Version > 7 (three more vars)
4 integer Unknown variable.
4 integer Unknown variable.
1 byte Unknown variable.
Bits information
4 integer Red bits 0, 5, 6, 8
4 integer Green bits 0, 5, 6, 8
4 integer Blue bits 0, 5, 6, 8
4 integer Alpha bits 0, 5, 6, 8
if File Version > 9 (two more vars)
4 integer Unknown variable.
4 integer Unknown variable.

The sizes of the textures you can use in the game.

Table 2.1 Available texture sizes
Texture size
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

Pixel Data Section

The RSB file image data stores in an array of pixels that are identical to RGB color mode ones. Red, Green, and Blue color components of the pixel are stored in RGB order (see RGB Bitmap formats ).

The pixel array is repeated by (Texture width)*(Texture height) times.

The pixel alpha bits are used for an alpha channel. It uses grayscale (0..255) information to represent transparent portions of the texture, which will become apparent when the texture is viewed in the game or lighting tool.

Table. RGB Bitmap formats
Section bits per pixel Description
1 R5G6B5 16 Red - 5 bit, Green - 6 bit, Blue - 5 bit
2 R8G8B8 24 Red - 8 bit, Green - 8 bit, Blue - 8 bit
3 A4R4G8B8 24 Alpha - 4, Red - 4 bit, Green - 8 bit, Blue - 8 bit
4 A8R8G8B8 32 Alpha - 8, Red - 8 bit, Green - 8 bit, Blue - 8 bit
Table 3.1 Pixel structure
Length Type Description Value
0..8 bit Red 0..255
0..8 bit Green 0..255
0..8 bit Blue 0..255
0..8 bit Alpha 0..255

Texture properties

Texture transparency.

Alpha Testing blends an RSB with an alpha channel by making all pixel shades between black and white completely transparent. Alpha testing is better then Alpha Blending for rendering because it does not need to be alpha sorted before it’s rendered. But alpha testing does not have the gradual blend that alpha blending does, its either 100% visible pixels or 100% transparent pixels. This does not work well for stuff like smoke, fire, and water, but does work well for fences, trees, signs, wheels, or anything that has a hard edge.

By selecting different functions in each parameter will affect how the texture will blend when its used in the game. Use combination of Source Function and Destination Function for the Alpha Blending and Compare Function for Alpha testing.

Animation.

An animation of the RSB file includes a flipbook animations in which the generated images are displayed one after the other and animations based on scrolling images in different directions. The first one type of animation needs at least two textures to work.

Texture game properties.

Table 4.7 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