Carnivores CE
Would you like to react to this message? Create an account in a few clicks or log in to continue.

File Format: Carnivores 2/IA RSC

2 posters

Go down

File Format: Carnivores 2/IA RSC Empty File Format: Carnivores 2/IA RSC

Post  RexHunter99 Thu Dec 04, 2008 1:54 pm

Thank you to machf for the original revision Smile
I've modified machf's revision because he did mix some stuff up, I also added in a small amount of extra info


The Carnivores 2/IA - .RSC files

Structure of the .RSC files:

These files are located in the HUNTDAT\AREAS subfolder both in Carnivores and in Carnivores 2 and Ice Age and they complement the .map files, and the format used in the former is only slightly different from the one used in the other two. The files consist of several blocks, starting with a header block which is 32 bytes long for Carn1 and 80 bytes long both for Carn2 and CarnIce. Other differences between Carn1 and Carn2/IA are that Carn1 only stores a single sky bitmap, while Carn2/IA use 3 ones, one each for dawn, day and night time; and that Carn2/IA .rsc files have a block of water data added at the end.

The exact format of the objects block needs still to be determined. While textures are pretty much straightforward (as many 128x128 pixels, 16-bit bitmaps one after the other, as many of them as the header value indicates), 3-D objects are more complicated. First there's data of the points and triangles which conform the object (they vary in number depending on it), and then comes a 16-bit bitmap which is always 256 pixels wide but may vary in height as well depending on the object, for as many objects as the header indicates. After that, the rest of the file consists again of blocks which are pretty straightforward: the sky, which is a 256x256 pixels, 16-bit bitmap (3 consecutive ones in Carn2/IA), then the fog bitmap, in 128x128 pixels and 8-bit grayscale, then the number of different fogs for the map and the corresponding data for each one of them (the fog color, its height, density, minimum distance and wether it's poisonous or not), then the number of random sounds on the map followed for the length and data chunk for each one, then similarly the number of ambient sounds and the length and data for each one, and finally a table indicating which randdom sounds are utilized and how. I still need to determine the exact format of the object blocks so I can 'fill the gap' and extract the rest of the info from the .rsc files past the textures (which is the reason currently I've only released a textures viewer, I can't get past that yet). Thanks to Austin Wolfclaw, who mentioned how to extract sounds from the .car files, and to some further checking, I've determined that the sounds are stored in 16-bit mono PCM format, at 22050 Hz, and could be easily played back or exported to .WAV format.

Data types used: (Based on C/C++)

* unsigned char: 1 byte, 0...255
* unsigned int: 2 bytes, LSB->MSB, 0...65535
* signed short: 2 bytes, LSB->MSB, -32768...32767
* signed long: 4 bytes, LSB->MSB, -2147483648...2147483647
* float: 4 bytes, LSB->MSB (IEEE single-precision floating point format)


For Carnivores 2 and Ice Age:

Header block:
Code:
long num_textures (number of textures)
long num_objects (number of objects)
long dawn_scn_bg_R (dawn scene background, red component)
long dawn_scn_bg_G (dawn scene background, green component)
long dawn_scn_bg_B (dawn scene background, blue component)
long day_scn_bg_R (day scene background, red component)
long day_scn_bg_G (day scene background, green component)
long day_scn_bg_B (day scene background, blue component)
long night_scn_bg_R (night scene background, red component)
long night_scn_bg_G (night scene background, green component)
long night_scn_bg_B (night scene background, blue component)
long unknown_dawn_R (unknown)
long unknown_dawn_G (unknown)
long unknown_dawn_B (unknown)
long unknown_day_R (unknown)
long unknown_day_G (unknown)
long unknown_day_B (unknown)
long unknown_night_R (unknown)
long unknown_night_G (unknown)
long unknown_night_B (unknown)

Textures Block:
Code:
unsigned int texture1[128,128] (texture #1 bitmap)
unsigned int texture2[128,128] (texture #2 bitmap)
... etc.
RexHunter99
RexHunter99
CCET Programmer
CCET Programmer

Male Number of posts : 268
Age : 32
Location : Australia
Reputation : 3
Registration date : 2008-11-28

Dinosaur
Name: James
Health:
File Format: Carnivores 2/IA RSC Left_bar_bleue100/100File Format: Carnivores 2/IA RSC Empty_bar_bleue  (100/100)
Species: Velociraptor

Back to top Go down

File Format: Carnivores 2/IA RSC Empty Re: File Format: Carnivores 2/IA RSC

Post  MR.X Fri Feb 06, 2009 3:25 am

I've been testing the sounds in the RSC files and have found out it is impossible to import music because the Ambient even with all of the required sound specs for the file it gives me a subchunks error.

Edit: I got one Music file to import but the volume had to be very low for the RSC editor to load it. However even though it loaded. It did not play when I clicked save sound. I then saved the map making sure to back up the previous one as I knew something might be wrong. When the game tried to load the map the renderer crashed on loading. This means that it is impossible to Import music into an RSC file even if it is given the Technical Specifications listed above. In other words don't do what I did. (or at least until I check the random Ambient noises.)
MR.X
MR.X
Dimetrodon
Dimetrodon

Male Number of posts : 42
Age : 33
Location : Bloomington, Indiana, USA. Home of Indiana University
Reputation : 3
Registration date : 2008-12-03

Dinosaur
Name: Justin AKA Glisp
Health:
File Format: Carnivores 2/IA RSC Left_bar_bleue100/100File Format: Carnivores 2/IA RSC Empty_bar_bleue  (100/100)
Species: Spinosaurus

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum