Giter Site home page Giter Site logo

cloudxtreme / voxeling Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alanszlosek/voxeling

0.0 0.0 0.0 6.34 MB

Creative mode WebGL voxel game. Runs in Chrome, with multiplayer functionality and very few dependencies

License: MIT License

JavaScript 99.39% Shell 0.02% PHP 0.29% HTML 0.30%

voxeling's Introduction

voxeling

Inspired by voxel-engine and voxel.js, 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:

Past textures provided by:

Player skins from:

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

# start server
./scripts/server.sh

In terminal 2:

cd /path/to/voxeling
# start the client
./scripts/client.sh

Now, point your browser to http://127.0.0.1:9966. Read the introduction for controls and keybindings. Enjoy!

Contributing

See the CONTRIBUTING file

License

MIT License

voxeling's People

Contributors

alanszlosek avatar deathcap avatar

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.