udoprog / c10t

A minecraft cartography tool
Other
225 stars 50 forks source link

c10t fails partway through writing out its palette #106

Closed angryoptimist closed 13 years ago

angryoptimist commented 13 years ago

When I run ./c10t -W foo, I get: Threads: 4 Type `-h' for help ./c10t: Failed to write palette to foo Log written to /home/angryoptimist/build/c10t/build/c10t.log

c10t.log is empty and in foo I have

<base R,G,B,A> <side R,G,B,A>

Air                  255,255,255,0    255,255,255,0  
Stone                128,128,128,255  103,103,103,255 
Grass                120,172,70,255   108,78,54,255  
Dirt                 134,96,67,255    108,78,54,255  
Cobblestone          100,100,100,255  81,81,81,255  
Wood                 157,128,79,255   127,103,64,255  
Sapling              120,120,120,0    97,97,97,0  
Bedrock              84,84,84,255     68,68,68,255  
Water                56,68,127,127    56,68,127,127  
StationaryWater      56,68,127,127    56,68,127,127  
Lava                 255,90,0,255     205,73,0,255  
StationaryLava       255,90,0,255     205,73,0,255  
Sand                 218,210,158,255  176,169,128,255 
Gravel               136,126,126,255  110,102,102,255 
GoldOre              143,140,125,255  115,113,101,255 
IronOre              136,130,127,255  110,105,103,255 
CoalOre              115,115,115,255  93,93,93,255  
Log                  102,81,51,255    82,66,41,255  
Leaves               74,131,66,128    60,106,54,128  
Sponge               195,195,50,255   157,157,41,255  
Glass                255,255,255,48   205,205,205,48  
LapisLazuliOre       102,112,134,255  82,91,108,255  
LapisLazuliBlock     29,71,165,255    24,58,133,255  
Dispenser            107,107,107,255  87,87,87,255  
Sandstone            218,210,158,255  176,169,128,255 
NoteBlock            100,67,50,255    81,54,41,255    

and all this is the same if I run it with "--debug". My output for ./c10t --version is c10t - a cartography tool for minecraft version: git 96b32fa, built on Jan 18 2011 by: Udoprog johnjohn.tedro@gmail.com et. al (see README) site: http://github.com/udoprog/c10t

and I run it on an x86_64 Debian Sid machine.

Also: I looked into the source to see if it was something simple that I could fix (despite not really being that familiar with C++) and, while I didn't see why it was doing was it was doing, did fiddle around with the stream bit inside the loop in do_write_palette. When I removed the name of of the block (and it's formatting bit), it ran without giving an error. Unfortunately, I no longer have the output of that on hand--after nuking the directory, and cloing/building again just to make sure--but it was quite a bit longer (IIRC, 238 entries, minus the comment at the top) and, of course, missing the leftmost column (of names).

Anyway, that's about all I know about it. I hope that's enough detail.

angryoptimist commented 13 years ago

Seems to be fixed. Getting the palette with "-W" completes and produces a file that's 239 lines long (including the header). Output of ./c10t --version is

c10t - a cartography tool for minecraft
version: git 17738f5, built on Feb  2 2011
by: Udoprog <johnjohn.tedro@gmail.com> et. al (see README)
site: http://github.com/udoprog/c10t

So, thanks! :)

It does however, give an exit code of 1 and this output on the shell when run like ./c10t -W palette:

Threads: 4
Sucessfully wrote palette to palette
Type `-h' for help
./c10t: You must specify a world to render using `-w <directory>'
Log written to /home/angryoptimist/build/c10t/build/c10t.log

For all I know, this is the intended behavior, and, hey, writing the palette works, but I figured I ought to give a heads up on that anyway. Certainly, it's unlikely that anyone will be using c10t like that in a script. :)

udoprog commented 13 years ago

yeah, was a bit unexpected, I've been working on improving task logic in another branch (two-oh-zero?), and it's checked in, this is major cosmetic surgery, and a bit experimental so I'm not very keen on moving it to master yet : ).