Thursday, May 19, 2011

Version 1.5_01_F

First some bugfixes. 

The briefly flashing blue rectangle visible after destroying a block was caused by too much optimization for the sunset lag. It is fixed now and the sunset lag is also no more.

The new features. 

1. Smooth FPS

One of the long standing problems with the Minecraft performance is the unstable framerate. Random lag spikes can appear out of nowhere and then disappear. They are visible as random freezing or stuttering. Even worse is the magnitude of the lag spikes, some of them corresponding to 2 or 3 times lower framerate than the average one. The effective visual framerate is the lowest framerate for a given period, so the spikes are ruining the game appearance.

The reason for the spikes turned out to be the graphic card driver. The OpenGL specification allows the driver to buffer up to 3 frames, before rendering them to the screen. 

To fix this OptiFog adds "Smooth FPS" which explicitely flushes all OpenGL bufferes before rendering the next frame. This removes almost all of the random lag spikes and affects minimally the average FPS.

This is how the lag spikes look on a laptop with ATI HD 4200:


The average framerate is 29 FPS, but the worse spikes correspond to framerate 10 FPS, which reflects the allowed buffering of 3 frames.

With "Smooth FPS" turned on the framerate is much more stable. Average is 26 FPS with biggest spikes about 20 FPS.:
 

On a desktop PC with nVidia FX 5600 the lag spikes are appearing at every third frame. The visible effect is stuttering, especially at lower framerates.


With Smooth FPS the spikes are gone, and the average FPS is not affected:


The option Advanced OpenGL seems to reduce the random lag spikes on some systems, but have no effect on other. This is dependant on the graphic card driver.

2. Brightness

Minecraft uses non-linear light levels. The difference between level 0 and 1 is much smaller than the difference between level 14 and 15.

On a good calibrated monitor which can show near-black colors the Minecraft night scenes are almost fully black (light level 4). On the other hand, not so good monitors which have problems with near black colors show the night scenes very good.

The Brightness setting fixes the Minecraft light levels for properly calibrated monitors.  
Brightness 0% corresponds to default Minecraft light levels. Brightness 100% uses linear light levels, so the steps between all light levels are equal. 

3. Framerate Limit: VSync

A new value for the Framerate Limit, turns on vertical synchronization (VSync) between the graphic card and the monitor so that the monitor always show fully rendered frames. 

The visual effect is limiting the framerate to the monitor framerate, usually 60 or 70 FPS. However if Minecraft is not able to reach the full monitor framerate, the FPS will be limited to half the monitor framerate (30).

You can find more info about VSync here: http://www.tweakguides.com/Graphics_9.html

Wednesday, May 18, 2011

Version 1.5_01_E is Out

It has taken a while, but version 1.5_01_E is out.
Fixed are the sunset lag spikes and fancy clouds rendering on some nVidia cards.

Unfortunately the most interesting new features did not make it in the E release.

Currently OptiFog has three development branches:

A. Anisotropic Filtering and Full Screen Antialiasing using texture atlas
Adds AF and FSAA using the default Minecraft texture atlas.
Not quite working, some color bleeding is still visible in far objects. May need some shader support to really work.

B. Anisotropic Filtering and Full Screen Antialiasing using separate textures
This one is in development. The performance may be problematic, still have to be tested. If it works Minecraft will finally look nice.

C. Background chunk loading
Loads chunks on a separate thread.
On dual-core CPU-s it uses the second core for loading chunks while the first one renders. Chunk loading should not cause lag spikes, even with integrated graphics.
This branch is already working, but not yet deliverable. Mod compatibility may be problematic, because more class files are changed.

Friday, May 13, 2011

On Decompilers and Obfuscators

The guys at Minecraft Coders Pack have done a great job at lowering the entry barrier for Minecraft modders. Really.

Decompiling Java programs and recompiling them again has never been a real problem. However Minecraft is also obfuscated so that all class and method names are replaced with short meaningless labels.

