Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Question about how UDT arrays are saved with Matrix1 plugin

Author
Message
Alaror
12
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 1st Dec 2011 01:45
I'm at the point where I need to decide on a final save structure for my worlds. A user defined type array would obviously be the simplest way to go about it, but I'm worried about the potential file size. From my understanding when you DIM an array using a UDT, all the memory is allocated at once rather than when you actually give each part of the UDT a value. If this is true (honestly, I have no idea) do the DATAFILE commands do any compression or does it save a blank spot for everything defined by your UDT.

If my question isn't making sense, take for example a UDT with one parameter "AS STRING". If there's an array with a size of 1 (two spots, since 0 and 1 can both be defined) and 0 has no value given to it while 1 is assigned the string "Hello world", would both 0 and 1 take the same amount of space when saved, or do the DATAFILE commands ignore 0 since it was never assigned a value?

Thanks in advance for any info; let me know if I need to clarify anything.
Diggsey
17
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 1st Dec 2011 02:12
"No value" isn't really an option, everything has a value. If you haven't assigned to it yet then it means the value is either zero (for a number) or null (for a string). However, a null string will take up less space in the file than the string "Hello world".

I think it's unlikely that you're going to have problems with file sizes. If it fits in memory it will fit in a file.

[b]
Alaror
12
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 1st Dec 2011 04:59
Alright, that lessened my worries. I guess it's always something I can get working now and fix later if it ends up being a big issue.

Thanks!

Login to post a reply

Server time is: 2024-03-29 07:22:42
Your offset time is: 2024-03-29 07:22:42