Bsp to txt program help

Post here about Halo modding and related editing. For help go to the Help Desk forum above.
Post Reply
Talin64




Socialist

Posts: 213
Joined: Mon Jan 26, 2004 12:24 pm

Bsp to txt program help

Post by Talin64 »

Hello,
I am looking for a program to convert the first part of the .map file to a txt file. I know someone has written it already because I have a bloodgulch txt file. I want to use it to compare the bsp of halopc and haloxbox. Any Help would be appreciated.
Thanks Talin64
jimmsta





Posts: 240
Joined: Mon Oct 20, 2003 4:21 pm

Post by jimmsta »

derp... Um... just get yourself a hex editor, and open the map files, then select all the text, and copy it into a text editor... I'm not sure why you'd want to compare the bsp when it's completely different... BTW, I'm almost ready to begin to write a program to extract the tags from the maps, just so we can analyze them better...
zero_cool





Posts: 85
Joined: Sat Apr 17, 2004 10:11 pm

Post by zero_cool »

i think you mean you want it in floats, correct? if not then yea go with what jimmsta said, however if you do want it in floats i wrote a program a while back, it should be in the miscillanious files section.
AUSSIE_SPARTAN





Posts: 73
Joined: Mon Dec 15, 2003 2:47 am

Post by AUSSIE_SPARTAN »

Not sure if this is what you want but, open the cache in sparkedit, and go to "tools" then, save offset list. Hope that helps.
Gabs from files.halomods.com
Talin64




Socialist

Posts: 213
Joined: Mon Jan 26, 2004 12:24 pm

Post by Talin64 »

Jimmsta,
Can you give me a quick explantation about the differnce between pc bsps and xbox bsps. I figure a guy like you must have been around since the Beginning so you would know. :wink: I am trying to figure out if it is futile to try to bring in a map like death island to xbox.
bye, Talin64
jimmsta





Posts: 240
Joined: Mon Oct 20, 2003 4:21 pm

Post by jimmsta »

The major difference is that the PC bsp points to completely different files for all its resources.... let alone the fact that the PC version uses a bitmaps.map and sounds.map set of files. I believe the biggest problem is the map format version. the xbox version of halo uses version 05, while the PC version uses version 07. It is rumored that Halo2 uses version 06. The version number is not interchangeable between the two versions of the game. (Now 3 versions, with HaloCE). I think if someone (probably me) writes an app to extract the raw tag data out of the map files, we might have a chance to figure out all the differnces....

to sum up the above, the main problem is that the BSP's in haloPC are very large, larger than any bsp space we can get ahold of in the xbox maps, and the bsp data points to resources that are shared in separate files, which is really a technical bug.

In the future, it might be possible to swap between all the map versions, but without 100% working tag extractors and comparing of strings, we're not going anywhere...

Grenadiac, would you care to field this question?
Talin64




Socialist

Posts: 213
Joined: Mon Jan 26, 2004 12:24 pm

Post by Talin64 »

Hey Jimmsta,
Thanks, fot the info.
I took a look at Bloodgluch bsp section for haloxbox, halopc, and haloce.
It looked like the bsp sections were identical between pc and ce. When I looked at the meshes for pc versus xbox there were 78 meshes each but the pc version had extra points in some meshes. I think it would be possible to import a halo ce map over a halo xbox map but it would be a ton of work figuring out where everything goes and how to update it. correctly. I am going to take my time and try to figure it out.
bye, Talin64
jimmsta





Posts: 240
Joined: Mon Oct 20, 2003 4:21 pm

Post by jimmsta »

the PC version of bloodgulch is somewhat different than the xbox version. An area off to the side, where some people have launched ghosts off in the past was taken away on the PC/CE version. This is probably some of those *extra* points that you saw. I have a feeling that if someone would release a tutorial about reflexive offsets, in plain english, I'd be able to figure out how to make an xbox map rebuilder...
Talin64




Socialist

Posts: 213
Joined: Mon Jan 26, 2004 12:24 pm

Post by Talin64 »

Hello,
Here is a quick compilation of what iron forge had to say about reflexive offsets. By the way I think it is imprtant to note that the collision model of a regular model has the same structure as the terrain model.

meta is composed of reflexive offsets, reference offsets, meta data itself, and padding.

as such, we are going to look at meta from the perspective of the warthog. The warthog itself, is a vehicle, and it has a vehicle meta object. If you look at this object, there is acctually very little true meta data in it. It starts out as being around 4000 bytes, but if you ignore all the references (those are the things which point to other objects remember), and the reflexives (offsets which point to more meta), theres not many values left. Many of whats left are just 0's, and 0's are usually just padding, extra data, things you can ignore. ;o)
reflexive offsets are those offsets which point to somewhere further in the meta your editing. But you just duplicated your meta to a new location, and all those reflexives still point to the original object. What you need to do is find all the reflexive offsets in the meta your copying, its usually a simple time consuming tasks, as reflexives usually end in 40 or 41 (80 or 81 for xBox maps), same as all the other offsets people are (hopefully) familiar with using.
So you will have to take their value (easily obtained from your data inspector in Hex Workshop saving you the headaches of little/big endian conversion), subtract pesky magic, and then go to that offset. It (should) take you somewhere into the original object, usually near a reference tag. Make a mental note of where this is, and return to your duplicated meta. Once there, try to find the location that you just pointed to in the original meta, and get its offset. To this you will add magic, and then change that reflexive offset to this point.
That needs to be done for all of the reflexives, so that they now point to the correct locations in your newly duplicated meta instead of their old meta points. Once this is done, you've completely duplicated meta. All of the references can remain the same of course, since they do not depend on where the meta is to begin with.
jake07777




Wordewatician 250

Posts: 319
Joined: Mon May 17, 2004 7:42 pm
Location: At Your Front Door(knock)(knock)

Post by jake07777 »

I think he's right.
jimmsta





Posts: 240
Joined: Mon Oct 20, 2003 4:21 pm

Post by jimmsta »

well, what we need is to create a skeleton map, which does not include actual map data, but all the pointers and empty space that a real map has... that's all I'll say for now.
Grenadiac




Socialist Golden Age Magic Era Eureka
Tsunami Scorched Earth Articulatist 250

Posts: 390
Joined: Fri Sep 05, 2003 1:36 pm
Location: Tucson, AZ USA
Contact:

Post by Grenadiac »

I am *cough* looking into this in detail. My opinion is that converting the bsp is definitely possible, although very difficult. There are extra sections in the xbox version, and the order of the data sections is not the same. Another difference is that the xbox uses compressed vectors for some of the vertex data (some of it is still a mystery), whereas PC does not. I would say I understand the entire BSP from a high level, it's just a matter of decoding all the tiny details that we need to make it work. From what I have seen, we would need to modify the vertex data, the reflexives, the lightmaps, and the shaders. I've looked at about 20% of the BSP so far in detail and most of it looks very similar.

I've added some special functions to SparkEdit to convert the binary data to text you are talking about, but it is sort of hacked together right now. Once I get some time, I will make the implementation easier to use and maybe get it to some select people that are interested in working on this problem.
jimmsta





Posts: 240
Joined: Mon Oct 20, 2003 4:21 pm

Post by jimmsta »

My thoughts exactly... I'm rather sure that if we just reorganize all the data that we'd actually be getting somewhere... unless, of course, the xbe expects data to be placed in a specific place. Does it? (more like Do you know?)
Grenadiac




Socialist Golden Age Magic Era Eureka
Tsunami Scorched Earth Articulatist 250

Posts: 390
Joined: Fri Sep 05, 2003 1:36 pm
Location: Tucson, AZ USA
Contact:

Post by Grenadiac »

I don't know, I'm going to try modifying some unknown sections to see what happens to them if i partially destroy them. I doubt that the data has to be in a specific place, as long as the reflexives are correct. I will try to find out.
Talin64




Socialist

Posts: 213
Joined: Mon Jan 26, 2004 12:24 pm

Post by Talin64 »

Anything I can do?
I can turn the BG haloce file into a txt file with floats but it will take a while. As usual it seems like your way ahead of me. Do you think the bsp format is the same for collision models as it is for the terrain?.
Well let me know what your up too.
jimmsta





Posts: 240
Joined: Mon Oct 20, 2003 4:21 pm

Post by jimmsta »

Post Reply