.CAM/.TRN/.TAC format

Terrain / Theater editing

Moderators: Lone Wolf, Snake Man

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

.CAM/.TRN/.TAC format

Post by lightning » 2009-02-09 14:46:43

Seems there's a lot of enthusiasm around cracking the .CAM/.TRN/.TAC file format. So here's the latest update:

I'm going at this completely blind.

What I have completed so far is:

1.) Deciphering and documenting the basic structure of the outer shell of the file -- essentially, the directory information (the location, names, and sizes of the embedded files within a .CAM/.TRN/.TAC file).
2.) Implementing the code to handle the compression/decompression scheme (LZSS) that Falcon uses on the embedded files
3.) Deciphering all of the embedded .CMP file -- this corresponds to all the information you see when you seleect the Campaign node on the left-side panel in TacEdit.
4.) Decoding the version information within the embedded .VER file (just a simple 2-byte uncompressed ASCII string, actually).

Here's the list of all the files buried within a non-Allied Force .CAM/.TRN/.TAC, along with their (compressed) sizes:
save0.cmp:4270
save0.obj:113514
save0.obd:10
save0.uni:41518
save0.tea:7866
save0.evt:90
save0.plt:2908
save0.pst:4
save0.wth:32805
save0.ver:2

And here's the same list, but this time, for an F4AF file:
save0.cmp:3933
save0.obj:145396
save0.obd:10
save0.uni:91702
save0.tea:7906
save0.evt:90
save0.plt:2908
save0.pst:4
save0.wth:32845
save0.ver:2
save0.te:49

Don't worry about the size differences, they are just differences in how the data compressed down.

The big glaring difference in the format so far seems to be the additional .TE file present in the AF format. This file is actually not even compressed, it's just plain old ASCII text:

Code: Select all

:Teams
1
:Team
1 25 25
:TeamName
USA
:TeamFlag
1
So that is no big deal there! And also good news is, the embedded .CMP file from the AF .CAM file format parses identically to the earlier non-AF versions. As you can see from the file list, there are still a handful of embedded files that I still need to parse out, so I'll keep you posted if there are any differences that come up when I deal with the other embedded files as soon as I get the chance to work on them.

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Re: .CAM/.TRN/.TAC format

Post by Sherlock » 2009-02-09 20:51:06

I just got a chubby reading this information. ;)

Lightning, outstanding work bro! Keep it up!
Sherlock
Victurous te Saluto

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-09 21:07:29

Another update: The .obj file format is now fully deciphered as well. I'll test with legacy and AF versions and report on any weirdness that I find. Hopefully none :) <crossing fingers>.

3 down, 7 to go: )

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-10 00:52:20

Found out the differences between F4AF and the other Falcon flavors, in the .OBJ file within a .CAM/.TRN/.TAC file -- F4AF adds 12 bytes just after the "campId" field, and just before the "lastRep" field. This implies that Lead Pursuit added some fields in the CampBaseClass that they wanted to serialize. But since F4AF reads the older .CAM format just fine, we should assume that we can update F4AF .CAM files by stripping those 12 bytes out of every record in the objective file, and then TacEdit should not puke on the file anymore.

Actually this would work no matter what changes I find between the two formats, as long as I can actually identify the changes properly. It would be a pretty easy tool to make (sort of a TacEdit converter to migrate newer F4AF files backward to where TacEdit can use them). Or if someone here has the source for TacEdit, they could just update it...

Anyway now I'm on to work on the other embedded files inside the .CAM files.

Polak
Captain
Posts: 188
Joined: 2004-01-01 23:01:01
Location: NEw York City

Re: .CAM/.TRN/.TAC format

Post by Polak » 2009-02-10 01:02:51

Or if someone here has the source for TacEdit, they could just update it...
That would be perhaps needed anyway to "make a room" for "te" file. Nice progress.

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-10 01:16:23

Polak wrote:
Or if someone here has the source for TacEdit, they could just update it...
That would be perhaps needed anyway to "make a room" for "te" file. Nice progress.
Not at all, the way the outer .CAM file is structured there's no need for the programmer to cram stuff in there. Of course if the programmer adds fields, older code that doesn't know about the change (like TacEdit) will break. The versioning in Falcon is pretty basic -- if you change the file format you update the version number and any old code is supposed to reject version numbers higher than it knows about. Terrible for backward compatibility but it's quick and it's easy so that's the way they did it. In our case it's pretty trivial to convert the newer files to the older format, though, then use the older tools to edit the files. No need to even convert them back to the newer format, F4AF will just accept them as being older files.

