• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

What are the differences in MUI setups?

Status
Not open for further replies.
Level 5
Joined
Feb 13, 2019
Messages
128
From what I’ve read there’s multiple ways to go about setting up an MUI spell or “system”, using an array, using hash tables, I’m just curious are any of these considered the optimal method?

Are there draw backs to any?
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
The optimal approach is to use Lua and use a table and possibly coroutines to make Mui abilities. Makes data management trivial and uses all virtual machine primitive types so executes every efficiently.

If stuck with JASS or using GUI then both array and hash table approaches are about equal. Array might be slightly faster, and hash table can be more flexible. In such case it is likely best to use whichever you are most comfortable with as coding productivity might be worth more than any differences between the two approaches.
 
With using hashtable many spell makers tend to use the caster as key to data, which limits the amount of instances to 1 per caster.

Approaches like called "Dynamic Indexing" on hive, or just somethink with lists, don't have that limit of 1 instance per caster. But the downside is that the association from caster to its instance(s) might be less straight forward than with hashtable.
 
Status
Not open for further replies.
Top