Placement Block

Discussion about modding Halo 3.
Post Reply
_Superaison





Posts: 4
Joined: Thu Apr 17, 2008 5:50 pm

Placement Block

Post by _Superaison »

Hello.


Placement Block.


I see this class I got from a friend*I hear its public*

Here is the section im wondering about.

Code: Select all

public class Placement_Block : Chunk //84 Bytes * 640 
    { 

        public enum BlockType : short 
        { 
            Player_Spawn = 9, 
            Reserved = 41, 
            Added = 131, 
            Original = 137, 
            Edited = 139, 
            NULL = 0, 
        } 

        public int Block_Type; //0 
        #region Unused Data 
        [Size(8)] 
        public byte[] Unused_4; //4 
        #endregion 
        public int Tags_Index; //12 
        public float X; //16 
        public float Y; //20 
        public float Z; //24 
        public float Yaw; //28 
        public float Pitch; //32 
        public float Roll; //36 
        public float Unknown_Rot_1; //40 
        public float Unknown_Rot_2; //44 
        public float Unknown_Rot_3; //48 
        #region Unused Data 
        [Size(8)] 
        public byte[] Unused_52; //52 
        #endregion 
        public byte Unknown_60; //60 
        public byte Unknown_61; //61    
        [Options(new string[] 
        { 
            "Unknown", 
            "Place At Start", 
            "Asymmetrical", 
            "Symmetrical", 
            #region Unused Flags 
            "Unused", 
            "Unused", 
            "Unused", 
            "Unused", 
            #endregion 
        })] 
        public Bitmask8 Flags; //62 
        public byte Team; //63 
        public byte Spare_Clips/Teleporter_Channel; //64 
        public byte Respawn_Time; //65 
        public short Unknown66; //66 
        #region Unused Data 
        [Size(16)] 
        public byte[] Unused_68; //68 
        #endregion 
    } 
How exactly is it reading these?

I hope I am doing this right, I probably aren't, Ive gotten everything so far on these parts right, except the placements.

How can I be reading from a float from 0000 if its always going to be 0000.

I found the placement header. For most of it I'm getting(big endian):


00290000FFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000


However, Does that mean that block is null? Or?

Because in other places I get:


00090000FFFFFFFFFFFFFFFFFFFFFFFF41AD458AC1AD4BBE3FCCD33E3F800000000000008000000000000000000000003F800000FFFFFFFFFFFFFFFF00200C00000000024100000000000000408000003F7FF100

So does that mean its just null in those places? Or am I completely off track?


What i'm wondering is these:
  • Does the placements start in random positions?
    Is there a pattern?
    How would the ID to a object be linked to the spawn?
    Is the ID in the placement chunk?
Any help is appreciated, this is what i'm stuck on a bit.


Thanks.
User avatar
mxrider108




Renovator Wordewatician 250

Posts: 456
Joined: Thu Jun 29, 2006 6:39 pm
Location: Cary, NC
Contact:

Post by mxrider108 »

Hey.

Yeah, that first block is null (it is a "reserved" spawn). The second block is a player spawn.

- Does the placements start in random positions? Is there a pattern?
The placement blocks start at a certain offset, then they just go one after the other with nothing in between.

- How would the ID to a object be linked to the spawn?
In the class above, it is the int "Tags_Index" 12 bytes into the position block which links the spawn to a particular ident. This int is really a pointer to a spot in the Tag Index, and it is calculated with this formula: Pointer = (offset in index - index start offset) / C [ <-That's divided by 12, but in hex ].

- Is the ID in the placement chunk?
Not exactly; as stated above the ident is not there in it's normal form - just a pointer to the ident in the tag index.

Hope this helps.
_Superaison





Posts: 4
Joined: Thu Apr 17, 2008 5:50 pm

Post by _Superaison »

Ah, that helps out a bit. Moar questions ftl!!

Alrighty. I'm still stuck on this ID.


So in johnson or w.e, I'll find the id of lets say, a warthog in..last resort?

I find it in 0x1A***,

So now, I find the ID in this area of hex.
BE3454073F78EE6EFFFFFFFFFFFFFFFF03FF0C08001E0000000000000000
00000000000000000000FFFF000000080034FFFFFFFF0054FFFFFFFFFFFF
0106FFFFFFFFFFFFE63804C20001010241A00000EB7E0A0800010106412
00000EA3008BA0000000441700000F48713110000000241C80000EC2
C0AB60000000241A00000F183100D000D0D1040000000EE850D0F000
F0F1040000000F1FD10870007070840000000F24710D1000404084000
0000F0B90F430006061040000000F1030F8D0002021040000000F07E0
F080010101040000000EF360DC00000000840000000F32411AE000000
1040000000F00D0E970000000840000000F5781402000303084000000
0F1430FCD0003030840000000F37411FE0001010840000000F2A0112A
The red is the idea, Could you also explain to me the block around that ID? Or am I going off track? It's a bit confusing right now, because this whole placement block thing. How would I find the placement block for that ID? Or is that the block?
User avatar
grimdoomer




System Engineer

Posts: 1440
Joined: Mon Oct 09, 2006 4:36 pm

Post by grimdoomer »

Each Tag has an identifier. The spawn data contains this ID, which matches to a tag in the map. Since each Entry could have X amount of spawns I would recomending using a List<>. To find all the placement blocks for the spawn you want to loop through all the spawns, while doing that loop through all the placement blocks too.

Code: Select all

for i loop through all the spawn blocks
    for x loop through all the placement blocks
            if x.Index = i then
                  spawns[i].PlacementBlocks.Add(placementblocks[x])
            end if
    next
next
Theres some suedo code.
Image
AI Zones in MP | Ambiance | Gravemind Beta v1.1
Aumaan Anubis wrote:Grimdoomer. The first person ever to mod Halo 2 Vista.
User avatar
kornman00




ONI New Age

Posts: 146
Joined: Fri Dec 12, 2003 6:30 pm
Contact:

Post by kornman00 »

Or you can just take the 32bit integer at 0xC in a placement block (your "spawn block") and use that as a indexer to the budget blocks (your "placement block") which has the tag index. Which ever floats your boat, or finds your lost remote.
User avatar
CompKronos




Wordewatician 250

Posts: 462
Joined: Mon Sep 03, 2007 6:45 am
Location: New Jersey

Post by CompKronos »

well in the interest of putting on my coat, i wanted to check that this is correct just to see if i understand the placement block. Well i have a usermap on foundry with a flamethrower and a machine gun turret placed. I used engineer to find the indent for the flamethrower, which gives me the offset: 0x1b5e4 so i get the 32 bit placement block tag identifier: 1c now i have the placement block:
0003 0000 FFFF FFFF FFFF FFFF
0000 001B C0A0 E31C 40C1 (etc etc)

finally one last thing int he white paper the first four bytes are unused in this case the 0003 but as others have probably noticed the player spawn is 0009 and the "reverse spawn" is 0029, and the machine gun turret placement block i believe also starts with 0003 so is it possible it identifies the type of object. Just wondering
Image
I <3 rant thread
Post Reply