As for adding the .TE file that can be done with another tool outside of TacEdit. Just adding a file to the .CAM is very simple to do. And the .TE file is just text. AFAIK F4AF doesn't even really need this file or else the older formats would not work with F4AF.

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-10 04:20:13

Update -- .obd file (objective deltas) is now done as well. This is turning out to be child's play.

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Re: .CAM/.TRN/.TAC format

Post by Sherlock » 2009-02-10 14:35:09

lightning wrote:Found out the differences between F4AF and the other Falcon flavors, in the .OBJ file within a .CAM/.TRN/.TAC file -- F4AF adds 12 bytes just after the "campId" field, and just before the "lastRep" field. This implies that Lead Pursuit added some fields in the CampBaseClass that they wanted to serialize. But since F4AF reads the older .CAM format just fine, we should assume that we can update F4AF .CAM files by stripping those 12 bytes out of every record in the objective file, and then TacEdit should not puke on the file anymore.

Actually this would work no matter what changes I find between the two formats, as long as I can actually identify the changes properly. It would be a pretty easy tool to make (sort of a TacEdit converter to migrate newer F4AF files backward to where TacEdit can use them). Or if someone here has the source for TacEdit, they could just update it...

Anyway now I'm on to work on the other embedded files inside the .CAM files.
But the question is what do those extra 12 bytes after the "campid" field do? What function do they perform? After that question is answered (depending on what the answer is) we can move forward but I don't think it wise to just discard them without considering the question first. Also, what is "CampBaseClass" and what purpose does it serve? (if you know). And, if you could be so kind as to explain what 'serilaize' means? I don't understand that term in this context. Please bare with me, I am trying to "hang" with you on your explainations but I am a electrical engineer and not a coder. :)

Finally, can you post the file format information you have the deciphered files you have done so far (that you refer to above)?
Sherlock
Victurous te Saluto

Polak
Captain
Posts: 188
Joined: 2004-01-01 23:01:01
Location: NEw York City

Re: .CAM/.TRN/.TAC format

Post by Polak » 2009-02-10 15:45:37

I can only add some information link about what serialization means in computer science. Still, glad to learn something from it.
http://en.wikipedia.org/wiki/Serialization

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Re: .CAM/.TRN/.TAC format

Post by Sherlock » 2009-02-10 16:26:45

Polak wrote:I can only add some information link about what serialization means in computer science. Still, glad to learn something from it.
http://en.wikipedia.org/wiki/Serialization
Thanks for the link Polak. That helped me to understand serialization! Cheers!
Sherlock
Victurous te Saluto

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-10 17:22:24

sherlock wrote: But the question is what do those extra 12 bytes after the "campid" field do? What function do they perform? After that question is answered (depending on what the answer is) we can move forward but I don't think it wise to just discard them without considering the question first.
I've really no idea what those fields do yet. Let's assume for a moment that they do something interesting. Nice, but who cares? F4AF can read older formats that don't have those bytes in there, and does it change your flying experience? No. Think of it like this -- if you saved a Microsoft Word 2007 document in an earlier Microsoft Word format, sure, you'd be throwing away some information, but most of that is going to be information you didn't really care about in the first place. However you'd have achieved compatibility with someone running an older version of Word. In our case by discarding certain information from the F4AF format, we achieve compatibility with TacEdit.
sherlock wrote: Also, what is "CampBaseClass" and what purpose does it serve? (if you know).
Ok, first you'd have to understand the general concept of a class:

A "class" is basically a chunk of code that represents some sort of object (in the physical world, or in some abstract sense). For example, you could define a class called "Airplane", that provided some data (aka "properties", or "fields"), such as "Current airspeed", "Current altitude", "current heading", etc. that the programmer could read or write to in-memory. Classes can also provide behavior (aka "methods"). For example, one method on an Airplane class might be called "Turn", and another method might be called "Climb". Those methods would act upon and modify the data such as "Current altitude" and "current airspeed".

A class might also provide certain "utility" behavior, such as the ability to read or write that data to disk, in a certain format. That would be really nice because then the programmer who's using that class doesn't have to be concerned about the format of the data -- the class itself will handle that.

With that said, let's talk about serialization. Very easy concept here -- serialization, in plain English, is the process of "Writing to a file". Deserialization would be the reverse ("reading from a file").

