Author Topic: question regarding script speed  (Read 353 times)

Legacy_DM_Vecna

  • Hero Member
  • *****
  • Posts: 501
  • Karma: +0/-0
question regarding script speed
« on: September 21, 2011, 05:41:27 pm »


               I have been toying around with the Sparky Spawner system from CEP. But I am running into some shortcomings. I would like to use a number of different tables based on PC party average level. These tables would then contain groups of creatures to spawn , rather than just individuals. Sparky can use lists and groups but not together. So I have mainly two questions.  

How wold you rank the speed of the following three methods?
1. (Sparky Method) splice up a string containing encounter information using the functions "FirstWord" and "RestWords"
2. pulling the information from 2da files
3. pulling the information from NWNX database files. 
not sure if there is a faster way I am not considering. 

My second questions is How big is the difference? 

I could expand the functions used in Sparky and offer the changes to the CEP or start fresh with a 2da system, etc. 

I am also open to any other throughs or comments on the subject of spawning systems.
               
               

               
            

Legacy_Xardex

  • Sr. Member
  • ****
  • Posts: 414
  • Karma: +0/-0
question regarding script speed
« Reply #1 on: September 21, 2011, 07:16:58 pm »


               I would go with 1. by preference but I have heard that NWNX database is exceptionally fast.. Getting information from 2da is rather slow in comparision.

The best choice is 1 or 3, but both are propably fast enough for you to choose whichever seems easier for you to work with. (Assuming sparkys scripts are properly optimized and that im right about NWNX DB)
               
               

               


                     Modifié par Xardex, 21 septembre 2011 - 06:21 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
question regarding script speed
« Reply #2 on: September 21, 2011, 07:40:10 pm »


               I myself do not see a problem with 2.    Since the 2da now are cached I do not see it being much slower the option 1.   If your functions using the 2da are called often, I do not even see them being unloaded from memory.

It really comes down to the way you want to script it.   The spawning of the creatures themselves will most likely take more CPU time then your scripts deciding what to spawn.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
question regarding script speed
« Reply #3 on: September 22, 2011, 10:30:10 pm »


               Any is fine. You missed the quickest option though - hashes via nwnx. I would worry more about readability and ease of modification for something like this, however. We use sets of string  variables set on the area (from area onenter )for various tiers of encounters, mainly for that reason. You could simply set them on the area in the toolset, nowadays, but it's convenient to house them by area grouping in a communal include.

Funky
               
               

               
            

Legacy_Rolo Kipp

  • Hero Member
  • *****
  • Posts: 4349
  • Karma: +0/-0
question regarding script speed
« Reply #4 on: September 22, 2011, 11:57:02 pm »


               <adding another scrap...>

FunkySwerve wrote...
Any is fine. You missed the quickest option though - hashes via nwnx. I would worry more about readability and ease of modification for something like this, however. We use sets of string  variables set on the area (from area onenter )for various tiers of encounters, mainly for that reason. You could simply set them on the area in the toolset, nowadays, but it's convenient to house them by area grouping in a communal include.

I am going to *have* to find time to research nwnx... :-/

This sounds very tasty.

<...to the pile of reminders on his work table>
               
               

               
            

Legacy__Guile

  • Hero Member
  • *****
  • Posts: 1308
  • Karma: +0/-0
question regarding script speed
« Reply #5 on: September 23, 2011, 11:46:34 am »


               

FunkySwerve wrote...

Any is fine. You missed the quickest option though - hashes via nwnx. I would worry more about readability and ease of modification for something like this, however. We use sets of string  variables set on the area (from area onenter )for various tiers of encounters, mainly for that reason. You could simply set them on the area in the toolset, nowadays, but it's convenient to house them by area grouping in a communal include.

Funky


You guys ever gonna make any more modules Funky?

Higher Ground 2!  (like The Winds of Anarouch! or some cool name)  '<img'>
               
               

               


                     Modifié par _Guile, 23 septembre 2011 - 10:55 .
                     
                  


            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
question regarding script speed
« Reply #6 on: September 23, 2011, 09:22:56 pm »


               We actually had a forum for HG2, in NWN2, before it became apparent what a disaster it was for multiplayer. We will eventually be releasing a new mod - but with a new engine, one we haven't picked yet.

Funky