Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 319 320 [321] 322 323 ... 326

Author Topic: Minecraft - Mods Thread  (Read 981171 times)

Micro102

  • Bay Watcher
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4800 on: April 12, 2014, 05:23:01 am »

Well, was playing agrarian skies, finished the seared brick blocks quest, selected the heart. Turns out it was a rotten heart (really stupid that they put it as a reward, in which it's sole purpose was to try to trick people into dieing) which deleted my world. I know I had at least 2 lives left, so there goes hours of progress because of a bad joke and what I assume to be a bug.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Minecraft - Mods Thread
« Reply #4801 on: April 12, 2014, 05:30:48 am »

Interesting :P

The file itself is around 400 MB, but it has a json internal representation (2), then Java gets its own version (3), so at least 1.2 GB of memory. 

For the first problem, it's probably a logic error. The second one, I wouldn't mind being able to make "subregions" (4, probably), but I might be able to get around it by lazily initiating the array. Right now I just initialize all 500x500x500 blocks. Which made me realize one issue: the height is hardcoded as 255 >_> Will fix that when I get home. Another method will be to only add Y arrays when they're needed.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4802 on: April 12, 2014, 05:47:56 am »

Oooh, how about this: I could make it so you can stream multiple JSON objects containing either a level definition or only one region each (which gets immediately written out), which means that there'll never be any significant memory buildup at all, since there's always at most one region loaded in memory of either program.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Minecraft - Mods Thread
« Reply #4803 on: April 12, 2014, 06:06:49 am »

A level definition?

As for the region thing, 1 region is already too large to fit in the memory of two programs at once, it seems! 500 is only a tad smaller than 512.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

scrdest

  • Bay Watcher
  • Girlcat?/o_ o
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4804 on: April 12, 2014, 08:41:54 am »

Yay, new update for TerraFirmaCraft is out! I can finally experience malnutrition due to poor food storage practices!
Logged
We are doomed. It's just that whatever is going to kill us all just happens to be, from a scientific standpoint, pretty frickin' awesome.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Minecraft - Mods Thread
« Reply #4805 on: April 12, 2014, 09:50:16 am »

MagmaMcFry: Here's the next error! :P
updated gist

Quote
java.lang.ClassCastException: org.json.JSONObject$Null cannot be cast
ng.Integer
        at mcfry.MCJsonDimension.create(MCJsonDimension.java:27)
        at mcfry.MCJsonWorld.create(MCJsonWorld.java:17)
        at mcfry.JsonWorldGenerator.main(JsonWorldGenerator.java:23)

I assume you still have the spheregen.py-generated files.


I found that a 512x256x512 file uses about 2.2 GB of RAM. That doesn't sound very good :c
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4806 on: April 12, 2014, 10:03:33 am »

A level definition?

As for the region thing, 1 region is already too large to fit in the memory of two programs at once, it seems! 500 is only a tad smaller than 512.

Only if you actually define every single block. Interesting info: Minecraft subdivides its chunk NBT format into sixteen 16x16x16 "sections", of which only those that aren't all air need to be defined. My program generates these sections on demand, and stores them in native arrays in memory, so it uses up only 4kb per section you touch.

MagmaMcFry: Here's the next error! :P
updated gist

Quote
java.lang.ClassCastException: org.json.JSONObject$Null cannot be cast
ng.Integer
        at mcfry.MCJsonDimension.create(MCJsonDimension.java:27)
        at mcfry.MCJsonWorld.create(MCJsonWorld.java:17)
        at mcfry.JsonWorldGenerator.main(JsonWorldGenerator.java:23)

I assume you still have the spheregen.py-generated files.

This happens because None values in your Python array would convert to Java nulls, which would complain when you converted them to integers.

Anyway, I did stuff to fix the memory issues.

I rewrote the JSON format again, and now you can basically send commands to the worldgen thing by writing JSON objects to STDOUT. There are three types of commands: Block commands which let you define a cuboid of blocks and a rectangle of biomes anywhere in any dimension (by specifying an initial (X, Y, Z) offset), level commands which generate a level.dat, and region export commands which tell Java to export a specific region to a region file and clear it from memory. This means that your Python program only ever needs to hold in memory the contents of a single sphere, which it can completely flush to Java before rendering the next sphere. And don't worry about holding several regions in Java's memory at once: I've estimated a region to take up at most 100MB of space in that memory, and that will only happen if you touch every single chunk section of that region (which you definitely won't by a large margin), but try to export those regions that you're sure you won't touch again.

