• 4

    posted a message on OptiFine HD (FPS Boost, Dynamic Lights, Shaders and much more)
    Wow, sp614x, it's really impressive how far you've taken this mod in the past few years!

    I think a major problem is that Minecraft devs mostly develop and test on powerful computers, so they rarely feel the performance issues they're causing.

    A PC has dozens of potential performance bottlenecks, and games that run on varied hardware stress different combinations of them. When I developed some of the first performance mods, I was trying to play Minecraft on an extremely slow laptop. My 5400RPM hard drive meant I constantly ran into disk seek latency bottlenecks, and that pain drove me to write McRegion. My second bottleneck was a slow integrated Intel GPU, leading to Optimine and rewritten text rendering routines.

    CPU speed and memory is another easy bottleneck that's triggered by large amounts of garbage being generated. If your computer can keep up, the pauses will likely be unnoticeable, but when you start falling behind it's horrible. A few days of exploratory hacking reduced garbage generation rates by 80%, but the resulting tiny scattered changes are a pain to maintain. I'm sure you've experienced the same thing.

    Has Mojang performed a hardware survey? I'd expect that a decent percentage of their players are using older, slower computers, and likely feel the pain of wasteful changes like this.
    Posted in: Minecraft Mods
  • 12

    posted a message on [V1.3] Optimine (FPS Boost) [OPTIMIZATION] *UPDATED*
    Mod edit: direct your attention to http://www.minecraftforum.net/topic/249637-166-optifog-and-optimine-fps-boost/ for updated version

    Old post:
    This mod improves FPS, especially for slower computers. Gains of 20FPS and more are common.

    Download: [url]

    Modloader v5 compatible: [url=http://mod.ifies.com/f/110311_optimine-1.3_01v2-mlv5.zip]http://mod.ifies.com/f/110311_optimine- ... 2-mlv5.zip[/url] (install *after* you install ModLoader)

    1.2_02 version: [url]http://mod.ifies.com/f/110123/Optimine_1.2_02v3.zip[/url]

    1) Locate your minecraft.jar file. On Windows, it's in %APPDATA%/.minecraft/bin
    2) Create a backup of minecraft.jar
    3) Open minecraft.jar in an archive editor (WinRar/7-Zip/etc)
    4) Delete the META-INF folder.
    5) Copy the files from the downloaded zip file into the jar file, replacing previous files.
    6) Run Minecraft and test!

    FastRender: more efficient chunk queue processing.
    UniText: a completely rewritten text renderer. It's faster and supports Unicode, although the Unicode font files are not included with this release.
    Fewer glClears: erasing the entire screen is expensive. This mod avoids it when possible.
    Better chunk drawing code: Removing a few useless transforms from the chunk rendering code lets all visible chunks be drawn in a straightforward manner.
    Better Tesselation: Modified for speed. TNT explosions no longer cause clients to have horrible lag, and everything in general should feel faster.
    Error handling: Don't go to a black screen when there's an OpenGL error. Print a decent error message to the command line instead.

    If you find this helpful, you may want to try my other mod, [url=http://www.minecraftforum.net/viewtopic.php?f=25&t=120160]McRegion[/url], for reducing chunk load/save lag.

    Posted in: Minecraft Mods
  • 2

    posted a message on Scaevolus' Authoritative Chunkgen Analysis
    In minecraft, y is the vertical axis.

    Chunks dimensions are 16x128x16. The minimum coordinate is (0, 0, 0), and the maximum coordinate is (15, 127, 15).

    Step 1: Heightmap Generation.

    This is the trickiest bit, and is responsible for the overall shape of the terrain and overhangs. I'm not going to describe it fully, but it uses Perlin noise as the base randomness function, which allows stuff to be seamless.

    In this first pass, four block types are placed. For each block in the chunk, the first true option of the following determines the block type:
    1) Stone: The block is below the terrain height.
    2) Ice: The temperature is below 0.5, and the block height is 63 (sea level).
    3) Water: The block height is less than or equal to sea level.
    3) Air: Everything else.

    Step 2: Top Layer & Bedrock

    This replaces surface stone blocks with dirt, sand, and gravel. It also creates the bedrock layer.

    Whether a vertical column contains a sand or gravel surface layer, along with the depth of the top layer, is stored in three 16x16 arrays generated using Perlin noise. Sand takes precedence over gravel, and gravel takes precedence over dirt.

    A block becomes bedrock if its height is less than or equal to R[0, 4]. This explains why it's possible to sometimes fall through the bottom of the map-- it's not guaranteed to seal every hole with bedrock.

    Step 3: Cave Generation

    Again, this is kind of complex. Imagine the cave generation as worms that randomly tunnel, leaving air behind. Only stone, grass, and dirt are replaced with air. Blocks at or below 10 height are replaced with lava instead of air.

    Step 4: Feature Placement

    :VV: This is the useful part :VV:

    [a, b] is a range from a to b, inclusive. [0, 3] includes 0, 1, 2, or 3.
    R[a, b] is a random integer from a to b.
    R[a] is a random integer from 0 to a.
    RC is the same thing as <R[16],R[128],R[16]>
    RC[y] is the same thing as <R[16], R[y], R[16]>
    RCO is the same thing as <R[16]+8,R[128],R[16]+8>
    P[x] means something happens with a probability of x. P[1/4] events happen 25% of the time.
    Nx means something happens N times.

    Ore deposits are generated as ellipsoids, and will only replace stone (unless otherwise noted). This means that if a diamond deposit is placed on top of a dirt deposit, there will be no diamonds generated. The given radius is the maximum axial radius. Actual sizes will almost always be smaller.

    The steps are executed in the order I list them here.

    P[1/4]: Lakes: attempt to create a small (ellipsoid) body of water at RCO.
    P[1/8]: Lava pool: Select coordinate RCO. If P[1/10] or height (y) is less than 64, attempt to create a body of moving lava at the coordinate.
    8x: Dungeon: Create a mob spawner at RCO. Will fail unless the floor and ceiling is solid and there are 2-3 player-sized gaps in the walls.

    10x: Clay: Create a clay deposit at RC with radius 4. Will fail unless given coordinate is water. Will only replace sand. (N.B.: Clay generation is identical from 1.1_02 to 1.2_02)
    20x: Dirt: Place at RC with radius 4.
    10x: Gravel: Place at RC with radius 4.
    20x: Coal: Place at RC with radius 2.
    20x: Iron: Place at RC[64] with radius 2.
    2x: Gold: Place at RC[32] with radius 1.
    8x: Redstone: Place at RC[16] with radius 7/8.
    Diamond: Place at RC[16] with radius 7/8.
    Lapis: Place at RC[16]+<0,R[16],0> with radius 3/4. Note that the position is the sum of two evenly distributed ranges, which is indicated in the triangular frequency curve in the ore distribution charts.

    Tree density times: Generate trees. Note that tree density in desert, tundra, and plains is almost always less than zero.
    2x: Plant yellow flowers at RCO. Attempts to spawn 64 flowers within 16x8x16 cube centered at the position. Will fail unless chosen position is empty, above grass, and has light value of at least 8.
    P[1/2]: Plant red flowers at RCO. Same constraints as yellow flowers.
    P[1/4]: Plant brown mushrooms at RCO. Same generation strategy as yellow flowers, but will fail unless chosen position is empty, above a solid block, and has light value less than 14.
    P[1/8]: Plant red mushrooms at RCO. Same constraints as brown mushrooms.
    10x: Plant reeds at RCO. Attempts to spawn 20 reeds within 8x1x8 cube centered at the position. Will fail unless chosen position is empty and is adjacent to a water block. Reed height is 2+R[R[3]+1].
    P[1/32]: Plant pumpkins at RCO. Attempts to spawn 64 pumpkins in a 16x8x16 cube centered at the position. Will fail unless chosen position is empty and above grass.
    10x in desert biome, 0x otherwise: Plant cacti at RCO. Attempts to spawn 10 cacti within a 16x8x16 cube. Will fail unless chose position is empty, above sand, and has no adjacent solid blocks. Cactus height is 1+R[R[3]+1].
    50x: Waterfall: Attempt to place a single water source block at RC[120]+<0,8,0>. Will fail unless the blocks above and below are stone, the block is air or not stone, and has 3 stone blocks and 1 air block in the NSEW directions. Basically, it lets you have rivers in caves.
    20x: Lavafall: Same constraints thing as Waterfall, but place a lava source block.

    For each column: If the temperature is less than 0.5 and the top solid block is not ice, put a snow block above it.

    tl;dr: You can get at most one diamond cluster and one lapis cluster per chunk.
    Posted in: Mods Discussion
  • 1

    posted a message on [MOD] McRegion v5 (Optimized Saves) [1.2_02]
    Quote from xhayatox »
    So what does this mod do exactly?
    Provide the game with more smoother framerate and less lag?
    And wheres the download link o_O

    Hopefully, although it might not be noticeable if your computer is fast already. Speedups are of course constrained by Amdahl's law.

    The download link is removed until I fix a really stupid bug.
    Posted in: Mods Discussion
  • 10

    posted a message on [MOD] McRegion v5 (Optimized Saves) [1.2_02]
    Q: What is the #1 cause of Minecraft lag?
    A: Chunk updates.

    This mod optimizes how chunks are stored on the disk, meaning pauses to load or save a chunk as you move around a world become much shorter and less noticeable.

    The improvement is most noticeable on systems with slow disks, such as laptops. I have also had reports that it decreases memory usage of SMP servers.

      [*:38q1rrtm]Speed. Less jerkiness as you move around. Load, save, and delete worlds faster.
      [*:38q1rrtm]Backwards compatible. Old worlds load and are converted on-the-fly to the region format.
      [*:38q1rrtm]Backup friendly. The number of files decreases by 500-1000x, so compressing an entire world is much faster.

    Client: http://mod.ifies.com/f/110114/mcregion_v5_client_1.2_01.zip
    Server: http://mod.ifies.com/f/110114/mcregion_v5_server_1.2_01.zip
    Conversion utility: http://mod.ifies.com/f/110106/RegionTool.jar This will let you convert your saves back to the old chunk format if an update comes out. It also lets you batch-convert a world if you have a lot of chunks and want to make sure they're all stored in region files. Normally, the conversion is done automatically in the background.
    Source code: This is public domain. http://mod.ifies.com/f/110106/RegionTool_source.zip

    Back up your saves directory. I'm pretty sure it won't break anything, but you don't want to lose any of your work.

    1) Locate your minecraft.jar file. On Windows, it's in %APPDATA%/.minecraft/bin
    2) Create a backup of minecraft.jar
    3) Open minecraft.jar in an archive editor (WinRar/7-Zip/etc)
    4) Delete the META-INF folder.
    5) Copy the files from the downloaded zip file into the jar file (overwriting nk.class).
    6) Run Minecraft and test!

    Server instructions: Do the same thing on minecraft_server.jar, but don't delete the META-INF folder, and use the mcregion server download.

    To put all the old chunks into region files, do something like this:
    java -jar RegionTool.jar pack ~/.minecraft/saves/World1

    To extract all the chunks from the region files, do something like this:
    java -jar RegionTool.jar unpack ~/.minecraft/saves/World1

    Technical details: 90% of chunks are smaller than 4KB, and 99% are smaller than 8KB. This stores them efficiently in a single file. For a more complete description, see viewtopic.php?f=25&t=120160&p=1803041#p1803041

    This will make a new folder "regions/" in your world directory, containing the new chunk clusters. This folder can be safely deleted if you want to revert. Any changes made to the world while using this mod will be lost, but your inventory and position will persist.

    v5 2011.01.06: Directly use Deflate streams instead of GZIP for improved speed.
    v4 2011.01.02: SMP support, offline conversion utility.
    v3 2010.12.30: Fix deleting worlds with regions
    v2 2010.12.30:
    - Fix saving and misc other bugs
    - Don't use memory mapped files
    - Debug output
    v1 2010.12.29: First version

    If you find this mod helpful, a donation towards further optimizations and my college expenses would be appreciated.
    Posted in: Mods Discussion
  • To post a comment, please .