User:Raphi/Entities (Boktai 1)
Very work in progress!
Entities is an umbrella term for all dynamic objects on a map (essentially, everything except the static tile data). This includes enemies, chests, doors, etc.
0x03004480 is maybe the start of an array of (pointer, flags)
pairs for each entity type? Zeroing out the pointers causes things to (not) happen.
Chests
s1* g_s1; // @ 0x03000108
struct s1 {
/* offset 0x24 */ chest* chest_list;
};
struct chest {
/* offset 0x14 */ chest_location* location;
/* offset 0x28 */ u32 callback_script_id;
/* offset 0x2c */ u32[?] callback_script_args;
/* offset 0xb8 */ chest* link_next;
};
struct chest_location {
/* offset 0x20 */ s16[3] position;
};
Small enemies
Does not include bosses, bats, and maybe some other things.
enemy_list* enemies; // @ 0x03001cc8
struct enemy_list {
enemy_list* next;
enemy* enemy;
};
struct enemy {
/* offset 0x5 */ unknown orientation;
/* offset 0x8 */ i16[3] position;
/* offset 0x4a */ unknown pathing_node;
/* offset 0x4b */ unknown pathing_timer;
/* offset 0x50 */ unknown* pathing_data;
/* offset 0x20a */ unknown hp;
/* offset 0x220 */ void* callback_data;
/* offset 0x5e8 */ void (*callback_fn)(void*);
};
callback_fn(callback_data) is called regularly - maybe once per frame? The call is at 0x08071544. Normal Boks update something in the enemy struct at 0x08073984.
Bats
Bat data starts at *(*0x030044c0 + 4). First is a 0x1c byte header, followed by 20 entries of size 0x260 each.
Note: Zeroing out 0x030044c0 disables many things (including small enemies and Carmilla), not just bats. So there's definitely more going on there.