<commit_before>voxeling
====

Inspired by [voxel-engine](https://github.com/maxogden/voxel-engine) and [voxel.js](http://voxeljs.com), this is a multiplayer sandbox (like Minecraft creative mode) implemented in WebGL with very few dependencies. Very much a work in progress.

Demo: https://voxeling.greaterscope.com (Google Chrome and Firefox 46+)

Project blog: https://blog.alanszlosek.com/tags/voxeling/

Preferred texture set:

* http://bdcraft.net/purebdcraft-minetest

Past textures provided by:
* https://github.com/deathcap/ProgrammerArt
* https://github.com/phionabrie

Player skins from:

* https://github.com/maxogden/voxel-client
* https://github.com/deathcap/avatar


Gameplay Features
====

* Multiplayer, with maxogden, substack and viking skins
* Block creation and destruction (batch operations via click-and-drag)
* Jumping and flying
* First-person, over-shoulder, third person camera views (these need some love, though)
* Building materials and material picker dialog
* Gamepad support (80% complete)
* Adjustable draw distance (change it according to your GPU speed and memory)
* World state is saved to files or mysql (install mysql npm module)


What I'm working on
====

* Optimizations, always and forever
* Point light sources and shadow mapping


Technical Features 
====

* Client and Server (ported bits from my voxel-client and voxel-server forks)
* Simple physics engine for player movements
* My own "horizonal merge" meshing algorithm
* Sample world generators
* Websocket connection for chat messages, player positions, world changes
* Chunk data is fetched via AJAX and gzipped
* Object pool to reduce memory allocations and garbage-collection pauses
* voxel-highlight replacement
* Uses hashlru for minimizing trips to the file-system or database for frequently requested chunks
* Relatively flat architecture means it's easy to get a WebGL handle and the inverse camera matrix for drawing
* All IO and chunk meshing is done in a web worker, which keeps the framerate very high
* Directional lighting
* Day and night cycle (still needs some love)

See it in action in the demo (Google Chrome or Firefox): https://voxeling.greaterscope.com

Or follow the installation instructions below to run it locally.


Installation
====

In terminal 1:

```
# git clone the repo into voxeling folder
cd /path/to/voxeling
# Download textures from http://bdcraft.net/purebdcraft-minetest (256x256 version)
# Extract to www/testbdcraft
npm install

# create folder for world chunks
mkdir -p chunks/your-world

# copy the default config and customize
cp config-example.js config.js
vim config.js

# generate web-worker JavaScript
./scripts/worker.sh
<commit_msg>add textures.png generation to readme<commit_after>voxeling
====

Inspired by [voxel-engine](https://github.com/maxogden/voxel-engine) and [voxel.js](http://voxeljs.com), this is a multiplayer sandbox (like Minecraft creative mode) implemented in WebGL with very few dependencies. Very much a work in progress.

Demo: https://voxeling.greaterscope.com (Google Chrome and Firefox 46+)

Project blog: https://blog.alanszlosek.com/tags/voxeling/

Preferred texture set:

* http://bdcraft.net/purebdcraft-minetest

Past textures provided by:
* https://github.com/deathcap/ProgrammerArt
* https://github.com/phionabrie

Player skins from:

* https://github.com/maxogden/voxel-client
* https://github.com/deathcap/avatar


Gameplay Features
====

* Multiplayer, with maxogden, substack and viking skins
* Block creation and destruction (batch operations via click-and-drag)
* Jumping and flying
* First-person, over-shoulder, third person camera views (these need some love, though)
* Building materials and material picker dialog
* Gamepad support (80% complete)
* Adjustable draw distance (change it according to your GPU speed and memory)
* World state is saved to files or mysql (install mysql npm module)


What I'm working on
====

* Optimizations, always and forever
* Point light sources and shadow mapping


Technical Features 
====

* Client and Server (ported bits from my voxel-client and voxel-server forks)
* Simple physics engine for player movements
* My own "horizonal merge" meshing algorithm
* Sample world generators
* Websocket connection for chat messages, player positions, world changes
* Chunk data is fetched via AJAX and gzipped
* Object pool to reduce memory allocations and garbage-collection pauses
* voxel-highlight replacement
* Uses hashlru for minimizing trips to the file-system or database for frequently requested chunks
* Relatively flat architecture means it's easy to get a WebGL handle and the inverse camera matrix for drawing
* All IO and chunk meshing is done in a web worker, which keeps the framerate very high
* Directional lighting
* Day and night cycle (still needs some love)

See it in action in the demo (Google Chrome or Firefox): https://voxeling.greaterscope.com

Or follow the installation instructions below to run it locally.


Installation
====

In terminal 1:

```
# git clone the repo into voxeling folder
cd /path/to/voxeling
# Download textures from http://bdcraft.net/purebdcraft-minetest (256x256 version)
# Extract to www/testbdcraft

# Generate combined texture file (cuts down on WebGL bindTexture calls)
# You'll need PHP with gd/imagemagick. Once I get node version working, you won't need PHP
cd scripts
# This generates www/textures.png and texture-offsets.js
php textures.php

npm install

# create folder for world chunks
mkdir -p chunks/your-world

# copy the default config and customize
cp config-example.js config.js
vim config.js

# generate web-worker JavaScript
./scripts/worker.sh

{'fraction_non_alphanumeric': 0.07659574468085106, 'fraction_numerical': 0.003900709219858156, 'mean_word_length': 4.721095334685598, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '603207', 'n_tokens_mistral': 1659, 'n_tokens_neox': 1555, 'n_words': 670}