View previous topic :: View next topic |
Author |
Message |
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Tue Feb 01, 2005 23:05 Post subject: Resource Manager Plugin |
|
|
Development update:
Based on the NWNX Scripter proof of concept plugin, I began work on the NWNX Resource Manager plugin a couple of days ago. The scope of this plugins is a bit broader than the original idea of offering a way to run scripts that are loaded from external storage space, not from inside a module.
In the current development stage I have a plugin that can replace any script in the module with an external script. Tests with chapter1 of the official campaign revealed no problems so far (except one thing: you need to make sure that a script does not exist in the module and in the external repository at the same time).
Provisions have been made to make sure that other resources besides scripts can be loaded. As it turned out, loading scripts is one of the easier tasks, since the server does not ask for much more than a name and a pointer to the script byte code in memory. Items, placeables, and a lot of other resource types require a more elaborate structure in memory and will have to be worked out in the future. This means that it MAY be possible to load these resource types externally, not that it definitely will be possible. The resource manager plugin is just the foundation for these.
I have kind of worked myself up over this the last weekend, so I have run a bit out of energy for now. The source and a pre-compiled DLL will be released coming next weekend - please be patient for now _________________ Papillon |
|
Back to top |
|
|
DarkstarsDad
Joined: 17 Jan 2005 Posts: 59 Location: Overland Park, Kansas USA
|
Posted: Tue Feb 01, 2005 23:25 Post subject: Patient |
|
|
I Believe you have done more developement of new functions since You started this board then we could have asked for. think you deserve a trip to the riviera or something . _________________ Just because you think you can't. Is the best reason to try it anyway. |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Thu Feb 10, 2005 21:34 Post subject: |
|
|
Here is something to play around with:
http://nwnx.org/fileadmin/user_upload/nwnx_resman_001.zip
This version can replace any script with an external script. If NWN can not find the script in the module, NWNX Resource Manager tries to load it from a directory. The nice thing about this is that you do not need the ! character anymore to denote external scripts, which makes it possible to have external scripts in e.g. module or creature events.
Please post your feedback here. _________________ Papillon |
|
Back to top |
|
|
Blacksting
Joined: 03 Jan 2005 Posts: 107
|
Posted: Fri Feb 11, 2005 2:43 Post subject: |
|
|
What is the script size limit? |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Fri Feb 11, 2005 9:01 Post subject: |
|
|
200K _________________ Papillon |
|
Back to top |
|
|
Blacksting
Joined: 03 Jan 2005 Posts: 107
|
Posted: Fri Feb 11, 2005 20:24 Post subject: |
|
|
grrrrrrr..... I have a script that is nearing 260 that I want to use this on |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sat Feb 12, 2005 17:47 Post subject: |
|
|
W00t ! I really like it when things turn out the way I originally envisioned them (even if it takes much longer than I thought)
The Resource Manager v0.0.2 can now load many more types of resources from an external directory (I tried Items, Placeables, Creatures, Scripts, and a Dialog).
A possible way of developing with the Resource Manager would be:
1) You start with a normal module (mymod.mod) and make two copies of it: mymod-stub.mod and mymod-work.mod
2) Open mymod-stub.mod and remove all resources you want dynamically loaded from it (e.g. *.ncs, *.dlg).
3) Open mymod-work.mod with the Toolset. As a side effect, this will unpack the module to the directory modules\temp0 from where the Resource Manager will loads its resources.
4) Load NWNX and load the mymod-stub module into the server.
5) Now you can start to modify stuff in the toolset and the changes will show up instantly on the server.
Possible uses of this for development include:
* Modifying and testing scripts without one of the most annoying cycles in computer history: modify script - compile - save - restart server - restart module - login - jump to location - trigger script - examine problem - modify script - compile ..... (heh, you try THAT with an Avlis module at 80-100 MB).
* Online modification and testing of dialogs
* Balancing of creatures against some enemy
* ... and possibly countless of other uses.
http://nwnx.org/fileadmin/user_upload/nwnx_resman_002.zip
PS: and especially for Blacksting: Resource limit is now at 512 K _________________ Papillon |
|
Back to top |
|
|
Lanthar D'Alton
Joined: 10 Feb 2005 Posts: 100
|
Posted: Sun Feb 13, 2005 0:23 Post subject: What kind of lag time does this typically involve in calls? |
|
|
I'm thinking I could make the much of the speech system reside in a separate mod entirely, allowing for quick and easy alteration of commands and stuff.
Also, I take it that it loads them on the fly every time? Does that mean no caching? What if the script is marked for caching in the stub mod?
If it loads them on the fly every time, that's probably not fast enough for speech system which runs once a second minimum... but some testing could be done. I do keep the main script that runs it cached, so that helps a lot.
-Lanthar |
|
Back to top |
|
|
Blacksting
Joined: 03 Jan 2005 Posts: 107
|
Posted: Sun Feb 13, 2005 0:35 Post subject: |
|
|
isilweo hooking the execute queue will negate your Speech check routine Lanthar. As soon as he lets us have it the speech plugin will be able to fire the parsing script only when it receives something. Checking loops will no longer be necessary. So not having it cached and available to the Resource Plugin would be an easier call. |
|
Back to top |
|
|
Alosynth
Joined: 06 Jan 2005 Posts: 24
|
Posted: Sun Feb 13, 2005 2:45 Post subject: |
|
|
I tested the latest version of this using NESS (a creature spawning system). I put the resref of a creature not part of the module into the spawning waypoint then put the creatures template into my external folder and low and behold, the creature spawned as it should. Thanks for the update Papillion.
One feature I would like to see though (if its possible) would be the ability to to specify a specific subfolder based on the type of resource you are looking for in nwnx.ini. This way I could have a folder for scripts, a seperate folder for creatures, a seperate folder for items etc. |
|
Back to top |
|
|
DarkstarsDad
Joined: 17 Jan 2005 Posts: 59 Location: Overland Park, Kansas USA
|
Posted: Sun Feb 13, 2005 5:43 Post subject: Papillon resting? |
|
|
Papillon Thought you were resting? Hate to see what you do when your working hard. Great stuff got it running and it has saved me alot of time already on script tweeking and debuging. As always I am humbled by your work. And eternally greatfull. _________________ Just because you think you can't. Is the best reason to try it anyway. |
|
Back to top |
|
|
Blacksting
Joined: 03 Jan 2005 Posts: 107
|
Posted: Sun Feb 13, 2005 8:09 Post subject: |
|
|
We are starting to get so many options here when we previously had none . What do you think is more efficient? Loading a resource with the Resource Manager or loading it with RetrieveCampaignObject from the database? On one hand I would think the straight file load would be better except that it runs through the ResourcePlugin magic first while the RCO hook must go through MySQL but seems to have an efficient pipeline in to the engine already?
Does anyone have any plans to timer test creating an object with the Resource Plugin and retrieving one with the SCORCO plugin? |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Sun Feb 13, 2005 17:54 Post subject: |
|
|
Yes, good idea. Maybe that someone could post the results here !
Btw, if everything goes well, I would like to convert at least parts of Avlis to use the Resource Manager, and thus I need a cache in the Resource Manager anyway. _________________ Papillon |
|
Back to top |
|
|
Blacksting
Joined: 03 Jan 2005 Posts: 107
|
Posted: Sun Feb 13, 2005 22:13 Post subject: |
|
|
Does the Resource Manager load TGAs? I was thinking reskinning a tileset could be as easy as overwriting TGAs in the resource folder. "Seasonal" skins could be loaded appropriately.
Also I think it would be a good idea for the Manager to load are, gic, and git files from the resource folder first even if they exist in the mod. It is a pain to save a module without an .are file present and still have it recognized as existing (and that holds tile configuration.) |
|
Back to top |
|
|
Papillon x-man
Joined: 28 Dec 2004 Posts: 1060 Location: Germany
|
Posted: Mon Feb 14, 2005 9:07 Post subject: |
|
|
Blacksting wrote: | Does the Resource Manager load TGAs? I was thinking reskinning a tileset could be as easy as overwriting TGAs in the resource folder. "Seasonal" skins could be loaded appropriately. |
I guess this would not affect the client...
Quote: |
Also I think it would be a good idea for the Manager to load are, gic, and git files from the resource folder first even if they exist in the mod. It is a pain to save a module without an .are file present and still have it recognized as existing (and that holds tile configuration.) |
Yes, loading resources that are in the module is on my list. _________________ Papillon |
|
Back to top |
|
|
|