.OBJ Tags

General Mech2 related Developments go here. Discussions welcome!

Moderator: Skyfaller

Forum rules
If you are writing a guide please do not post it here! Post in the Dev FAQ section please.
User avatar
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

.OBJ Tags

Post by Col.Kell »

Skyfaller, I would like to bring back on topic the "OBJ tags".
I'm not sure if you know about my mods, but I replaced WTB files, I did not edit OBJ tags.

Could you point out to me what numbers in this screenshot are used to call out what WTB is used, the XYZ coordinates, and possibly team-side desposition? These would make modding more of a breeze and would have more capabilities.
hex.png
hex.png (8.38 KiB) Viewed 8658 times
Great things could be built from this knowlage, I'd be much obliged.

Thx.
MechWarrior 2: 31stCC
Image
User avatar
Sir MMPD Radick
Clan Nova Captain
Clan Nova Captain
Posts: 1625
Joined: Tue Jan 22, 2008 10:07 am

Re: .OBJ Tags

Post by Sir MMPD Radick »

I believe that he is gone still.
Besides, I think you should be able to answer that question with some trial and error. That is what I have been doing.
I have however been able to get different objects by replacing this part in the screen shot.
Whether it is right for mercs though is another question entirely.
Attachments
results.jpg
results.jpg (241.79 KiB) Viewed 8654 times
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
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: .OBJ Tags

Post by Col.Kell »

Gone? Is he at another confrence? :|

It looks like you are doing some heavy lifting, Radick, what hexeditor is this you are using? I don't remember XVI32 looking like that. Like you said, I did some trial-and-error guessing. I altered things on the GPS.d tag, and came up with stuff like different behavior in AI, what star a mech is assigned too, stuff like that. Kinda cool, I'd like to figure out how to change what insignia goes to what mech and change team desposition.

But thanks for the clue! I'll see what objects I can come up with.
MechWarrior 2: 31stCC
Image
User avatar
Sir MMPD Radick
Clan Nova Captain
Clan Nova Captain
Posts: 1625
Joined: Tue Jan 22, 2008 10:07 am

Re: .OBJ Tags

Post by Sir MMPD Radick »

I use 010 Editor v3.
Probably one of the best hex editors I have ever used. Excellent options available including the ability to make templates.
If I was smart I would template up the PRJ.
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
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: .OBJ Tags

Post by Col.Kell »

I'm using HexEdit version 3.2, it can create templates too, but it doesn't look nearly as flashy as what you are using ;) .
And BTW, that section of characters you highlighted, I edited those and it only changed what was left over after an object has been destroyed.

*Sigh*... Where's a Skyfaller when you need one...?
MechWarrior 2: 31stCC
Image
User avatar
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: .OBJ Tags

Post by Col.Kell »

P.S., funny discovery, I want you to go to the Wolf level "Scorching Sand", look and see if you think there are little people in black that fly in the air when you destroy the mobile command vehicle! :lol:
MechWarrior 2: 31stCC
Image
User avatar
Sir MMPD Radick
Clan Nova Captain
Clan Nova Captain
Posts: 1625
Joined: Tue Jan 22, 2008 10:07 am

Re: .OBJ Tags

Post by Sir MMPD Radick »

As i said for mercs it probably is different, for that section did something in mech2.
I have confirmed that it is indeed the object because i matched up the numbers it refers to, and it fits identically with what one would expect.

This discrepancy is one of the reasons why I am not porting it to mercs first as it would still have to be translated.
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
Col.Kell
House Steiner Archon
House Steiner Archon
Posts: 868
Joined: Sat Sep 27, 2008 7:44 am
Location: An Isolated Tennessee Valley.

Re: .OBJ Tags

Post by Col.Kell »

I am doing this in the 31cc PRJ. The section of characters you highlighted in pink, "E5 04", I just changed those and all it did was change the chunklet geometry, there was no change to the parent shape.
But I wonder if the characters before E5 04, such as "75 BC FE FF" or "08 D5 FF FF" have anything to do with the XYZ axis... I'll try that.

By the way, what would this thing called "templating" do for the PRJ? I've wondered why on earth I would do such a thing as to take the time to learn how to use it if I don't know what it does.
MechWarrior 2: 31stCC
Image
User avatar
Skyfaller
Clan 1st MechWarrior
Clan 1st MechWarrior
Posts: 1017
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: .OBJ Tags

Post by Skyfaller »

... Back!

Some of the tags in a BWD are covered in this thread, but let's talk this through on your example. The screenshot you posted identifies the file as GoldAre1.BWD from MW2:31stCC. The first 20 bytes do not belong to the file and can be ignored. MechVM should not have exported them, otherwise, that would be a bug. The file actually starts with BWD at offset 20, which identifies the file type. I'll treat that as the start of file for the rest of this post. At offset 4 we see the file size, AD8h=2776 bytes. This is Intel byte ordering, so the low byte is placed first. Any changes in length should probably be reflected here. The actual content starts at offset 34h, where it says MON. This is the first tag in the file. Each tag has a four-byte name followed by the tag's length (8 bytes in this case), followed by the tag's data (in this case, none). MON appears to paired with MOF at some later point, so these tags "contain" other tags. The next tag is BLK, with a length of 20h=32 bytes. It is also paired with an ENDB at a later point. I can't tell you much about the AFFL tag, but the OBJ tags are the ones you are looking for. The OBJ tags are quite large, 3Ch=60 bytes, and they contain 26 double-byte values. Double-byte values are usually called words. If I read this correctly, this OBJ tag references WTB file #907h in the POLY folder. Words 15, 17 and 19 define x, y, z translation, or the x, y, z coordinates where to place the object. In this case, the object is moved 63C6h=25542 units along the x axis, and 0 along the y and z axes. But there is a twist to this: objects may be placed relative to other objects. The second word gives the number of the OBJ tag to place the new object relative to. Well, as there are no other objects yet, we find a FFFFh here, which probably means the translation is relative to the coordinate system origin.

I know this is a little complicated, but the format was designed to shroud its contents. From what I've read, the original format was more like that used to define user-made missions in Mercs, but it the files were translated to binary form to protect its contents. However, using tags which store the tag's length is good file format design.
User avatar
Skyfaller
Clan 1st MechWarrior
Clan 1st MechWarrior
Posts: 1017
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: .OBJ Tags

Post by Skyfaller »

So much for reading BWD files for now ...

For editing these files, you want to change the number of the referenced WTB file. Placing objects relative to others is most useful for defining mechs, so for defining levels, you may want to set the second word to FFFFh. You can find out the number of the referenced WTB file using MechVM. MechVM prints the number of the WTB file in the left column when you browse game archives like NET.PRJ or MW2.PRJ. You may move the object using the values 15, 17 and 19, as explained above. I know this is tedious, but it's all I can offer atm.
Post Reply