Now let's talk about Falcon:
All the code classes in Falcon that represent campaign objectives and units, descend from one single "base" class, called "CampBaseClass". Common data elements (like "Location X/Y", object ID, etc.) belong to CampBaseClass. Therefore, every objective, and every unit, inherits those same properties, but each "child" class adds its own data and behavior in addition to the stuff that it inherits from "CampBaseClass".

Here's where it all comes together.

Anytime Falcon reads some piece of objective or unit data from a .CAM/.TRN/.TAC file, the data itself specifies the type of unit or objective that it represents. Falcon then knows which class to give the "raw" data to.

Each objective or unit class is then responsible for reassembling all its own raw data back into the proper structures in memory (i.e., deserializing it).

Now things get tricky.

Each class is only interested in its own data, not any data it inherited from a parent class. So, to work around this, during deserialization, each "child" class first hands the raw data off to its parent class, so that the parent class can deserialize *its* data. When the parent class is done reading its own data, the child class can then proceed with deserializing its own data. Of course, even a parent has parents. So, when a child class invokes its parent class to perform deserialization, the parent class invokes *its* parent, and so on. This process typically proceeds all the way back to the "Adam" class at the root of the inheritance tree. In Falcon, that class is "CampBaseClass". (Actually it goes a bit further, but it's not important for this discussion).

Now let's look at what happens if some parent class (or grandparent, etc.) reads TOO much data from the file. Assuming nothing breaks earlier on in the process, then, when control of the process utimately returns to the child class at the end, the file is positioned PAST the start of where that child class' data is supposed to begin. Sooner or later some child class is going to run past the end of the file, and bang, kablooey, an outright error will occur. Even if an error did not occur, the data in memory would still be corrupt...

The reverse situation is also possible, where a parent does not move the file far enough and so a child class ends up reading data that does not belong to itself. So, that's why the files contain version information.

The class can say "if it's version 21 or later, read 4 bytes for this field, or else don't try to read that field at all, it didn't exist till version 21".

What's happening in the case of the F4AF format is, you have an older tool, TacEdit, that doesn't know about any changes that were made to the format after about version (71-75, or so, maybe a tad later). So by stripping out any additional information from the files and then resetting the version number so it's consistent with the layout, TacEdit will work just fine on these. And F4AF won't puke on them either, coming back from TacEdit. F4AF will just silently re-upgrade them to the latest versions during the next save cycle. So you don't need a tool that goes in both directions, just a tool to migrate the newer formats backward.

Now the other alternative that I mentioned was to just add those extra bytes to TacEdit (assuming we have the source code for TacEdit somewhere...), even if we don't know their purpose. Or someone can write a whole new TacEdit...

Or someone here with some connections can inquire with some Lead Pursuit people and see if we can get the information on what was added to the .OBJ file (and the others) from, say, version 75 forward. We've got options :)
sherlock wrote: Finally, can you post the file format information you have the deciphered files you have done so far (that you refer to above)?
I will. My plan was to conquer the whole set of embedded files and then post all the details including some example C# code that can read and interpret all those files. As well, I will then describe the physical layouts in a bunch of Wiki entries that will be linked to off the .CAM/.TRN/.TAC entry. Though the code will probably be more instructive than the descriptions. There's quite a bit of branching in order to handle different versions of the files...

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Re: .CAM/.TRN/.TAC format

Post by Sherlock » 2009-02-10 18:02:59

lightning wrote:I've really no idea what those fields do yet. Let's assume for a moment that they do something interesting. Nice, but who cares? F4AF can read older formats that don't have those bytes in there, and does it change your flying experience? No. Think of it like this -- if you saved a Microsoft Word 2007 document in an earlier Microsoft Word format, sure, you'd be throwing away some information, but most of that is going to be information you didn't really care about in the first place. However you'd have achieved compatibility with someone running an older version of Word. In our case by discarding certain information from the F4AF format, we achieve compatibility with TacEdit.
I see your point and you make a good case. I am just concerned that LP programmed more functionality into the .cam file for their exe to use when running the sim. I just don't want to discard that functionality arbitrarily if it can be found out what it does. The existing TacEdit won't be able to address that "alleged" new functionality. BTW, I did find out that LPBrowse (F4Browse) cannot address the new cockpit field that was placed into the .VCD file by LP to specify which cockpit files to use in 3D. See viewtopic.php?f=25&t=21662
lightning wrote:...What's happening in the case of the F4AF format is, you have an older tool, TacEdit, that doesn't know about any changes that were made to the format after about version (71-75, or so, maybe a tad later). So by stripping out any additional information from the files and then resetting the version number so it's consistent with the layout, TacEdit will work just fine on these. And F4AF won't puke on them either, coming back from TacEdit. F4AF will just silently re-upgrade them to the latest versions during the next save cycle. So you don't need a tool that goes in both directions, just a tool to migrate the newer formats backward.

Now the other alternative that I mentioned was to just add those extra bytes to TacEdit (assuming we have the source code for TacEdit somewhere...), even if we don't know their purpose. Or someone can write a whole new TacEdit...

Or someone here with some connections can inquire with some Lead Pursuit people and see if we can get the information on what was added to the .OBJ file (and the others) from, say, version 75 forward. We've got options :)
Thank you for explaining that to me (and us here at PMC who are not coders). Brings back memories of a early undergrad classe I had on object oriented programming ;) And now I understand much more fully. :)

