The Daily Click ::. Forums ::. Klik Coding Help ::. Array filesizes
 

Post Reply  Post Oekaki 
 

Posted By Message

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
19th May, 2009 at 12:19:16 -

Ok my level editor for the adventures of pause uses a 3 Dimentional array to save its maps.
200 X
200 Y
5 Z (layers)

ok... well saveing that makes an array file thats about 900kb... Thats not good.

The underside level editor (wow i go on about that alot) The Almighty Paintbrush saves arrays about 8-16kb (considering that he saves the entities and maps as seperate files they are about 4-8kb each)

So... i decided he most probly doesnt use a 3D array and saves layers by useing a delimited value on a 2D array.

BUT that seems like a really weird way around it. OR somehow it compresses hes arrays and gets rid of the whitespace (unused array data).

--
If someone knows the awnswer to smaller array files please tell me.
Or if its to do with the level editor and have 5 layers thats the proplem, let me know a way around if you know one.
--

thanks guys

 
dont make me divide by zero...

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
19th May, 2009 at 12:25:09 -

MMF arrays are mostly blank spaces. Like a huge box. Compression will shrink it significantly though.

Lol, best way around it is not to use them. Lua tables work like arrays, but don't use up space until you use the slot. It's a bit much to use Lua just for the array, though.

So, best way is just to plan our your maps to not need 200*200, methinks. Using just 100*100 will lower it by a fourth. Or you can compress the array when you're not using it.

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
19th May, 2009 at 14:18:41 -

I made this a couple of years ago:
http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=41324

It's a level editor which uses the binary object. The result is that each 'tile' in your game will only take up 1 byte. So a 200 x 200 array would take up 40 000 bytes, ie 40kb. However (if I recall correctly), my method uses whitespace (0 where a tile is blank) so you would want to combine it with compression to remove that if you think the files are too big.

This example file isn't really practical for super intensive arrays (where cells contain long strings etc.) but it might be worth a look if saving space is very important to you.

You should also try the Associate Array object. That has built in compression and encryption.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
19th May, 2009 at 14:18:56 -

Ah from mr lua man himself... i wish i knew as much about lua as you lol! I still need help with the reading line by line thing btw!!!!!!!!!!! GRRRR

um... yeah but the problem mainly results in needing it to be a small filesize so when i load it, it loads up pretty much staright away... where as now it can take about 3-5 seconds sometimes to load and then place all the tiles.
Where as the underside is pretty much imediate.

Hey, if you can give me a couple of your unwanted lua useing applications, i would be so greatfull, im reallying try hard to learn it all at the moment, its so damn powerfull when used with MMF.

cheers

 
dont make me divide by zero...

Zephni

My other cars a Balrog

Registered
  17/10/2007
Points
  4019

Has Donated, Thank You!VIP MemberSonic Speed
19th May, 2009 at 14:21:23 -

Hmm. ive been fiddling with the ass array, and im gona be honest i dont understand it... how are you ment to make it 2d...let alone 3d... im dumb.

its all done with keys and adresses rather than X Y and Z positions.

You cant delimiter the adress coz it needs to be a value
You can use keys coz you cant save a string under a value... How am i ment to use this object.??

Edited by Zephni

 
dont make me divide by zero...
   

Post Reply



 



Advertisement

Worth A Click