Skip to content

Instantly share code, notes, and snippets.

@highlyunavailable
highlyunavailable / SE_mod_perf.md
Created August 30, 2026 00:13
High-Performance C# for Space Engineers Mods

High-Performance C# for Space Engineers Mods

Writing fast C# inside Space Engineers mod scripts means working with tight constraints: one game thread shared with the whole game world, a frame budget of milliseconds per tick, and a compiler that adds invisible overhead to every method you write.


C# 6 Syntax Constraints

The SE compiler is old. Here are some things to avoid and what to use instead:

@highlyunavailable
highlyunavailable / SEPerf.md
Last active August 29, 2026 23:49
High-Performance C# for Space Engineers Programmable Blocks

High-Performance C# for Space Engineers Programmable Blocks

Writing fast C# inside Space Engineers programmable blocks means working with tight constraints: 50K instructions per tick, one thread shared with the whole game world, and a compiler that adds invisible overhead to almost everything you write.


C# 6 Syntax Constraints

The SE compiler is old. Here are some things to avoid and what to use instead:

public class AimService
{
const double ErrorThreshold = 0.01 / 180.0 * Math.PI;
const double MinVelThreshold = 0.005 / 180.0 * Math.PI;
const double AmpThreshold = 10 / 180.0 * Math.PI;
const double GyroMaxRpm = Math.PI;
// Threshold to determine if we're facing away from a vector dot product.
const double Opposite = -0.99999;
@highlyunavailable
highlyunavailable / RUS Gear.md
Last active January 31, 2026 19:09
RUS Gear

Here's the quick rundown from what I've gathered on the discord + some personal testing: Generally start with the lightest kit you can. If some of the bugs featured here have been fixed, let me know (E.g. side plates not working).

Gear stuff:

  • Weight really matters. Sprint speed/stamina loss is linear based on weight up ~45kg, so the lighter you can make your kit the better. A 25KG vs 35KG kit has a very noticeable difference in stamina loss when sprinting.
  • Empty your medkit (double click it, then right click each item in there to remove it, this is a pain) - this lets you keep a medkit for healing but it's 1kg instead of 3.62.
  • Don't forget a radio and map!
  • I carry 6 bandages, 4 each of morphine/epi, and a single saline. You may want more but I rarely run out and you can always steal bandages off people you kill if you survive.
  • I also always carry a flashlight (helps at night for map reading) and a shovel as well as wirecutters. If you put your wirecutters and flashlight in your shirt it makes them
package main
import (
"io/ioutil"
"log"
"net/http"
"github.com/julienschmidt/httprouter"
"github.com/tylertreat/BoomFilters"
)
string tofromIPpattern = @"((?:\d{1,3}\.){3}\d{1,3})\s*-\s*((?:\d{1,3}\.){3}\d{1,3})";
extern crate toml;
use decode::Decoder;
use message::Message;
use std::error::Error;
#[derive(Default)]
pub struct JsonDecoder {
value: i64,
}
extern crate toml;
use decode::Decoder;
use message::Message;
use std::error::Error;
pub struct JsonDecoder {
_dummy: i32,
}
@highlyunavailable
highlyunavailable / mod_admin_cluster
Created April 6, 2015 17:46
mod_admin_cluster.erl
-module(mod_admin_cluster).
-author('highlyunavailable@gmail.com').
-behaviour(gen_mod).
-export([
join_cluster_as_master/1,
join_cluster/1,
leave_cluster/0,
leave_cluster/1,