ftomassetti / worldgen

0 stars 0 forks source link

Improve serialization format for map #14

Open ftomassetti opened 11 years ago

ftomassetti commented 11 years ago

Maybe use bin data:

path = '/Users/federico/my_world/eroded' File.open(path, 'rb') {|file| data = Marshal.load(file) }

class Map3 < BinData::Record array :numbers, type: :float_le uint16le :width uint16le :height end

(0..1999).each do |y| (0..2999).each do |x| m.numbers << om[y][x] end end

destpath = '/Users/federico/my_world/eroded_reduced' File.open(destpath, 'wb') do |io| r = Rectangle.write(io) end

ftomassetti commented 11 years ago

Verify if putting with and height before numbers a nd resplitting the eroded huge file now works (branch binarymap)

ftomassetti commented 11 years ago

Try with something in Java, maybe using the MappedByteBuffer