• 🏆 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!

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,208
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