I believe you will suffer more reading and writing to an external database because you have said "My Shard is going crazy"..... (Juts to note on LOGS (These are not variables and don't use up memory)......
I would suggest removing the VARS in many cases you dont need to use variables as you have return and arguments with functions. If you already know the following forgive me and consider others browsing may find it useful to know how to reduce the VARLIST by removing some elsewhere
Lets take a real life example to demonstrate how you can turn any situation into variables arguements and functions as well as just for fun:
You just met a new girl and would like to have intimate relations with her in your own house. Though the whole event is dependant of 4 major factors.
1. You must remeber her name.
2. You must select a time when your wife isnt home.
3. You must phone and invite the the new girl around.
4. The girl must accept your invite.
To relate this to your problem, you currently have the following VARS
Code:
// Stuff we dont know
VAR.ChicksName=Unknown
VAR.AmIGettingLaid=0
//Stuff we do know
VAR.ChicksMobileNumber=12345678911
VAR.WhenShesOutDay=19
VAR.WhenShesGoesOutHour=15
VAR.WhenSheComesBackHour=24
The stuff we do know can be either tagged to an ITEMdef in game or added to a DEFNAME
Adding to a DEFNAME may use the same memory as a VAR but it is still a method for tidying up .VARLIST
Code:
[DEFNAME ExtraCurricularActivities]
ChicksMobileNumber=12345678911
WhenWifesOutDay=19
WhenWifesGoesOutHour=15
WhenWifeComesBackHour=24
That only leaves 2 Vars to render un-needed, now lets invent some functions for this scenario
Code:
[FUNCTION GetHerNameScam]
[FUNCTION PhoneChick]
[FUNCTION InviteChickAround]
[FUNCTION AmIGettingLaid]
//Lets rearrange this list into a sensible order of function.
[FUNCTION PhoneChick]
[FUNCTION GetHerNameScam]
[FUNCTION InviteChickAround]
[FUNCTION AmIGettingLaid]
//And again
[FUNCTION AmIGettingLaid]
[FUNCTION PhoneChick][FUNCTION GetHerNameScam][FUNCTION InviteChickAround]
You can almost read that now as;
"I am getting laid if I phone, get her name, invite her around when wife is out and she accepts".
Lets pretend this Chicks morality lies somewhere similiar to your own, and she will accept if you use her name to invite her. InviteChickAround Depends on GetHerNameScam which is fired when you PhoneChick. As there is no sphere commands for phoning DialConnect Hangup and Reply we will just make up as would be functions
So the whole thing will start with the command .PhoneChick and VAR.ChicksName and VAR.AmIGettingLaid will be completely gone.
Code:
[FUNCTION PhoneChick]
IF <DialConnect <EVAL ChicksMobileNumber>>
GetHerNameScam
ELSE
HangUp
ENDIF
[FUNCTION GetHerNameScam]
SAY Hello, hey ! how do you spell your name
DORAND 3
SAY I was going to send you an email
SAY I got you a card
SAY I have you a little present
ENDDO
IF !(STRMATCH(*<Reply>*, "remeber"))
// And Below is how you can elimate variables by stacking functions in arguements.
AmIGettingLaid <InviteChickAround <Reply>, <EVAL WhenWifesGoesOutDay>, <EVAL WhenWifesGoesOutHour>>
ENDIF
HangUp
[FUNCTION InviteChickAround]
SAY Hi <ARGV[0], would you like to come around on the <ARGV[1]>th at <EVAL <ARGV[2] + 1> hundred hours ?
IF !(STRMATCH(*<Reply>*, "no")) || !(STRMATCH(*<Reply>*, "cant")) || !(STRMATCH(*<Reply>*, "sorry"))
RETURN 0
ELSE
RETURN 1
ENDIF
[FUNCTION AmIGettingLaid]
IF <ARGS>
SAY Yes you are getting laid
ELSE
SAY No not this time
ENDIF