Skip to content

Instantly share code, notes, and snippets.

View MrSmith33's full-sized avatar

Andrey Penechko MrSmith33

View GitHub Profile
@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
@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 / 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 / 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

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 / my_jit.d
Last active February 9, 2017 18:10
Random JIT playground
module main;
import std.stdio;
void main()
{
run_from_rwx();
}
version(Posix)
@MrSmith33
MrSmith33 / bench_result.md
Last active February 22, 2017 12:04
Results of EntityPlus benchmark on my datadriven lib (ECS)
i7-4510U @ 2.00 GHz
Entity Count | Iterations | Probability | EntityPlus | EntityX   |
-----------------------------------------------------------------+
    1 000    | 1 000 000  |    1 in 3   |   1484 ms  |  20959 ms |
   10 000    | 1 000 000  |    1 in 3   |  15916 ms  | 208156 ms |
   30 000    |   100 000  |    1 in 3   |   5092 ms  |  63012 ms |
  100 000    |   100 000  |    1 in 5   |  13946 ms  | 133365 ms |
   10 000    | 1 000 000  |  1 in 1000  |   5334 ms  |  16883 ms |
  100 000    | 1 000 000  |  1 in 1000  |  86312 ms  | 170271 ms |
import std.stdio;
void main()
{
HighLevel h;
writeln(h.fun());
}
struct HighLevel
{
Links:
http://www.sparksandflames.com/files/x86InstructionChart.html
https://defuse.ca/online-x86-assembler.htm Online [dis]assembler
http://wiki.osdev.org/X86-64_Instruction_Encoding
https://www3.nd.edu/~dthain/courses/cse40243/fall2015/intel-intro.html Introduction to X86-64 Assembly for Compiler Writers
http://www.intel.com/products/processor/manuals/ Intel manuals
http://www.x86-64.org/documentation.html amd64 ABI
Vol 1. Chapter 3.4
EAX — Accumulator for operands and results data