Would you like to react to this message? Create an account in a few clicks or log in to continue.

Too much code...

Go down

Too much code... Empty Too much code...

Post by The Amethyst Dragon on Thu Feb 04, 2010 4:03 pm

Yesterday I started updating a bunch of scripts to speed up database reading/writing. I could do a simple find/replace of code through all the scripts I use, but I figured it'd be nice if I didn't mess up everyone's characters while I did it (so I have to be able to still pull from the older database files, then transfer the information into the newer system)...which means manually going through every script that might read or write from the database to do the updates.

Why? After 3 1/2 years, the database files are getting huge (which means there's some minor slowing of scripts that have to access those files). The ones just for keeping track of teleport/summon ally data is a combined 12 MB. The "general purpose database" files are currently stand at 997 MB. The newer method (NBDE, for those wondering) will cut down on that, while keeping the data and making database-accessing script run faster.

So far, I'm done up through the scripts that start with the letter D. Too much code... Icon_rolleyes

And I think I'm fixing a couple of bugs along the way. Smile

_________________
.
------------------------------------- The Amethyst Dragon -------------------------------------
Creator of Aenea | Custom Content Maker | Dungeon Master | Builder | Scripter | Writer | Player | Sleepless
The Amethyst Dragon
The Amethyst Dragon
Ludicrous Level
Ludicrous Level

. : Creator of Aenea / Dungeon Master
Male Number of posts : 7839
Age : 45
Location : probably on the computer or wrangling his offspring
NWN Username : amethystdragon
DM Name : The Amethyst Dragon
Time Zone : GMT - 6:00 (Wisconsin)
Registration date : 2008-06-02

http://www.amethyst-dragon.com/nwn

Back to top Go down

Too much code... Empty Re: Too much code...

Post by RustyDios on Thu Feb 04, 2010 4:38 pm

Hail The Amethyst Dragon ... ... was wondering the item storage device I created uses the bioware database functions to store what it can "across different modules" (should include PW server resets, but that is untested).. ... what is the newer [ NBDE ] method for databasing that you speak of above, and how is it faster ?....

Maybe a link for me to look into it myself ? .... ...
RustyDios
RustyDios
High Epic Level
High Epic Level

Male Number of posts : 2271
Age : 36
Location : England // Getting lost in Aenea
Main Character : Jay Braysin, The Wandering Shadow, Protector of Nektaria, Talon's Eternal Foe
Other Character : Shouri Braysin, The Shimmerstar's Moonlight Sorceress
Other Character. : Grace Fularras, Walking Library , Cleric of Mystara
Other Character.. : See my sig ... And here too ...
NWN Username : RustyDios
Time Zone : GMT (England, DST)
. : Too much code... Forum_donor
Registration date : 2008-07-28

Back to top Go down

Too much code... Empty Re: Too much code...

Post by The Amethyst Dragon on Thu Feb 04, 2010 5:00 pm

[NBDE] Natural Bioware Database Extension v1.0

It works by saving data as local variables (integers, strings, etc.) to a "database item" in a container in a hidden area of the module. Every once in a while (I've got it set to go every two minutes), it writes all the data to the database files by saving the "database item" itself...since this saves all the variables at the same time, it's actually very fast and easy (and cuts down on the size of database files that are created). The database info resides in memory, so the "read/write" done when scripts run is faster than reading/writing to the hard drive every time.

I can also tell it to write to the hard disk at any time if I really want information saved right away (like I do when subrace is set at character creation).

Seems to work just fine when I tested a small-scale use of this in-game, so hopefully I won't mess anything up badly when I move the module to the live server.

_________________
.
------------------------------------- The Amethyst Dragon -------------------------------------
Creator of Aenea | Custom Content Maker | Dungeon Master | Builder | Scripter | Writer | Player | Sleepless
The Amethyst Dragon
The Amethyst Dragon
Ludicrous Level
Ludicrous Level

. : Creator of Aenea / Dungeon Master
Male Number of posts : 7839
Age : 45
Location : probably on the computer or wrangling his offspring
NWN Username : amethystdragon
DM Name : The Amethyst Dragon
Time Zone : GMT - 6:00 (Wisconsin)
Registration date : 2008-06-02

http://www.amethyst-dragon.com/nwn

Back to top Go down

Too much code... Empty Re: Too much code...

Post by RustyDios on Thu Feb 04, 2010 6:05 pm

Cool... super fast response time from ye The Amethyst Dragon ... looking into this now, and seeing how to put it into the item storage device... hopefully make it quicker and less space consuming... not 100% sure it will work with what I'd done... but lets see... what if....
RustyDios
RustyDios
High Epic Level
High Epic Level

Male Number of posts : 2271
Age : 36
Location : England // Getting lost in Aenea
Main Character : Jay Braysin, The Wandering Shadow, Protector of Nektaria, Talon's Eternal Foe
Other Character : Shouri Braysin, The Shimmerstar's Moonlight Sorceress
Other Character. : Grace Fularras, Walking Library , Cleric of Mystara
Other Character.. : See my sig ... And here too ...
NWN Username : RustyDios
Time Zone : GMT (England, DST)
. : Too much code... Forum_donor
Registration date : 2008-07-28

Back to top Go down

Too much code... Empty Re: Too much code...

Post by daveyeisley on Thu Feb 04, 2010 6:09 pm

The Amethyst Dragon wrote:
And I think I'm fixing a couple of bugs along the way. Smile

Hoping for the best on this, and that it doesnt go the way of some of my
own 'improvement projects' on various things..... where I thought I was
making it better and..... well...... Kaboom.

"Yeah, dude.... when I transfer my old hard drive with win 2000 into
my new computer, its gonna be soooo much faster than the old
computer...."

Curse the hardware abstraction layer, I say.... curse it to death.
daveyeisley
daveyeisley
Ludicrous Level
Ludicrous Level

. : Dungeon Master
Male Number of posts : 6926
Age : 43
Location : Watching Aenea from my Inner Sanctum on the surface of Sharlo, Aenea's Silver Moon
Main Character : Dave's List of PCs
NWN Username : Dave Yeisley
DM Name : Dungeon Master Mythgar
Time Zone : GMT - 5:00
. : Too much code... Forum_donor
Registration date : 2008-06-03

Back to top Go down

Too much code... Empty Re: Too much code...

Post by RustyDios on Thu Feb 04, 2010 6:27 pm

3 1/2 years of aenea being on-line... I don't know the state of things on The Amethyst Dragon's end but I'll bet that there are hundreds of scripts and "things" that he could look at now and think "why did I go that long way round to do this...." and completely re-code for faster, better, cleaner, easier to manage and edit files.... I know just in myself that I've looked back over some of the things I created when I first started with the toolset and just "re-done in better ways".... .... and in comparison to Aenea and all it's goodies.. I haven't even scratched the surface of what CAN be done...


Still I'm with you dave, lets sit back and wait for that inevitable "Kaboom"... after all ... if it's not broke, why take it apart to fix it... And we all know that despite best intentions and triple checking of everything, something will likely go wrong.... NOT that I'm doubting The Amethyst Dragon 's abilities or anything (he is a NWN god in my book!) it's just the inevitable nature of the world... if something can go wrong, it will ...... ...... .....
RustyDios
RustyDios
High Epic Level
High Epic Level

Male Number of posts : 2271
Age : 36
Location : England // Getting lost in Aenea
Main Character : Jay Braysin, The Wandering Shadow, Protector of Nektaria, Talon's Eternal Foe
Other Character : Shouri Braysin, The Shimmerstar's Moonlight Sorceress
Other Character. : Grace Fularras, Walking Library , Cleric of Mystara
Other Character.. : See my sig ... And here too ...
NWN Username : RustyDios
Time Zone : GMT (England, DST)
. : Too much code... Forum_donor
Registration date : 2008-07-28

Back to top Go down

Too much code... Empty Re: Too much code...

Post by daveyeisley on Thu Feb 04, 2010 6:44 pm

Yeah thats basically what I mean... I know darn well The Amethyst Dragon is gonna be very careful as always to try and make things seemless and transparent to us.... I remember the changeover from teleport gloves to teleport slots.... and i was so worried about losing some of my stored locations... and all of that anxiety was for nothing.... I ran the conversion command and boom... everything was where it should have been.

If it can be done without a hitch, The Amethyst Dragon can and will do it..... but sometimes, that just aint possible... I just hope it is a case of the former.... and if it has to be the latter, that nothing major blows up.

In the end, when things get sorted, it will all be for the best regardless.
daveyeisley
daveyeisley
Ludicrous Level
Ludicrous Level

. : Dungeon Master
Male Number of posts : 6926
Age : 43
Location : Watching Aenea from my Inner Sanctum on the surface of Sharlo, Aenea's Silver Moon
Main Character : Dave's List of PCs
NWN Username : Dave Yeisley
DM Name : Dungeon Master Mythgar
Time Zone : GMT - 5:00
. : Too much code... Forum_donor
Registration date : 2008-06-03

Back to top Go down

Too much code... Empty Re: Too much code...

Post by The Amethyst Dragon on Thu Feb 04, 2010 8:08 pm

That's why I have more than one backup of the module (and the database), which I'll do again just before I move the updated module to the server. Smile

Although with the database, the old will still be there with all it's data if I need it.

_________________
.
------------------------------------- The Amethyst Dragon -------------------------------------
Creator of Aenea | Custom Content Maker | Dungeon Master | Builder | Scripter | Writer | Player | Sleepless
The Amethyst Dragon
The Amethyst Dragon
Ludicrous Level
Ludicrous Level

. : Creator of Aenea / Dungeon Master
Male Number of posts : 7839
Age : 45
Location : probably on the computer or wrangling his offspring
NWN Username : amethystdragon
DM Name : The Amethyst Dragon
Time Zone : GMT - 6:00 (Wisconsin)
Registration date : 2008-06-02

http://www.amethyst-dragon.com/nwn

Back to top Go down

Too much code... Empty Re: Too much code...

Post by MannyJabrielle on Fri Feb 05, 2010 12:31 pm

I've noticed that I've recently started getting exploration XP all over again for all areas with all my characters... this have anything to do with that? Found it kinda strange seeing new exploration for the inn and conjunction on everyone lol
MannyJabrielle
MannyJabrielle
Ludicrous Level
Ludicrous Level

. : Dungeon Master
Male Number of posts : 5927
Main Character : See the "A-Team" thread in the Biographies forum.
DM Name : Dungeon-Master Gaelen
Time Zone : GMT -5:00(EST)
Registration date : 2008-07-05

Back to top Go down

Too much code... Empty Re: Too much code...

Post by evilkittenofdoom on Fri Feb 05, 2010 12:36 pm

I noticed that too. Not that I mind though Too much code... Icon_biggrin
evilkittenofdoom
evilkittenofdoom
Epic Level
Epic Level

Male Number of posts : 1217
Age : 121
Location : Ready to Pounce at the Least Suspected Moment...
Main Character : Aseph, the NOT old sorcerer
Other Character : Analo, professional Dracolich (and other undead) hunter
Other Character. : Sivoran, the PC Demilich
Other Character.. : Imyna, Drow Priestess of Sorgath
NWN Username : evilkittenofdoom
Time Zone : EST (GMT-5)
Registration date : 2009-02-26

Back to top Go down

Too much code... Empty Re: Too much code...

Post by The Amethyst Dragon on Fri Feb 05, 2010 3:39 pm

MannyJabrielle wrote:I've noticed that I've recently started getting exploration XP all over again for all areas with all my characters... this have anything to do with that? Found it kinda strange seeing new exploration for the inn and conjunction on everyone lol
Yes, this is due to the new database (I started with that one, the simplest database info (and one sucking up vast amounts of database space) as my test case). When I switch, it'll also be taking out current quest journal entries and states, so all those quests (even that one with the prophesy about a great evil in a city of steel) will open up again for another run for everyone.

_________________
.
------------------------------------- The Amethyst Dragon -------------------------------------
Creator of Aenea | Custom Content Maker | Dungeon Master | Builder | Scripter | Writer | Player | Sleepless
The Amethyst Dragon
The Amethyst Dragon
Ludicrous Level
Ludicrous Level

. : Creator of Aenea / Dungeon Master
Male Number of posts : 7839
Age : 45
Location : probably on the computer or wrangling his offspring
NWN Username : amethystdragon
DM Name : The Amethyst Dragon
Time Zone : GMT - 6:00 (Wisconsin)
Registration date : 2008-06-02

http://www.amethyst-dragon.com/nwn

Back to top Go down

Too much code... Empty Re: Too much code...

Post by daveyeisley on Fri Feb 05, 2010 3:50 pm

The Amethyst Dragon wrote: When I switch, it'll also be taking out current quest journal entries and states, so all those quests (even that one with the prophesy about a great evil in a city of steel) will open up again for another run for everyone.

... the hotness. Too much code... Icon_cheers
daveyeisley
daveyeisley
Ludicrous Level
Ludicrous Level

. : Dungeon Master
Male Number of posts : 6926
Age : 43
Location : Watching Aenea from my Inner Sanctum on the surface of Sharlo, Aenea's Silver Moon
Main Character : Dave's List of PCs
NWN Username : Dave Yeisley
DM Name : Dungeon Master Mythgar
Time Zone : GMT - 5:00
. : Too much code... Forum_donor
Registration date : 2008-06-03

Back to top Go down

Too much code... Empty Re: Too much code...

Post by MannyJabrielle on Fri Feb 05, 2010 4:07 pm

EPIC WIN!
MannyJabrielle
MannyJabrielle
Ludicrous Level
Ludicrous Level

. : Dungeon Master
Male Number of posts : 5927
Main Character : See the "A-Team" thread in the Biographies forum.
DM Name : Dungeon-Master Gaelen
Time Zone : GMT -5:00(EST)
Registration date : 2008-07-05

Back to top Go down

Too much code... Empty Re: Too much code...

Post by evilkittenofdoom on Fri Feb 05, 2010 4:46 pm

I guess I better get on doing that quest for the first time while I have the chance to redo it Too much code... Icon_biggrin
evilkittenofdoom
evilkittenofdoom
Epic Level
Epic Level

Male Number of posts : 1217
Age : 121
Location : Ready to Pounce at the Least Suspected Moment...
Main Character : Aseph, the NOT old sorcerer
Other Character : Analo, professional Dracolich (and other undead) hunter
Other Character. : Sivoran, the PC Demilich
Other Character.. : Imyna, Drow Priestess of Sorgath
NWN Username : evilkittenofdoom
Time Zone : EST (GMT-5)
Registration date : 2009-02-26

Back to top Go down

Too much code... Empty Re: Too much code...

Post by RustyDios on Fri Feb 05, 2010 5:13 pm

The Amethyst Dragon wrote:Yes, this is due to the new database (I started with that one, the simplest database info (and one sucking up vast amounts of database space) as my test case). When I switch, it'll also be taking out current quest journal entries and states, so all those quests (even that one with the prophesy about a great evil in a city of steel) will open up again for another run for everyone.

When I first read this I thought it was brilliant.... then I remembered the tedious amount of click-dragging required for the food for a feast quest .... .... 5 PC's x ?? foodstuffs = bleeding fingers and sore wrist.... ... Smile Smile
Below is a spolier question about (that quest) ...

Spoiler:
Does this mean that you could also potentially get TWO Blades of Hope, if you currently hold one and do the item gathering again ?... Two blades vs. Gron... I wonder how that would work out for a duel-longsword weilder ...
RustyDios
RustyDios
High Epic Level
High Epic Level

Male Number of posts : 2271
Age : 36
Location : England // Getting lost in Aenea
Main Character : Jay Braysin, The Wandering Shadow, Protector of Nektaria, Talon's Eternal Foe
Other Character : Shouri Braysin, The Shimmerstar's Moonlight Sorceress
Other Character. : Grace Fularras, Walking Library , Cleric of Mystara
Other Character.. : See my sig ... And here too ...
NWN Username : RustyDios
Time Zone : GMT (England, DST)
. : Too much code... Forum_donor
Registration date : 2008-07-28

Back to top Go down

Too much code... Empty Re: Too much code...

Post by MannyJabrielle on Fri Feb 05, 2010 6:00 pm

Don't think so... The special place only makes one, and won't make a second if you have one in your inventory already.
MannyJabrielle
MannyJabrielle
Ludicrous Level
Ludicrous Level

. : Dungeon Master
Male Number of posts : 5927
Main Character : See the "A-Team" thread in the Biographies forum.
DM Name : Dungeon-Master Gaelen
Time Zone : GMT -5:00(EST)
Registration date : 2008-07-05

Back to top Go down

Too much code... Empty Re: Too much code...

Post by MannyJabrielle on Fri Feb 05, 2010 10:29 pm

Oooh, and a thought with the quest journals...

For the portals, any chance when they're redone, that a "update" could be added for when you successfully activate a code?

Most of the portal codes are pretty straight forward in their "clue", but a couple like the birthstone one... I gotta write that one down cuz I can't remember what stone goes to what month, making the journal entry itself is useless to me in-game.
MannyJabrielle
MannyJabrielle
Ludicrous Level
Ludicrous Level

. : Dungeon Master
Male Number of posts : 5927
Main Character : See the "A-Team" thread in the Biographies forum.
DM Name : Dungeon-Master Gaelen
Time Zone : GMT -5:00(EST)
Registration date : 2008-07-05

Back to top Go down

Too much code... Empty Re: Too much code...

Post by daveyeisley on Fri Feb 05, 2010 11:05 pm

MannyJabrielle wrote:Oooh, and a thought with the quest journals...

For the portals, any chance when they're redone, that a "update" could be added for when you successfully activate a code?

Most of the portal codes are pretty straight forward in their "clue", but a couple like the birthstone one... I gotta write that one down cuz I can't remember what stone goes to what month, making the journal entry itself is useless to me in-game.

This would be awesome.
daveyeisley
daveyeisley
Ludicrous Level
Ludicrous Level

. : Dungeon Master
Male Number of posts : 6926
Age : 43
Location : Watching Aenea from my Inner Sanctum on the surface of Sharlo, Aenea's Silver Moon
Main Character : Dave's List of PCs
NWN Username : Dave Yeisley
DM Name : Dungeon Master Mythgar
Time Zone : GMT - 5:00
. : Too much code... Forum_donor
Registration date : 2008-06-03

Back to top Go down

Too much code... Empty Re: Too much code...

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum