krich
06-11-2003, 11:55 AM
I just realized just how much memory Quests take up...
They use about 465k (not counting the linked list overhead) per NPCType that has a quest file and if there is a "default" quest file, then it's 465k for EVERY NPCType! That would hurt my poor 128Mb server were I to put in all the quests published in the Quest forum.
The struct is as follows:
struct Events {
int index;
int npcid;
char event[100][100];
int line[65535];
char command[100][2048];
};
One could save memory by converting the event and command definitions into linked lists themselves, as such:
struct EventList {
char event[100]
char command[2048]
}
struct Events {
int npcid;
int line[65535]; //Anyone know what this is for?
MyList <EventList> MyEvents;
};
Or something like that... Thus reducing the memory footprint by only using memory when there is something to actually remember. The hard part is that this would require an overhaul of the quest code to use the new structs.
Comments, Ideas, Complaints? :wink:
Regards,
krich
They use about 465k (not counting the linked list overhead) per NPCType that has a quest file and if there is a "default" quest file, then it's 465k for EVERY NPCType! That would hurt my poor 128Mb server were I to put in all the quests published in the Quest forum.
The struct is as follows:
struct Events {
int index;
int npcid;
char event[100][100];
int line[65535];
char command[100][2048];
};
One could save memory by converting the event and command definitions into linked lists themselves, as such:
struct EventList {
char event[100]
char command[2048]
}
struct Events {
int npcid;
int line[65535]; //Anyone know what this is for?
MyList <EventList> MyEvents;
};
Or something like that... Thus reducing the memory footprint by only using memory when there is something to actually remember. The hard part is that this would require an overhaul of the quest code to use the new structs.
Comments, Ideas, Complaints? :wink:
Regards,
krich