Open Halo Parser: Demo

Moderator: Altimit01

User avatar
Modzy
Green Beret
Posts: 3056
Joined: Fri Feb 22, 2008 11:06 pm
Location: Portland, OR

Open Halo Parser: Demo

Post by Modzy » Fri Jan 15, 2010 8:22 pm

Not having anything to do during my winter break, I started writing classes for RB on map parsing. I'll have a link to the source of some of the classes. A few still need work, such as "Linked Maps," the driving force of map decompiling, memory loading, and compiling.
This demo of sorts contains the roots of my little project. It's basically a class for loading maps and pulling information from them without having to go back to the file itself, once loaded, of course. It also has a few universal methods and such which could be useful in other, non-Halo applications. An example of this is my basic "string reader." Will read strings without a set length, like those in map files. I know many programs do the same thing, but they also seem to set the stream backwards to read a character, this doesn't, making it a little faster.

Well, not much more to say, so here's a few examples of using it:

Loading a map:

Code: Select all

//f will be our folderitem, already having a file assigned to it.
Dim New_map As New Halo_map
New_map.load(f)
Once we've got our map loaded, we can pull any info we'd like from the tags or header and whatnot:

Code: Select all

\\Displaying a message box stating the SCNR's, or first tag in the map's, length
Msgbox Str(New_map.tags(0).length)
It's pretty much that easy to pull anything you need.
Download

User avatar
Altimit01
Eschaton Dev
Eschaton Dev
Posts: 2108
Joined: Sun Apr 15, 2007 7:43 pm

Re: Open Halo Parser: Demo

Post by Altimit01 » Sat Jan 16, 2010 12:09 pm

Not bad. Some good improvements on the basic map loading code. I'd quibble on a few of the variable names picked, particularly the temp variable tag_offsets but it works alright. Not very OO but I'm not sure how important that is to you.
Disclaimer: I am no longer active. Any posts, PMs or other communication I use has no guarantee of accuracy or follow up.
Download Eschaton: Mediafire

User avatar
Modzy
Green Beret
Posts: 3056
Joined: Fri Feb 22, 2008 11:06 pm
Location: Portland, OR

Re: Open Halo Parser: Demo

Post by Modzy » Sat Jan 16, 2010 4:10 pm

Yeah, I'll slim it down a bit more and remove as much of that stuff as I can before it's public. My main focus right now is the "Linked Maps." That should make advanced map editing like decompiling, adding tags and whatnot very easy, and early tests show it to be quite a bit faster than Eschaton's algorithms too. ;D

EDIT: Also, another thing I didn't include in this download are the mapped out tags classes. They work with Linked Maps to create new tags for maps. I'm not sure if I'll make those public anytime soon.

User avatar
Altimit01
Eschaton Dev
Eschaton Dev
Posts: 2108
Joined: Sun Apr 15, 2007 7:43 pm

Re: Open Halo Parser: Demo

Post by Altimit01 » Sat Jan 16, 2010 6:31 pm

I'm not sure I understand what you mean be linked maps. I see the same basic stuff where it's just a large collection of data all tied to one map. The only thing that seems like it might be faster is the tag length calculation. Unless you think there's some major speedups to be had in not having classes for the header and the like which might be true in RB I suppose. If you want really fast, you could just mass load everything for relevant sections and then lookup the data within memory blocks. One of the traditionally slowest parts of code are in the I/O.
Disclaimer: I am no longer active. Any posts, PMs or other communication I use has no guarantee of accuracy or follow up.
Download Eschaton: Mediafire

User avatar
Modzy
Green Beret
Posts: 3056
Joined: Fri Feb 22, 2008 11:06 pm
Location: Portland, OR

Re: Open Halo Parser: Demo

Post by Modzy » Sat Jan 16, 2010 6:48 pm

Oh I know, that's where most of the speedups I'm adding are.

User avatar
Altimit01
Eschaton Dev
Eschaton Dev
Posts: 2108
Joined: Sun Apr 15, 2007 7:43 pm

Re: Open Halo Parser: Demo

Post by Altimit01 » Sat Jan 16, 2010 6:54 pm

The C/C++ stuff I wrote doesn't even bother with streams. It was really interesting watching it do full map loads of the BSP quickly. It uses the older block read method from C.
Disclaimer: I am no longer active. Any posts, PMs or other communication I use has no guarantee of accuracy or follow up.
Download Eschaton: Mediafire

User avatar
Dirk Gently
Commando
Posts: 2047
Joined: Sun Oct 21, 2007 2:34 pm
Location: 3C0E9056
Contact:

Re: Open Halo Parser: Demo

Post by Dirk Gently » Mon Jan 18, 2010 7:12 am

RB fail, needs more C/Objective-C noob.

User avatar
Modzy
Green Beret
Posts: 3056
Joined: Fri Feb 22, 2008 11:06 pm
Location: Portland, OR

Re: Open Halo Parser: Demo

Post by Modzy » Mon Jan 18, 2010 10:08 am

Dirk Gently wrote:RB fail, needs more C/Objective-C noob.
:tongue:

User avatar
Altimit01
Eschaton Dev
Eschaton Dev
Posts: 2108
Joined: Sun Apr 15, 2007 7:43 pm

Re: Open Halo Parser: Demo

Post by Altimit01 » Mon Jan 18, 2010 10:46 am

I blame cloud who first gave me a crappy bit of HMT code converted to RB.
Disclaimer: I am no longer active. Any posts, PMs or other communication I use has no guarantee of accuracy or follow up.
Download Eschaton: Mediafire

User avatar
Dirk Gently
Commando
Posts: 2047
Joined: Sun Oct 21, 2007 2:34 pm
Location: 3C0E9056
Contact:

Re: Open Halo Parser: Demo

Post by Dirk Gently » Mon Jan 18, 2010 10:53 am

then lets dump the hate wagon on him :P

nil
Halo Moderator
Halo Moderator
Posts: 1083
Joined: Sat Jul 05, 2008 8:38 am
Location: null zone

Re: Open Halo Parser: Demo

Post by nil » Wed Jan 20, 2010 8:44 pm

Altimit01 wrote:If you want really fast, you could just mass load everything for relevant sections and then lookup the data within memory blocks. One of the traditionally slowest parts of code are in the I/O.
Hm. Yeah, now that I think about it, loading the map file (or whatever you need to) in memory makes sense. It's faster once loaded, and you can more easily or safely, implement features like saving and undo/redo.
I am no longer active to Halo or MGM, and don't guarantee a response on the forums or through email. I will however linger around the discord room for general chatting. It's been fun!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest