Page 1 of 1

Wrp files - unpacking data

Posted: 2006-11-14 19:47:26
by kate_arsher
Hello everybody

First, excuse me for my poor english.

I'm trying to extract data from wrp files, for making a viewer.
I don't succeed with the decompression of the data (cellflags, cellsound, ....).

you would have detailed documentation (or sources) for make this???

Thanks in advance!!!

Re: Wrp files - unpacking data

Posted: 2006-11-15 00:31:41
by Snake_Man
The WRP file formats are documented, I think the BIS wiki has them, then also ofpec should have them. If you cannot find, post again and I'll dig them up from my hdd somewhere.

Re: Wrp files - unpacking data

Posted: 2006-11-17 22:40:48
by kate_arsher
ok, finaly, i can use 4wvr and not oprw files.... But i've an other questions : if the size of each cells is 50mx50m, how opf can make differents detail levels?

I try to make a little viewer for wrp files.

Re: Wrp files - unpacking data

Posted: 2006-11-18 12:24:58
by fasad
For each higher terrain setting, OFP halves the terrain grid size (doubles the vertices). The engine interpolates the height of the additional data points, based on the cell they are in, adjacent cells, plus noise. I don't know of anybody working out what equation it uses though.
Cells with a slope less than a certain amount are always flat.

See the BI wiki:
http://community.bistudio.com/wiki/setTerrainGrid

This is from the "commented config" :

// Fractal and white noise random offset are added
// White noise generating more "wild" terrain
// Fractal tends to generate smooth, varied terrain

class Subdivision
{
// Fractal component of subdivision
// Changes are smaller for smaller rectangles

class Fractal
{
// Texture roughness factor

rougness = 10;

// Max. value for squares containing road

maxRoad = 0.2;

// Max. value for squares containing track

maxTrack = 1.0;

// Max. coefficient depending on slope

maxSlopeFactor = 0.05;
};

// White noise component of subdivision
// Change size is independent of rectangle size

class WhiteNoise
{
rougness = 5;

// Max. value for squares containing road

maxRoad = 0.1;

// Max. value for squares containing track

maxTrack = 0.5;

// Max. coeficient depending on slope

maxSlopeFactor = 0.025;
};

// Do not divide surfaces that are under given limit

minY = -0.0;

// Do not divide flat surfaces

minSlope = 0.02;
};
};


good luck : )