Skip to content

Instantly share code, notes, and snippets.

//
// Copyright (c) 2014 James S Urquhart. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
@jamesu
jamesu / main.go
Created October 22, 2021 01:07
Experiment getting gitlab runner to run jobs without gitlab
package main
import (
"fmt"
"net/http"
"log"
"os"
"io/ioutil"
"encoding/json"
b64 "encoding/base64"
@jamesu
jamesu / marble.cpp
Last active November 22, 2020 16:03
marble.cpp
/*
Reverse Engineered MarbleBlast Marble class attempt
TODO: pretty much everything
*/
class MarbleData : public ShapeBaseData
{
private:
typedef ShapeBaseData Parent;
@jamesu
jamesu / decrypt_onverse.rb
Last active February 1, 2019 21:12
Decrypt Onverse script files
# Decrypts and prints a rudimentary decompilation of onverse script files
# Usage: ruby decrypt_onverse.rb in.cs
#
require 'json'
$is_encrypted = true
def decrypt_data(size, data)
if !$is_encrypted
return data
Tribes 1 Model Formats
----------------------
Tribes 1 uses file formats which are similar to file formats used in the Torque Game Engine, with the major difference being more use of tags and versioned objects serialized by class name (working on the same basic principle of class instantiation in torques' console system). Also a lot more emphasis on paletted textures.
Currently this document only covers enough to render .dts, terrain (.dtf,.dtb), and interior (.dig,.dis,.dil) shapes present in Tribes 1. For tribes 2 file formats, your best bet is to check out the earlier torque code.
We'll refer to each field as [type] [name or tag value]. If successive fields need to be at a specific offset indicated by a field, that will be noted with "@nameOffset:" where appropriate. In addition if there is a list of typed data, it will be listed as "type[size]:" followed by the fields of that type.
@jamesu
jamesu / TorqueVisRules.natvis
Created April 3, 2018 16:22
Torque3D vis rules for Visual Studio
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="Vector&lt;*&gt;">
<DisplayString>{{ size={mElementCount} }}</DisplayString>
<Expand>
<Item Name="[size]" ExcludeView="simple">mElementCount</Item>
<Item Name="[capacity]" ExcludeView="simple">mArraySize</Item>
<ArrayItems>
<Size>mElementCount</Size>
<ValuePointer>mArray</ValuePointer>
# Script to generate cryptokitty images using assets from:
# https://github.com/BytesForBites/cryptokitty-designer
# NOTE: requires imagemagick built with --with-librsvg
require 'rubygems'
require 'rmagick'
require 'digest'
class KittyGen
require 'rubygems'
require 'rmagick'
require 'digest'
def build_cat(seed=nil)
srand(Digest::MD5.hexdigest(seed.to_s)[0...6].to_i(16)) if !seed.nil?
# throw the dice for body parts
parts = [
['body', rand(15)+1],
@jamesu
jamesu / torque_net_connection
Created December 5, 2016 23:56
Example connection class for Torque2D/Torque3D network code
// Example connection class for Torque2D/Torque3D network code
class ExampleNetConnection : public NetConnection
{
public:
typedef NetConnection Parent;
static const U32 CurrentProtocolVersion;
static const U32 MinRequiredProtocolVersion;
/// Configuration
#-----------------------------------------------------------------------------
# Test PBMS master client
# ( use with https://github.com/jamesu/PushButton-Master-Server )
#
# Copyright (C) 2016 James S Urquhart.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or