A Community discussion forum for Halo Custom Edition, Halo 2 Vista, Portal and Halo Machinima

Home  Search Register  Login Member ListRecent Posts
  
 
»Forums Index »Halo Custom Edition (Bungie/Gearbox) »Halo CE General Discussion »Old Blam or New Blam?

Author Topic: Old Blam or New Blam? (3 messages, Page 1 of 1)
Moderators: Dennis

sparky
Joined: Jun 27, 2009

Dismissal of Truth leaves one to believe lies


Posted: Apr 25, 2019 12:35 AM    Msg. 1 of 3       
I'm wanting to remake Halo's game engine in C, but I don't want the bugs or the main behavior of static pointers in the game. But changing anything like that would basically break compatibility with existing game files, unless I include a tag and map importer feature.

What I've determined to do is simply write the current file definitions first, then write my own new definitions with a better approach. Then I'll post both for community review.

I'm starting with the tag file definitions.
It's a work in progress.
Blam.h WIP: https://pastebin.com/WKdSb7hN

It's frustrating because I don't like how information is stored. Like with blocks, and padding, where you have something like this:
typedef struct
{
//const char* name;
//const uint32_t max_chunks;
//const uint32_t chunk_size;
uint32_t chunk_count;
uint32_t address;
uint32_t definition_address; // little endian
} block; // this approach is silly

typedef struct
{
char_integer region_index;
char_integer permutation_index;
char_integer node_index;
pad p1[1];
real_point_3d translation;
real_quaternion rotation;
} model_marker_instance_block;

typedef struct
{
string name;
short_integer magic_identifier;
pad p1[2];
pad p2[16];
block instances;
} model_markers_block;


What it should really be is simply something like this:
typedef struct
{
char_integer region_index;
char_integer permutation_index;
char_integer node_index;
real_point_3d translation;
real_quaternion rotation;
} model_marker_instance_block;

typedef struct
{
string name;
short_integer magic_identifier;
struct
{
size_t count;
model_marker_instance_block *blocks;
} instances;
} model_markers_block;


You don't need to store data offsets, unused bytes, and calculated static pointer addresses among the metadata!

Oh well. Let me know what you think of it so far.

EDIT 1: Also, C strings are lame. If we're using one-byte strings (which Halo uses for its "string" type), then we should use a simple struct like the aforementioned alteration.

typedef struct
{
size_t length;
unsigned char *text;
} string;


Edited by sparky on Apr 25, 2019 at 12:43 AM

EDIT 2: My mind is changed about the matter. With blocks and strings and padding and all the other things I think should be a certain way, I'm not going to do the literal definition approach. Sorry if this is not "definitive" in that way. I'm going to simply define the structs as the actual overwritten or used bytes, and, similarly with the other things, behavior will be handled in the implementation. That way, I don't have to redo separate definitions for myself, but I can simply toggle functional behavior with a variable's value and I can calculate or supply in the functions the different values. If I wanted to be fancy about it, although unnecessary, I could even use the different addresses of a supplied "build" of one of the HEK programs. That is unnecessary, though, because we're all using the same build of the HEK, every copy with the same static pointer addresses for block definitions.
Edited by sparky on Apr 25, 2019 at 10:37 AM

EDIT 3: Talking to myself in a new discord server. Fun times.

Edited by sparky on Apr 26, 2019 at 10:22 PM


BioGoji1989
Joined: Dec 24, 2017

Professional Idiot


Posted: Apr 28, 2019 01:58 PM    Msg. 2 of 3       
So... what capabilities do yo intend for this new version of Blam to have? Will it be capable of things found in later game engines but without the use of OpenSauce, or will it still require addition software such as OpenSauce to do things found in later game engines?


sparky
Joined: Jun 27, 2009

Dismissal of Truth leaves one to believe lies


Posted: Aug 11, 2019 08:55 AM    Msg. 3 of 3       
Thanks for the interest. See here for my project's information.

When it's done, one can add to it by simply adding to the source code. Lua scripting might be made available. Open sourcing and forking I don't like. Development is too fast to use a repo.

 

 
Previous Older Thread    Next newer Thread







Time: Sat August 24, 2019 7:32 PM 188 ms.
A Halo Maps Website