As I said above my only concern is that LP programmed in more functionality into the .cam file for their exe to use when running the sim.

As to the source code for TacEdit, I don't know. Julian "Codec" Onions was the coder who made most of the tools we use (including TacEdit) and he now works for Lead Pursuit. Someone out there in "Falcon Land" might have the TacEdit source code but I know I do not.

As to inquiring with LP, I doubt they will respond but ED_1 has been known to drop by here at PMC and be helpful with theater development issues. He (or someone else) just might read this and be forthcoming to fill in the missing information on what was added to the .OBJ file after version 75 of the .CAM file.

So in summary, I would say I agree that, baring the TacEdit sourcecode becoming available and/or LP stopping by to answer our questions, the best bet is writing a utility to "back version" the .cam file so that the existing TacEdit can deal with it, and also have the capaiblity to put it back to the AF Version 83/85 that AF runs now.
lightning wrote:I will. My plan was to conquer the whole set of embedded files and then post all the details including some example C# code that can read and interpret all those files. As well, I will then describe the physical layouts in a bunch of Wiki entries that will be linked to off the .CAM/.TRN/.TAC entry. Though the code will probably be more instructive than the descriptions. There's quite a bit of branching in order to handle different versions of the files...
Sweet. Sorry if I am appearing "pushy". I don't mean to. I'm just excited with the progress you are making because this is something that has been bugging me for over three years! :) Cheers and keep up the great work!
Sherlock
Victurous te Saluto

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-11 06:08:03

No worries, Sherlock :)

So here's the latest update -- I was busy decoding the unit file, but it turns out that to interpret that one properly, I also had to read in the entire class table file (the .ct file from the terrdata/objects folder). The reason I have to cross-reference the .ct file is because the .uni file just gives you the unit class IDs and you have no idea what type of unit that is, without cross-referencing the .ct file. Once you know what type of unit it is, you know how long its record in the .uni file will be, and how to interpret the fields properly.

No biggie, just one small extra step. So I knocked that one out, (the .ct file), everything matches up to what I see in F4Browse just fine so far. Right now, in the interest of expedience, I'm making a huge simplifying assumption (probably a false one) that the .ct file is the same for legacy F4 and for F4AF...and I just know one of you guys will correct that assumption for me, seeing as how I'm way outta my league on this (not a campaign guru by any means), and I haven't spent a moment testing the two versions .CT files against each other to verify anything...So, just to be cautious, do you guys know what the differences are, if any, between the .ct file in legacy F4 versus in F4AF? I can do some experimenting, but at the moment I'll just keep cranking forward since I'm on a roll here.

Anyway now that the .ct file is out of the way (at least for legacy Falcon versions), I can finish decoding the embedded .uni file from inside the .CAM files and move forward from there. Call the .uni file done at this point, it'll be finished tonight.

None of this is technically hard work so far, it's just really really really really really tedious...All the same, when it's all done and documented, someone owes me some friggin' beer ;) Damn I work cheap :)

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Re: .CAM/.TRN/.TAC format

Post by Sherlock » 2009-02-11 18:15:32

lightning wrote:No worries, Sherlock :)

So here's the latest update -- I was busy decoding the unit file, but it turns out that to interpret that one properly, I also had to read in the entire class table file (the .ct file from the terrdata/objects folder). The reason I have to cross-reference the .ct file is because the .uni file just gives you the unit class IDs and you have no idea what type of unit that is, without cross-referencing the .ct file. Once you know what type of unit it is, you know how long its record in the .uni file will be, and how to interpret the fields properly.

