Friday, September 27, 2024

Addressing the parts of the mission segments

Missions must be divided into segments to handle different events according to the progression of the in game actions.



Mission1.dte mission segments are starts at offset 597F7.I arranged the data vertically and assigned a hex number starting from the first one(00 to 20).

If the columns marked in green are set to 1, that address becomes the starting point of the mission.

6603 indicates the data size and the function's starting address. However, we first need to adjust this address. To do so, we will reverse the number symmetrically, i.e., 6603 > 0366. After that, we need to multiply this number by 2 in hexadecimal, resulting in 0366 * 2 = 6CC.

In other words, the flow of mission 1 (starting at offset 47BF7) begins after a data size of 6CC from 47BF7.




When we count the 6CC data size starting from 47BF7;




The data we count using the 6CC size starts from the A8 data marked in orange. Here, the A8 indicates the size of the preceding data. The exact starting point of Mission1 is the A8 marker. However, right after this, 220E is added, meaning that before the mission starts, the objects need to be created. Therefore, the 220E section must be processed first.

When we examine the 22-0E section;

Here, the 0E line points to B009. When we reverse it symmetrically, it becomes 9B0. If we multiply this by 2 in hexadecimal, 9B0 * 2 = 1360. Now, let's count 1360 from 47BF7;



This brings us an offset where start exactly from 9C. As we can see here, codes like 2D012103 and other 21 03 entries are responsible for creating objects or flight groups and the music that plays at the start of the mission.


-----


We have now resolved the division and addressing of missions into their segments. Next, we still need to tackle the issue of triggers that I have not yet solved.