Author Topic: Dynamic "when I say" - how bad is it  (Read 5571 times)

PsiQss

  • Guest
Dynamic "when I say" - how bad is it
« on: February 09, 2017, 02:59:25 AM »
Quote
Something to consider when using this feature is that you can create a lot of
 permutations from very few words. Use with care :)

So I have something totally careless in mind. If anyone plays Guild Wars 2 (or any other mmo) they might know what I'm talking about. There's that equipment names system, in which you can identify the exact item by its name - skin, stats and all. The convention is: [prefix] + [item type] + [suffix], where prefix defines the attribute distribution (power, precision, etc),   item type is the type of equipment (sword, helmet...) and suffix determines the rune that is embedded in the weapon. Now, there's that website that scans the entire in-game trading post, in which you can search the item by name and see the price fluctuations for this item.

You probably guessed what I want to do. I want to be able to say "What's the price of Berserker's mithril sword of corruption, level 60" and have the plugin connect to the website (they have external api afaik) and tell me the current buy/sell price of the item, recent price fluctuations (if major) and the flip profit.

Problem is, there are about 40-50 prefixes and suffixes and a ton of item types. I could theoretically split [item type] into [skin type]+[item type]. In many cases it would be "[Krytan; Iron; Mithril...][sword; longbow; chestplate...]" but there are some unique item names, like "Krait Machete"for example (though I could probably make a separate cmd for those).

I don't know how exactly it works, but I assume VA is putting all those combinations together and would send a list of (50^3)*80lvls concatenations to the speech engine or something like that. Question is, how is all this data stored? How bad would this be for performance?

I obviously can't rely on speech engine to just get it right without setting this up as command. The other option would be to make it a command sequence that would set the variables step by step:

"What's the price of Berserker's" -> "Mithril" -> "Sword" -> "of corruption" -> "level 60"

With each step executed as separate command, with a boolean variable to prevent accidentaly starting the sequence from the middle. But with this method, you'd have to wait 2-3 seconds between each step. I'd just like to know if it's worth the wait ;)

Antaniserse

  • Global Moderator
  • Jr. Member
  • *****
  • Posts: 87
    • My VA plugins
Re: Dynamic "when I say" - how bad is it
« Reply #1 on: February 09, 2017, 08:24:57 AM »
I don't know how exactly it works, but I assume VA is putting all those combinations together and would send a list of (50^3)*80lvls concatenations to the speech engine or something like that. Question is, how is all this data stored? How bad would this be for performance?
(50^3)*80 is 10 million... in short, VERY bad!
Considering it is also for a function that is not critical to gameplay (you aren't doing those searches when you are in the middle of combat with your hand already busy, I guess) I don't think it's worth to choke your VA performance with this

Having said that, if you can shift some logic directly into the plugin, say a separate level specification, then you can reduce the permutations in the profile to an accettable level (in the order of ~100K should be manageble, depending on your system)
For example two separate actions like: "level [1..80]" (plugin stores required level) and then your [prefix] + [item type] + [suffix] command (plugin executes search with previously saved level)

It also has the advantage of not having to always repeat the number if you are searching different items of the same level
"I am not perfect and neither was my career. In the end tennis is like life, messy."
Marat Safin

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: Dynamic "when I say" - how bad is it
« Reply #2 on: February 09, 2017, 09:27:51 AM »
The bottleneck is the speech engine.  For accuracy (under general use), VA uses exact phrases to do its thing.  That means it's telling the speech engine exactly what it needs to recognize.  Even at 40k, you're looking at a significant load time, depending on the system that VA is running on.  You can test your limits by adding more and more elements to dynamic commands and see where saving a profile becomes too slow to tolerate.

Gangrel

  • Caffeine Fulled Mod
  • Global Moderator
  • Full Member
  • *****
  • Posts: 216
  • BORK FNORK BORD
Re: Dynamic "when I say" - how bad is it
« Reply #3 on: February 09, 2017, 01:08:52 PM »
The bottleneck is the speech engine.  For accuracy (under general use), VA uses exact phrases to do its thing.  That means it's telling the speech engine exactly what it needs to recognize.  Even at 40k, you're looking at a significant load time, depending on the system that VA is running on.  You can test your limits by adding more and more elements to dynamic commands and see where saving a profile becomes too slow to tolerate.

Do you remember that bible chapter and verse .vap that someone made and posted onto the google groups... I am still waiting for my PC to finish loading that profile

;)

PsiQss

  • Guest
Re: Dynamic "when I say" - how bad is it
« Reply #4 on: February 09, 2017, 02:49:21 PM »
Ohhh.. kayyyy...

Well, I guess I'll go with setting the variables sequentially then :P
Out of sheer curiosity though - what actually happens to all those commands? Are they stored in memory or just sent to speech recognition to some sort of temp file? Does it only affect loading time or overall performance?

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: Dynamic "when I say" - how bad is it
« Reply #5 on: February 09, 2017, 07:50:59 PM »
Quote
Do you remember that bible chapter and verse .vap that someone made and posted onto the google groups... I am still waiting for my PC to finish loading that profile

I think load times have dramatically improved since then.  You should try it again :)


All commands are extracted on-the-fly and added to the speech engine.  So, this statement:
fire[all;][the;][weapons;cats;hamsters][into the sun;]
Expands into:
fire weapons
fire all weapons
fire the weapons
fire all the weapons
fire weapons into the sun
fire all weapons into the sun
fire the weapons into the sun
fire all the weapons into the sun
...for cats...
...for hamsters...
...i'm sure i'm missing some bits...

is only stored as, 'fire[all;][the;][weapons;cats;hamsters][into the sun;]'.  It all affects load time.  Once it's loaded, it works the perceptively the same whether it has 10 or 20,000 commands.


PsiQss

  • Guest
Re: Dynamic "when I say" - how bad is it
« Reply #6 on: February 10, 2017, 01:08:24 AM »
So I could, in theory, start up VA, go to work, and once back - start playing with even 10 billion commands loaded? :) Assuming I didn't forget to select the right profile at startup.
JK, not gonna do that :P

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2827
Re: Dynamic "when I say" - how bad is it
« Reply #7 on: February 10, 2017, 09:25:58 AM »
I imagine if you had the resources to do it, VA wouldn't stop you :)