• 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.

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 64
Joined
Jan 18, 2005
Messages
27,286
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