struct s_colony is 272 bytes but colony record size is 361

Information, How-to's, and discussion about mod'ing Master of Orion II.
web5play
Posts:6
Joined:Sat Oct 08, 2011 4:01 am
struct s_colony is 272 bytes but colony record size is 361

Postby web5play » Tue Oct 11, 2011 8:39 am

I am looking at moomapgen http://code.google.com/p/moomapgen/.

the size of struct s_colony is 272 bytes but when I look at the saved game in a hex editor the size between colony records is 361. The colonies Offset is at 0x25d. I am using version 1.40.

why is there a difference in the struct s_colony in struct.h and data in the file?
does someone have a "newer" colony structure?

web5play
Posts:6
Joined:Sat Oct 08, 2011 4:01 am

packing and alingment issues

Postby web5play » Wed Oct 12, 2011 5:19 am

The small size is due the the fact the
struct Pop_Info has size 2 but in the file size 4

add
STRUCT_TYPE Pop_Info {
......
} __alignment__((__align__(4))) STRUCT_TYPE_END;

then just before producing[7]
there needs to be 5 bytes padding

char padding[5];
unsigned char producing[7];

Thanks openmoo2!!


Return to “Game Modifications”

Who is online

Users browsing this forum: No registered users and 28 guests