Clarify and shorten readme.md

master
azekillDIABLO 2019-07-08 16:08:09 +02:00 committed by GitHub
parent 9c985c86e2
commit 83b7143732
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 135 deletions

151
README.md
View File

@ -1,42 +1,23 @@
## Omicron by azekill_DIABLO
## Omicron
Fork of CraftNG by Twetzel59 which is also a Fork of Michael Fogleman's Minecraft clone for Windows, Mac OS X and Linux.
### About
Craft >
http://www.michaelfogleman.com/craft/
#### Credits
Game developped by azekill_DIABLO.
A fork of the work of [Twetzel59](https://github.com/twetzel59), known as **[Craft NG](https://github.com/twetzel59/CraftNG/)**,
a fork of the work of [M. Fogleman](https://github.com/fogleman), the base of everything, **[Craft](http://www.michaelfogleman.com/craft/)**.
Craft NG >
https://github.com/twetzel59/CraftNG/
### Features
* Simple but nice looking terrain generation using perlin / simplex noise.
* Over 70 blocks and more can be added with ease.
* Supports plants (grass, flowers, trees, cactus) and transparency (glass).
* Simple fluffy clouds in the sky (they don't move... Yet!).
* Day / night cycles and a textured sky dome.
* World changes persisted in a sqlite3 database.
* Multiplayer support! (Well. Needs server first.)
* Various biomes. (Including the newly created Mesa-Biome!)
* Lakes and Water caves
### Download
Mac and Windows binaries are currently unavailable.
Linux release : *<link here>*
### Running the game
#### Running the game
Mac and Windows: Click on the executable file, the game should run.
Linux: Open terminal in the directory of the game and type `./omicron`
See below to run from source.
See below to compile from source and get the executable.
### Install Dependencies
### Compilation
#### Mac OS X
#### Requirements under Mac OS X
Download and install [CMake](http://www.cmake.org/cmake/resources/software.html)
if you don't already have it. You may use [Homebrew](http://brew.sh) to simplify
@ -44,15 +25,12 @@ the installation:
brew install cmake
#### Linux (Ubuntu)
#### Requirements under Linux (and Debian)
sudo apt-get install cmake libglew-dev xorg-dev libcurl4-openssl-dev
sudo apt-get build-dep glfw
*Under debian (tested under AntiX) it seems you need to run each install
of the first line separately in order to install without errors.*
#### Windows
#### Requirements under Windows
Download and install [CMake](http://www.cmake.org/cmake/resources/software.html)
and [MinGW](http://www.mingw.org/). Add `C:\MinGW\bin` to your `PATH`.
@ -65,21 +43,19 @@ Use the following commands in place of the ones described in the next section.
cmake -G "MinGW Makefiles"
mingw32-make
### Compile and Run
#### Compilation (for all platforms)
Once you have the dependencies (see above), install the sources and open the
terminal in the dowloaded source directory. Run the following commands :
cmake .
make
./omicron
### Multiplayer
Then you can run the game.
W.I.P > No server
### More info
### Controls
#### Controls
- WASD/ZQSD to move forward, left, backward, right.
- Space to jump.
@ -99,101 +75,6 @@ W.I.P > No server
- Arrow keys emulate mouse movement.
- Enter emulates mouse click.
### Chat Commands
/goto [NAME]
Teleport to another user.
If NAME is unspecified, a random user is chosen.
/list
Display a list of connected users.
/login NAME
Switch to another registered username.
The login server will be re-contacted. The username is case-sensitive.
/logout
Unauthenticate and become a guest user.
Automatic logins will not occur again until the /login command is re-issued.
/offline [FILE]
Switch to offline mode.
FILE specifies the save file to use and defaults to "craft".
/online HOST [PORT]
Connect to the specified server.
/pq P Q
Teleport to the specified chunk.
/spawn
Teleport back to the spawn point.
### Implementation Details
#### Terrain Generation
The terrain is generated using Simplex noise - a deterministic noise function seeded based on position. So the world will always be generated the same way in a given location.
The world is split up into 32x32 block chunks in the XZ plane (Y is up). This allows the world to be “infinite” (floating point precision is currently a problem at large X or Z values) and also makes it easier to manage the data. Only visible chunks need to be queried from the database.
#### Rendering
Only exposed faces are rendered. This is an important optimization as the vast majority of blocks are either completely hidden or are only exposing one or two faces. Each chunk records a one-block width overlap for each neighboring chunk so it knows which blocks along its perimeter are exposed.
Only visible chunks are rendered. A naive frustum-culling approach is used to test if a chunk is in the cameras view. If it is not, it is not rendered. This results in a pretty decent performance improvement as well.
Chunk buffers are completely regenerated when a block is changed in that chunk, instead of trying to update the VBO.
Text is rendered using a bitmap atlas. Each character is rendered onto two triangles forming a 2D rectangle.
“Modern” OpenGL is used - no deprecated, fixed-function pipeline functions are used. Vertex buffer objects are used for position, normal and texture coordinates. Vertex and fragment shaders are used for rendering. Matrix manipulation functions are in matrix.c for translation, rotation, perspective, orthographic, etc. matrices. The 3D models are made up of very simple primitives - mostly cubes and rectangles. These models are generated in code in cube.c.
Transparency in glass blocks and plants (plants dont take up the full rectangular shape of their triangle primitives) is implemented by discarding magenta-colored pixels in the fragment shader.
#### Database
User changes to the world are stored in a sqlite database. Only the delta is stored, so the default world is generated and then the user changes are applied on top when loading.
The main database table is named “block” and has columns p, q, x, y, z, w. (p, q) identifies the chunk, (x, y, z) identifies the block position and (w) identifies the block type. 0 represents an empty block (air).
In game, the chunks store their blocks in a hash map. An (x, y, z) key maps to a (w) value.
The y-position of blocks are limited to 0 <= y < 256. The upper limit is mainly an artificial limitation to prevent users from building unnecessarily tall structures. Users are not allowed to destroy blocks at y = 0 to avoid falling underneath the world.
#### Multiplayer
Multiplayer mode is implemented using plain-old sockets. A simple, ASCII, line-based protocol is used. Each line is made up of a command code and zero or more comma-separated arguments. The client requests chunks from the server with a simple command: C,p,q,key. “C” means “Chunk” and (p, q) identifies the chunk. The key is used for caching - the server will only send block updates that have been performed since the client last asked for that chunk. Block updates (in realtime or as part of a chunk request) are sent to the client in the format: B,p,q,x,y,z,w. After sending all of the blocks for a requested chunk, the server will send an updated cache key in the format: K,p,q,key. The client will store this key and use it the next time it needs to ask for that chunk. Player positions are sent in the format: P,pid,x,y,z,rx,ry. The pid is the player ID and the rx and ry values indicate the players rotation in two different axes. The client interpolates player positions from the past two position updates for smoother animation. The client sends its position to the server at most every 0.1 seconds (less if not moving).
Client-side caching to the sqlite database can be performance intensive when connecting to a server for the first time. For this reason, sqlite writes are performed on a background thread. All writes occur in a transaction for performance. The transaction is committed every 5 seconds as opposed to some logical amount of work completed. A ring / circular buffer is used as a queue for what data is to be written to the database.
In multiplayer mode, players can observe one another in the main view or in a picture-in-picture view. Implementation of the PnP was surprisingly simple - just change the viewport and render the scene again from the other players point of view.
#### Collision Testing
Hit testing (what block the user is pointing at) is implemented by scanning a ray from the players position outward, following their sight vector. This is not a precise method, so the step rate can be made smaller to be more accurate.
Collision testing simply adjusts the players position to remain a certain distance away from any adjacent blocks that are obstacles. (Clouds and plants are not marked as obstacles, so you pass right through them.)
#### Sky Dome
A textured sky dome is used for the sky. The X-coordinate of the texture represents time of day. The Y-values map from the bottom of the sky sphere to the top of the sky sphere. The player is always in the center of the sphere. The fragment shaders for the blocks also sample the sky texture to determine the appropriate fog color to blend with based on the blocks position relative to the backing sky.
#### Ambient Occlusion
Ambient occlusion is implemented as described on this page:
http://0fps.wordpress.com/2013/07/03/ambient-occlusion-for-minecraft-like-worlds/
#### Dependencies
* GLEW is used for managing OpenGL extensions across platforms.