To avoid overwriting spheres with the blank space caused by the cube of air around later spheres, you can now use the block IDs of None or -1 to denote 'don't overwrite this block please'.

Also note that you may not have any characters or spaces or newlines between adjacent JSON commands in the pipe.

Oh, and for any other programmers in this thread: Obviously you don't need to send commands using Python; any language will do (as long as you have some sort of JSON library available).
« Last Edit: April 12, 2014, 10:10:04 am by MagmaMcFry »
Logged

frostshotgg

  • Bay Watcher
  • It was a ruse
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4807 on: April 12, 2014, 02:08:56 pm »

Just a thought: Could you just cut off anything above 255Y? If you publish this, which you totally should, all contingencies should be covered.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Minecraft - Mods Thread
« Reply #4808 on: April 12, 2014, 07:17:26 pm »

Right now, Java crashes with an error message instead of failing silently. I think the former Is mkre preferable than the latter, but probably with a better error message.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4809 on: April 12, 2014, 09:10:17 pm »

What's the error message? The current program always displays at least one error message because I was too lazy to filter out the JSON end-of-input error message from all the other error messages. It also prints out a line like "Successfully parsed N JSON objects", and if N equals the number of commands you sent, then everything went right (even though that error message is displayed). I may add a "Thanks I'm done" command type later that you can send after all the other commands, just so that doesn't show up again.

Just a thought: Could you just cut off anything above 255Y? If you publish this, which you totally should, all contingencies should be covered.
I fixed the code to accommodate for that, and it'll be fixed in the next build, but I'm not going to publish this until at least I've added functionality to load existing level and region files and modify those.
« Last Edit: April 12, 2014, 09:14:00 pm by MagmaMcFry »
Logged

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4810 on: April 12, 2014, 09:12:38 pm »

-doublepost-
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Minecraft - Mods Thread
« Reply #4811 on: April 12, 2014, 09:32:23 pm »

What's the error message? The current program always displays at least one error message because I was too lazy to filter out the JSON end-of-input error message from all the other error messages. It also prints out a line like "Successfully parsed N JSON objects", and if N equals the number of commands you sent, then everything went right (even though that error message is displayed). I may add a "Thanks I'm done" command type later that you can send after all the other commands, just so that doesn't show up again.

Just a thought: Could you just cut off anything above 255Y? If you publish this, which you totally should, all contingencies should be covered.
I fixed the code to accommodate for that, and it'll be fixed in the next build, but I'm not going to publish this until at least I've added functionality to load existing level and region files and modify those.
It was meant as a reply to frostshotgg :P
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Minecraft - Mods Thread
« Reply #4812 on: April 13, 2014, 12:59:25 am »

Wow, that Bay12 crash.

Here's an actual error:



Strange thing is, it works perfectly fine on Linux. Maybe it's some Windows-Linux difference, like line endings?

Also, I think a nice convenience function to have would be "datatype":"exportAll", since I might not know the regions i touched.
« Last Edit: April 14, 2014, 07:49:13 am by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: Minecraft - Mods Thread
« Reply #4813 on: April 14, 2014, 09:34:39 am »

Oh, I see your problem: You had an older MCWorldgen version on Windows. Updating should fix that problem (it's always the same link).

For your convenience, I added new data types "exportAll" to export all remaining chunks, and "thanks" to quit without displaying an error.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: Minecraft - Mods Thread
« Reply #4814 on: April 14, 2014, 09:38:38 am »

Well, that makes sense. How embarrassing >_>


edit: Hmm :/ I feel bad for cluttering the thread with a bunch of errors.
« Last Edit: April 14, 2014, 09:47:27 am by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward
Pages: 1 ... 319 320 [321] 322 323 ... 326