Most obfuscators deliberately try to generate code which while still functionally identical to the original is as confusing as possible for a decompiler. This includes generating bytecode which can not be produced by a Java compiler or adding dead code with illegal functionality in hopes of disorienting the decompiler and forcing it to give up.

The decompiler used by MCP suffers from all this and is in fact not able to correctly decompile all the bytecode. However MCP uses a set of patches to help the decompiler where it has given up. These patches are updated manually for every Minecraft release.

Where MCP really has succeeded is at the returning of the meaning of the decompiled code. The MCP community has reverse engineered almost all of the Minecraft source and while some places are not quite right and one or two are totally wrong the final result is quite comprehensible.

MCP also includes the tools needed to recompile and reobfuscate the changed source so that the final result is compatible to the original Minecraft bytecode.

On IRC #mcp on irc.esper.net there is even a bot which can report the current deobfuscation mapping and accept names for the missing entries.

One just can not wish for more.

In the beginning was the Fog

Minecraft has always looked foggy, even on Normal and Far render distances. And this has always annoyed me a little.

The fog was robbing the vibrant colors of the valleys and mountains and turning them into washed-out background panes. Switching the render distance was also changing the fog density which was breaking the illusion of seeing a natural world.

Being a Java programmer since ever, I naturally came to the question "How hard could it be?".

This is how OptiFog was created.

Thursday, November 11, 2010

Property Investment Cooperation

Property Investment Investment in the lives of a very, very rarely is the loss of investment property ( land and / or buildings ) , but to invest in the property needed a lot of fund aka big , and very few people who have such a large fund , originated from this state , We " investment property " Air initiative is jointly held property investment . how Pun value. at least Rp . 1.000.000 , - ( One Million ) has been able to invest in property . Property Investment in this , your funds will be invested in the purchase of land and / or buildings or even not rule out the possibility for the development of which the value will be 2 ( two ) times the fold after less than 6 ( six ) years , so anything with your money , your funds will be 2 ( two ) times after we manage. Address Is : Jl . Raya No. pumpkin . 86 Housing - Tangerang Banten - 15138 If interested , phone ALDO 085-7171-67776 TERMS OF INVESTMENT PROPERTY 1 . Property investment is an investment ( capital investment ) in the field of land and / or buildings ; 2 . Capital investment ( investor ) is the person or legal entity who invest in business to be managed with the aim of getting the results according to the agreement ; 3 . Manager is a person or group of people working to manage investor funds in order to obtain results in accordance with the agreement ; 4 . Minimum funding that can be invested is Rp . 1.000.000 , - ( One Million ) , no maximum limit ; 5 . Investor funds would be returned intact at the end of the year to 6 ( six ) coupled with the results ( gain ) on investments amounted to 100 % ( One Hundred Percent ) of the value of the investment ; 6 . Investors can opt for the business with legalize / register the agreement through the notary offices with the cost fully borne by the Investors ; 7 . Each Investor each year made ​​a profit of : End of Year One , Lucky for 6 ( six ) percent of the total investment value ; End of Year Two , Lucky by 7 ( seven ) percent of the total investment value ; End of Year Three , Lucky for 9 ( nine ) percent of the total investment value ; The end of the Fourth Year , Lucky is 12 ( Twelve ) per cent of the total investment value ; End of Year Fifth , Lucky at 17 ( Tujuhelas ) percent of the total investment value ; Six Years End , Lucky was 23.50 ( Twenty-three Koma Five ) percent of the total value of investments ; Decision / withdrawal of investments and profits before the expiry of 6 ( six ) years cut by 50 ( Thirty five ) percent of the total value of benefits . 8 . Decision / withdrawal of funds before the expiration of 6 ( Six ) years must be through a written letter and can be availed in a maximum period of 1 ( one ) month since the letter and Copy of evidence submitted investments ; 9 . Capital Aseli planting evidence submitted padasaat no disbursement plus keutungan investor , signed a Letter of Decision Investors Investment Funds and profits ; 10 . Others are not listed in this provision will be made additions and improvements for the benefit of both parties ( management and investors )