Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Development

Archive::Development Archive area for Development's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-11-2003, 11:55 AM
krich
Hill Giant
 
Join Date: May 2003
Location: The Great Northwest
Posts: 150
Default Quests...Memory Hog?

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:


Quote:
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:

Quote:
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?

Regards,

krich
Reply With Quote
  #2  
Old 06-11-2003, 07:12 PM
Trumpcard
Demi-God
 
Join Date: Jan 2002
Location: Charlotte, NC
Posts: 2,614
Default

Thats probably a great idea... 465k per quest????
__________________
Quitters never win, and winners never quit, but those who never win and never quit are idiots.
Reply With Quote
  #3  
Old 06-11-2003, 09:11 PM
Zern
Sarnak
 
Join Date: Nov 2002
Posts: 35
Default

Ouch .... would definitly say a good touch up is needed.
Reply With Quote
  #4  
Old 06-12-2003, 07:11 AM
krich
Hill Giant
 
Join Date: May 2003
Location: The Great Northwest
Posts: 150
Default

Alright...here's what I'm thinking of doing...hopefully its not over my head
(Keep in mind I'm slow and doing this in free time)

1) Document the grammar/intent of Wes' Quest Script Language (underway now)
2) Code up a parser to tokenize and grammar check the input files
3) Insert the new structures along side the existing until the new stuff works
4) Modify parser.cpp to use the new structures
5) Hopefully keep all functionality that existed before I started

Regards,

krich
Reply With Quote
  #5  
Old 06-12-2003, 07:18 AM
krich
Hill Giant
 
Join Date: May 2003
Location: The Great Northwest
Posts: 150
Default

Quote:
Originally Posted by Trumpcard
Thats probably a great idea... 465k per quest????
Yeah...no kidding. I noticed this when, on a whim to learn the new quest system, I decided to create a series of quest scripts for the first Ranger Epic. Zone was truncating my quest scripts because they were too long, so I went into the code to bump up the buffer for events and !!

I'll get it fixed...maybe...

Regards,

krich
Reply With Quote
  #6  
Old 06-21-2003, 08:00 AM
krich
Hill Giant
 
Join Date: May 2003
Location: The Great Northwest
Posts: 150
Default

MEMORY HOG UPDATE:

Alright folks, I'm about to finish up coding the changes to the data structures that handle the quests. I have made some wholesale changes to many parts of parser.cpp and parser.h. I'd like for someone to assist me in verifying this code before I get Trumpcard to look at it. PM me on #eqemu if interested (Nick = krich or Wany) My server is Ken's (Under Test) Linux Server.

The end result is as follows:

Old Code Results
Zone: freportw
Quest memory footprint*: ~8,500,000 bytes

New Code Results
Zone: freportw
Quest memory footprint*: ~291,000 bytes :mrgreen:

* Doesn't include overhead for Kaiyodo's linked list class

I'd say that's almost a 30 fold improvement in memory utilization. (as my 128Mb Linux server emits a sigh of relief...)

BTW, I decided to back off on the parser work...will take too much time. I'll just keep patching the existing code for now.

Regards,

krich
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 01:52 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3