They make things more flexible and readable. If you uses arrarys for weapons, and the weapons have three charateristics, where are some ways to do that. Here are the three I can think of:
Three arrays:
dim weaponsAttack(4) as float
dim weaponsName(4) as string
dim weaponsModel(4) as string
Now you must call every array when you use them. I you want to dynamically create weapons this method can be really annoying, because you have to use the array manipulatin commands on every
array.
One multidimensional array:
dim weapons(4, 3) as string
Really annoying to work with, because now you can only use one data type. An string can at last be transformed into an integer, but still... And you can't create or destroy weapons effectivly. The array manipulation commands only works on singledimensional arrays.
One array with UDT:
type _data_
attack as float
name as string
model as string
endtype
dim weapons( 4 ) as _data_
Using this method you can use all data types, plus you only need to use the array manipulation commands on one array. You can access the data easerly:
DamageEnemy( weapons( 4 ).attack )
UDT's (or User Defined Types) is very good when coding weapon systems, player systems, powerup systems... well, they are one of the things that really makes your day as a programmer.