Coder Social home page Coder Social logo

sheaconlon / craft Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 8.35 MB

A partial clone of Minecraft made from scratch, without frameworks. Uses a concurrent work queue, caching data structures, and better rendering algorithms to achieve high FPS. Contains implementations of procedural generation, basic physics simulation, etc.

Java 100.00%
game graphics java minecraft multithreaded

craft's People

Contributors

sheaconlon avatar sheaconlon-reviewer avatar

Watchers

 avatar  avatar

Forkers

hixio-mh

craft's Issues

The world generator is highly unrealistic

At least a basically realistic world generator is needed, so that render times can be evaluated under realistic conditions for example. This might involve some hills, some trees, some caves, some lakes, etc. It should be qualitatively similar to the desired final product, but need not "look real".

Referring to chunks is awkward

Currently, we refer to Chunks by their "chunk positions" and we iterate over Chunks indirectly by iterating over chunk positions. This is verbose and awkward at times. The detail of Chunks being identified by their positions should be hidden from code that deals with Chunks.

The rendering system lacks occlusion culling

Occlusion culling would probably reduce render time by a lot (?) because although it presents a large upfront cost, it would really decrease the vertex count and the upfront cost would be handled by the prerenderer. Should be done after #7. Occlusion culling in the current "every other block is a dirt block" world would not help nearly as much as in a realistic world, where the ground is almost completely solid.

VBOs are not indexed

There is a lot of repeated information in VertexBufferObjects.

  • Positions are repeated 3 times each, once for each face sharing a given vertex.
  • Normal vectors are repeated 4 * 25 * 25 * 25 = 62,500 times each, once for each vertex of a given face, once for each block.
  • Colors are repeated many times each, once for each vertex on each face of that color, 4 * 6 * 25 * 25 * 25 = 375,000 times currently.

Indexed VBOs should be used. They would dramatically cut down VBO size, thereby shortening VBO build/send time and increasing frame rate/rendering distance.

This might be done by registering positions, normals, colors, etc. as Vectors in some centralized directory so that they can be reused. The Prerenderer would avoid repeating these Vectors in the vertex data, instead referring to them using indices. This could be implemented in two stages to separate the OpenGL-related bugs from the non-OpenGL related bugs.

  • Create position, normal, and color reuse system.
  • Switch to indexed VBOs.

VBO capacity is hardcoded

The capacity of the FloatBuffers underlying VertexBufferObjects should not be hardcoded. Instead, some sort of quad limits and entity limits should be imposed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.