No biggie, just one small extra step. So I knocked that one out, (the .ct file), everything matches up to what I see in F4Browse just fine so far. Right now, in the interest of expedience, I'm making a huge simplifying assumption (probably a false one) that the .ct file is the same for legacy F4 and for F4AF...and I just know one of you guys will correct that assumption for me, seeing as how I'm way outta my league on this (not a campaign guru by any means), and I haven't spent a moment testing the two versions .CT files against each other to verify anything...So, just to be cautious, do you guys know what the differences are, if any, between the .ct file in legacy F4 versus in F4AF? I can do some experimenting, but at the moment I'll just keep cranking forward since I'm on a roll here.

Anyway now that the .ct file is out of the way (at least for legacy Falcon versions), I can finish decoding the embedded .uni file from inside the .CAM files and move forward from there. Call the .uni file done at this point, it'll be finished tonight.

None of this is technically hard work so far, it's just really really really really really tedious...All the same, when it's all done and documented, someone owes me some friggin' beer ;) Damn I work cheap :)
Where do you live? I'm up for buying ya the beer! :)

When you talk about the class table you are talking about classes that consist of Air vehicles, ground vehicles and sea vehicles, right? Then those classes have sub-classes that would things like projectile weapons (artillary, machines guns, etc), missiles (air-to-air, air-to-ground and ground-to-air), etc. ? Or do those classes mean something else entirely?
Sherlock
Victurous te Saluto

Polak
Captain
Posts: 188
Joined: 2004-01-01 23:01:01
Location: NEw York City

Re: .CAM/.TRN/.TAC format

Post by Polak » 2009-02-11 18:55:29

I am just watching this with my jaw down....

Man your knowledge about F4 mechanics is astonishing. It is not the hex editing here which counts , but your knowledgeable interpretation of how all those files work together. Its complex here for sure.

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-11 22:12:33

Sherlock wrote: Where do you live? I'm up for buying ya the beer!
I live in Chandler. Where in AZ are you?
Sherlock wrote: When you talk about the class table you are talking about classes that consist of Air vehicles, ground vehicles and sea vehicles, right? Then those classes have sub-classes that would things like projectile weapons (artillary, machines guns, etc), missiles (air-to-air, air-to-ground and ground-to-air), etc. ? Or do those classes mean something else entirely?
You got it, the class table basically consists of all the stuff you see in F4Browse. The heirarchy within the .CT database is a little different than how elements in the .UNI file get serialized, but very similar.

The actual code class hierarchy is:
---- Campaign (base class for all Campaign entities)
------ Unit (base class for all Unit entities)
----------AirUnit (base class for all air unit entities)
--------------Flight
--------------Squadron
--------------Package
----------GroundUnit (base class for all ground unit entities)
------------ Brigade
------------ Batallion
----------TaskForce (base class for sea entities)
------ Objective
---- Team
---- Sim (base class for sim entities )
------ Mover (base class for entities that move)
---------- Vehicle (base class for vehicle entities)
----------------Aircraft
----------------Ground
----------------Helicopter
---------- Weapon (base class for weapon entities)
----------------Bomb
------------------ Chaff
------------------ Debris
------------------ Flare
----------------Gun
----------------Missile
------ Static (base class for entities that do not move)
---------- Feature


Only the Units and descendents of Unit are in the .UNI file.

Polak
Captain
Posts: 188
Joined: 2004-01-01 23:01:01
Location: NEw York City

Re: .CAM/.TRN/.TAC format

Post by Polak » 2009-02-11 22:42:52

Ingenious and interesting indeed:

Sim, Team and Campaign seems to be in the root of everything else.
Is Sim parent of Campaign and Team?
Any correlation between them?
Team has no children?
That is that "te" introduced by F4AF, is it not?
Is this something planted for future use or you did not get there?

Back to the brush and tiles ..... :lol:

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-11 23:13:10

Polak wrote:Ingenious and interesting indeed:

Sim, Team and Campaign seems to be in the root of everything else.
Is Sim parent of Campaign and Team?
Any correlation between them?
Team has no children?
That is that "te" introduced by F4AF, is it not?
Is this something planted for future use or you did not get there?

