What are the differences in MUI setups?

Level 5
Feb 13, 2019
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 62
Jan 18, 2005
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.