• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Is there a more efficient way of doing this?

Status
Not open for further replies.
Level 2
Joined
Apr 9, 2012
Messages
23
The attached is the opening to a campaign I'm currently working on. It's rather short at present because I want to get a system down before I dive in head long. The campaign revolves around the 2nd map, it will be the center hub for a spiderweb of maps built using this system.

I will have to keep track of not only dozens of quests but specific levels of up grades for the single hero. The only way I can think of to do this reliably across the board for all maps is to use cached integer variables for each quest and upgrade and have a if/then/else array check the those integer variables at cache load and turn off/turn on the appropriate triggers accordingly.

Is there a more efficient way of keeping track of these across 30-50 maps? I'm afraid it'd be a really large cache with horrific lag when entering a map.
 

Attachments

  • William.w3n
    343 KB · Views: 48
Is there a more efficient way of keeping track of these across 30-50 maps? I'm afraid it'd be a really large cache with horrific lag when entering a map.

Well if you have a ton of true/false type of values to save, you could just encode them all in binary and then convert the binary values into one integer that is then saved and loaded from the cache. I think you can save up to 30 true/false values as bits into one integer.

Also, you can save the quests and ability levels in the same way if you already know what the maximum levels or quest lengths are.
But in this case, instead of binary, you'll just use a base-<max_value> system.
Example: all your quests have a maximum of 4 phases -> you can store the progress of 15 different quests in one integer after you've encoded it in base-4 and converted that to an integer.

That would be a more "efficient" way of storing the stuff into a smaller cache.
However, I doubt you'll have any "really large cache with horrific lag" -issues unless you actually have tons of data stored.
 
Level 2
Joined
Apr 9, 2012
Messages
23
Well if you have a ton of true/false type of values to save, you could just encode them all in binary and then convert the binary values into one integer that is then saved and loaded from the cache. I think you can save up to 30 true/false values as bits into one integer.

Also, you can save the quests and ability levels in the same way if you already know what the maximum levels or quest lengths are.
But in this case, instead of binary, you'll just use a base-<max_value> system.
Example: all your quests have a maximum of 4 phases -> you can store the progress of 15 different quests in one integer after you've encoded it in base-4 and converted that to an integer.

That would be a more "efficient" way of storing the stuff into a smaller cache.
However, I doubt you'll have any "really large cache with horrific lag" -issues unless you actually have tons of data stored.

I'm not sure how to do such things. How do I load a single variable with multiple info.
 
Status
Not open for further replies.
Top