Back to the brush and tiles ..... :lol:
Polak wrote: Sim, Team and Campaign seems to be in the root of everything else.
Correct.
Polak wrote: Is Sim parent of Campaign and Team?
No. Sim, Team, and Campaign are "siblings" (at the same level in the hierarchy).
Polak wrote: Any correlation between them?
Yes, they all descend from a common parent (FalconEntity), which in turn descends from VuEntity (the base class for all entities in Spectrum Holobyte's Virtual Universe engine). Other than that, no.
Polak wrote: Team has no children?
Correct. Team has no children.
Polak wrote: That is that "te" introduced by F4AF, is it not?
No. The ".tea" file inside the .CAM/.TRN/.TAC defines the teams. But the ".te" file in F4AF .CAM's specifies something further...I'm not really sure why that was a necessary addition, though.

Polak wrote: Is this something planted for future use or you did not get there?
Just answering Sherlock's question. For processing the Unit file properly I had to handle these scenarios:
----Unit
------ AirUnit
----------Flight
----------Squadron
----------Package
------ GroundUnit
----------Brigade
----------Batallion
------ TaskForce

I'll certainly have to handle the others as well as I make my way thru the rest of the .CAM file format.

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Re: .CAM/.TRN/.TAC format

Post by Sherlock » 2009-02-12 00:34:16

lightning wrote:
Sherlock wrote: Where do you live? I'm up for buying ya the beer!
I live in Chandler. Where in AZ are you?
Heck, we're practically neighbors! I live southeast of Tucson in a town called Sierra Vista. Next time I'm up in Phoenix (or you're near Sierra Vista) the beers are on me! Heck, I was just up in Phoenix last week. :o
Sherlock
Victurous te Saluto

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-12 01:43:47

Man, I was just down in Sierra Vista a few weeks ago. A buddy from Viperpits lives down that way and works on base. We should do a get-together.

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Re: .CAM/.TRN/.TAC format

Post by Sherlock » 2009-02-12 03:37:16

lightning wrote:Man, I was just down in Sierra Vista a few weeks ago. A buddy from Viperpits lives down that way and works on base. We should do a get-together.
Check your PMs.
What's your involvement with Viperpits? I stop by there occassionally as I hope to build a pit some day when I get back into a house and have a large enough area to build it and house it. Guess we better take this to PM since this thread is for .CAM/.TRN/.TAC discussion....
Sherlock
Victurous te Saluto

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-13 22:32:02

Update -- the unit file is decoded (Flight, Squadron, Package, Brigade, Battalion, and TaskForce). Next up, the .tea file (teams information).

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-14 00:13:21

Update -- the ".tea" file is decoded. 6 down, 4 to go.

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-14 09:31:44

Update - the ".plt" file is decoded. 7 down, 3 to go.

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-14 20:58:00

I've started documenting the embedded file formats on the Wiki. The .CMP embedded file format is now documented and is up on the Wiki. More to follow this weekend.

http://pmc.editing.wiki/doku.php?id=fal ... c:cmp_file

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-15 01:06:20

Added the following specs to the Wiki
.OBJ file (campaign objectives list)
.OBD file (campaign objective deltas)
.UNI file (campaign units list)

http://pmc.editing.wiki/doku.php?id=fal ... am_trn_tac

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-15 02:28:35

Added specs for the .TEA embedded file to the Wiki.
http://pmc.editing.wiki/doku.php?id=fal ... c:tea_file

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Re: .CAM/.TRN/.TAC format

Post by Sherlock » 2009-02-15 03:19:09

lightning wrote:Added specs for the .TEA embedded file to the Wiki.
http://pmc.editing.wiki/doku.php?id=fal ... c:tea_file
Go, lightning, go! :mrgreen:

(I think I feel another chubby coming on.... ;) )
Sherlock
Victurous te Saluto

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-15 07:38:52

Everything's now on the Wiki except the .WTH (weather) and .VC (victory conditions) files. I'll crack those tomorrow. I'll also post the LZSS compression/decompression algorithm. That does it for the .CAM/.TRN/.TAC format. Whatcha got for me next?

Polak
Captain
Posts: 188
Joined: 2004-01-01 23:01:01
Location: NEw York City

Re: .CAM/.TRN/.TAC format

Post by Polak » 2009-02-15 12:13:59

How do you know all about the "field labels"? That just by itself a lot of info. Still do you have any more insights what impact have various more important fields on the game? I am too noob here to appreciate properly what has been done here, but being around in some other circles I know what gem is to know all structure of the files.

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-15 17:31:58

TacEdit gives you 99% of that info anyway (field labels). Ask me about a specific field and I can trace back what it does in the sim. I haven't updated the description columns on any of the formats but the TacEdit help file pretty much covers most of that anyway.

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-15 19:56:04

I've posted some C# code containing an (obfuscated) implementation of the LZSS compression/decompression scheme used by Falcon.
http://pmc.editing.wiki/doku.php?id=fal ... ompression

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-17 07:15:40

Finished documenting everything on the Wiki over the weekend (up to version 71), and I am now working on uncovering the differences between v71 and the later versions.

I found a few differences so far. For example, there are 600 stores in v72+ Squadron records in the .UNI file versus just 220 in v69-v71. Also, basic unit data appears to be 2 bytes longer in v72+. Package records are a bit weird all unto themselves there's some sort of space-optimization scheme going on there that changed right at version 72...Most other things are still exactly the same size.

IDA Pro and HexRays along with the OpenFalcon .PDB debug symbols reveals much :)

