Skip to content

Instantly share code, notes, and snippets.

View MrSmith33's full-sized avatar

Andrey Penechko MrSmith33

View GitHub Profile

Tell me anything about the project you'd like to me to put in the post.

  • when you started Voxelman and why you chose D
  • which of D's features have been a real benefit and how
  • which features (or bugs) have caused you frustration or difficulties and how
  • what your ultimate goals are for the project.

Project history

Now, as the project grew up and my skills matured, my motivation has much less oscilations than at the beginning. I wanted to make a project like this for a couple of years (I beleive since I first played Minecraft Classic). I was thinking of cool things I can do and improve, clever optimization tricks and all the low-level stuff. But never written any real code.

@MrSmith33
MrSmith33 / bytecodeplugin.d
Created November 28, 2016 13:46
bytecode_viz
module bytecodeplugin;
// lib
import std.datetime : MonoTime, Duration, msecs, dur;
import voxelman.log;
import voxelman.math;
import voxelman.geometry.box;
import pluginlib;
// plugins
@MrSmith33
MrSmith33 / walk.d
Last active November 11, 2016 20:47
Physics for voxelman
static struct InputState
{
ivec3 inputs = ivec3(0,0,0);
int boost = 1;
bool jump;
}
InputState gatherInputs()
{
InputState state;
@MrSmith33
MrSmith33 / client.sdl
Created April 19, 2016 18:47
Sdlang-d/libInputVisitor crash
ip "localhost"
port 1234
name "Player"
num_workers 4
resolution 1280 720
max_fps 120
view_distance 4
@MrSmith33
MrSmith33 / gist:c81ae99368751ca432844821077e7123
Created April 7, 2016 22:10
Non-optional dependency dlib of voxelman not found in dependency tree!?
dub build --arch=x86_64 --config=server --vverbose --force
Using dub registry url 'http://code.dlang.org/'
Refreshing local packages (refresh existing: true)...
Looking for local package map at C:\ProgramData\dub\packages\local-packages.json
Looking for local package map at C:\Users\andrey\AppData\Roaming\dub\packages\local-packages.json
iterating dir C:\Users\andrey\AppData\Roaming\dub\packages\
iterating dir C:\Users\andrey\AppData\Roaming\dub\packages\ entry anchovy-0.8.2
Ignoring version specification (~master) for path based dependency ../../
Ignoring version specification (~master) for path based dependency ../../
iterating dir C:\Users\andrey\AppData\Roaming\dub\packages\ entry anchovy-0.8.3
[Version]
version=7.51 Build 020
; environment for both 32/64 bit
[Environment]
DFLAGS="-I%@P%\..\..\src\phobos" "-I%@P%\..\..\src\druntime\import"
; optlink only reads from the Environment section so we need this redundancy
; from the Environment32 section (bugzilla 11302)

WorldAccess wa

Linear access

foreach(index; 0..CHUNK_SIZE_CUBE)
{
	wa.getBlock(index);
}
@MrSmith33
MrSmith33 / api.d
Last active August 29, 2015 14:27
Data driven API
struct Transform {
float x, y, z;
}
struct Velocity {
float x, y, z;
}
enum entityCountMax = 1_000_000;
enum entityCountMin = 100_000;
@MrSmith33
MrSmith33 / main.d
Last active August 29, 2015 14:19
Benchmarking ints vs floats
// x86 release
// 0.000,294 secs byte
// 0.000,237 secs short
// 0.000,282 secs int
// 0.002,368 secs long
// 0.110,046 secs float
// 0.109,296 secs double
// 0.109,388 secs real
//
// x86_64 release