Proposed mech config file format

MechVM - A MechWarrior 2 remake.

Moderator: Skyfaller

Post Reply
User avatar
Skyfaller
Clan 1st MechWarrior
Clan 1st MechWarrior
Posts: 1017
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Proposed mech config file format

Post by Skyfaller »

This is a draft, so I will edit this first post as needed. Please quote any parts of this if commenting.

The mech config file is supposed to store a mech loadout as used in the table-top game. It is intended to be extendable. A binary format has been chosen for speed of loading and to reduce parsing. The file is split into markers. Each marker starts with a 16-bit value describing the marker length, followed by the 4-byte marker name, and finally the data.

The general file layout starts with a file content marker, which contains a 2-byte version number, the file length, and the zero-terminated file type name "MechVM Mech Config". The next markers give general information on the mech: mech tonnage, engine type and rating, heat sink type and count, jump jet count. Then there is a marker for each mech section, giving the internal structure, front and rear armor, and critical sections referring to weapons and equipment by number. Finally, there is a marker for each weapon, referencing weapon and ammo critical sections and flags. The flags store whether the weapon is front or rear-firing, whether it is hooked up to a targetting computer or similar equipment, and weapon groups. Markers storing user-defined config names and text descriptions are optional.

I still have to research how to adapt the file for vehicles, aerofighters and battleships.
User avatar
Skyfaller
Clan 1st MechWarrior
Clan 1st MechWarrior
Posts: 1017
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: Proposed mech config file format

Post by Skyfaller »

The file format could be called .MCF for mech config file. Additional markers could be used to include the mech limbs. Storing this information with the configuration allows for geometry specific for the configuration. This is useful to have one configuration with an LRM-20 in an arm, and another configuration with a laser to have different geometry. Another marker stores references to texture files.

If markers were numbered instead of named, one could make the assumption that markers are sorted in the file from low to high markers, allowing loaders to stop loading once they find a marker that is unknown. Therefore, a ffFFffFF marker would end the file.
User avatar
Sir MMPD Radick
Clan Nova Captain
Clan Nova Captain
Posts: 1625
Joined: Tue Jan 22, 2008 10:07 am

Re: Proposed mech config file format

Post by Sir MMPD Radick »

Well, I do not have much input on this subject this time around, but I would note that .MCF is used for video files. Rare it may be, but it is used.
I would suggest maybe .M3K or maybe just a .mech.

On the subject however, could you clarify please what you mean by different gemoetry? Are you suggesting that weapons mounted on different parts of the mech would have different shapes? AKA Starsiege.
James 3:5-10: My Reminder
And the tongue is a fire, a world of iniquity: so is the tongue among our members, that it defileth the whole body. Out of the same mouth proceedeth blessing and cursing. My brethren, these things ought not so to be.
User avatar
Skyfaller
Clan 1st MechWarrior
Clan 1st MechWarrior
Posts: 1017
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: Proposed mech config file format

Post by Skyfaller »

For the previous XML format, it has proven to be tedious to get parsing right, and the parsing will always be slow. Therefore I am considering a binary format. The previous format used the .MVMK extension. Perhaps I should just stick with the .MVMK extension, but your suggestions sound nice, too.

Each limb's geometry is currently stored in a .OBJ file. I want the config file to reference that information, so that each config may reference different .OBJ files. Yes, the reason is to support visualization of different loadouts.
User avatar
Sir MMPD Radick
Clan Nova Captain
Clan Nova Captain
Posts: 1625
Joined: Tue Jan 22, 2008 10:07 am

Re: Proposed mech config file format

Post by Sir MMPD Radick »

interesting I like that idea! I do not think any Mech game has done that yet.
James 3:5-10: My Reminder
And the tongue is a fire, a world of iniquity: so is the tongue among our members, that it defileth the whole body. Out of the same mouth proceedeth blessing and cursing. My brethren, these things ought not so to be.
User avatar
Skyfaller
Clan 1st MechWarrior
Clan 1st MechWarrior
Posts: 1017
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: Proposed mech config file format

Post by Skyfaller »

Thanks, but I can't take credit for it. Mektek is planning on doing this, or already supports it for the Turkina mech at least.

Also, I think I remember a similar feature in AssaultTech1.
Post Reply