FormList vs Array

Post » Tue Apr 16, 2013 8:22 pm

I understand that arrays are faster, but they come with some horrible limitations.

- Cannot cast None to an Array. This is not rejected by the compiler, but it causes a ton of error messages in the logs at run time.
- Cannot create a zero length array. Something like "Actor[] ActorArray = New Actor[0]" is rejected by the compiler.

In other words, there is no way at all to correctly handle an empty array. Furthermore:

Int Size = 10
Actor[] ActorArray = New Actor[Size]

Is also rejected as the array size has to be known at compile time. Forcing some ridiculous utility functions to be implemented to get dynamically resizable arrays.

Seriously?

(And don't get me started with the lack of a For() loop construct. So many bugs from forgetting to increment the index at the bottom of a While loop...)

So with all these issues, is there that much of a slowdown with setting up an empty FormList in the Creation Kit and using that instead of an array.
User avatar
Steve Fallon
 
Posts: 3503
Joined: Thu Aug 23, 2007 12:29 am

Post » Tue Apr 16, 2013 3:04 pm

well, the formlist takes a bit more time to get data from.

for example, you've seen those mods that automatically deposit all your alchemy ingredients to a satchel right?
Those are limited to around 4 ingredients deposited per second.

this is due in part to the mod needing to access data from the formlist during each iteration of a formlist.
I can't give you more precise information on how slow formlists are beyond that though.

Honestly it's not a big deal if you're only importing 1-4 things, and only doing it like a few times during a game.
but if you need to do a lot of formlist queries in quick succession, you'll probably notice the delay.
User avatar
Everardo Montano
 
Posts: 3373
Joined: Mon Dec 03, 2007 4:23 am


Return to V - Skyrim