derStef
Banned user
Posts: 696
Joined: 2007-11-14 00:22:45
Gaming Interests: Falcon 4.0
Editing Interests: Terrains
Location: Austria

Re: .CAM/.TRN/.TAC format

Post by derStef » 2009-02-17 13:08:31

dude, you are doing a great job here!

bring the light in! yeah!

cool stuff keep on doing!


regards
Stef

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Re: .CAM/.TRN/.TAC format

Post by Sherlock » 2009-02-17 14:22:19

lightning wrote:Finished documenting everything on the Wiki over the weekend (up to version 71), and I am now working on uncovering the differences between v71 and the later versions.

I found a few differences so far. For example, there are 600 stores in v72+ Squadron records in the .UNI file versus just 220 in v69-v71. Also, basic unit data appears to be 2 bytes longer in v72+. Package records are a bit weird all unto themselves there's some sort of space-optimization scheme going on there that changed right at version 72...Most other things are still exactly the same size.

IDA Pro and HexRays along with the OpenFalcon .PDB debug symbols reveals much :)
lightning,
I agree with derStef....you're doing a great job and it is much appreciated.

I'm especially interested in the differences between the AF version .CAMs (about version 81-83 I believe) and the older SP4.2 version .CAMS (about version 73 I believe). Those differences would explain why TacEdit won't work on the AF .CAMs but will on the SP4.2 .CAMS.
Sherlock
Victurous te Saluto

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-17 20:32:02

Before I spend a lot of time on this -- is there really a need to be able to back-rev the later versions to earlier versions or are we really just shooting for the ability to create these things automatically outside of TacEdit? Cuz if it's the latter, we're already there. In other words, do we really need to be able to extract info from the AF versions? Or can we just rebuild them from scratch as an earlier version (automated, of course)?

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Re: .CAM/.TRN/.TAC format

Post by Sherlock » 2009-02-17 21:53:41

lightning wrote:Before I spend a lot of time on this -- is there really a need to be able to back-rev the later versions to earlier versions or are we really just shooting for the ability to create these things automatically outside of TacEdit? Cuz if it's the latter, we're already there. In other words, do we really need to be able to extract info from the AF versions? Or can we just rebuild them from scratch as an earlier version (automated, of course)?
What makes the later AF versions different so that TacEdit will not work with them? Is it something special or is it just something mundane that isn't important? That's the question in mind that needs to be answered before I can answer your question. :)
Sherlock
Victurous te Saluto

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-17 22:40:23

For our purposes, assume it's fairly mundane.

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Re: .CAM/.TRN/.TAC format

Post by Sherlock » 2009-02-18 02:16:18

lightning wrote:For our purposes, assume it's fairly mundane.
Can you elaborate on why it's mundane? :) (Call me intensely curious... :mrgreen: )
Sherlock
Victurous te Saluto

lightning
Recruit
Posts: 38
Joined: 2008-11-17 23:23:45
Gaming Interests: ArmA 2 (Armed Assault 2)
Editing Interests: Terrains
Location: Chandler, AZ

Re: .CAM/.TRN/.TAC format

Post by lightning » 2009-02-18 04:28:54

Look at the specs I've documented for all previous versions. You'll see that the changes are generally not all that radical. Add a field here, expand the width of a field there, nothing earth-shattering.

Return to “Terrain / Theater”

Who is online

Users browsing this forum: ClaudeBot [Bot] and 0 guests