• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece!🔗 Click here to enter!

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: 46
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