Skip to content

Instantly share code, notes, and snippets.

@TrueBrain
TrueBrain / checklist.md
Last active July 18, 2021 17:39
Checklist for master -> main

Few things happening for each repository:

  • Rename "master" into "main"
  • Cleanup workflows to use the new centralized versions (instead of custom shell-scripts copied everywhere)
  • Enable the "check annotation" step
  • Ensure "default" branch can be anything configured

Repositories left to do:

  • aws
[SDT_OMANY]
var = game_creation.landscape
type = SLE_UINT8
from = SLV_97
guiflags = SGF_MULTISTRING | SGF_NEWGAME_ONLY
def = 0
max = 3
full.LT_TEMPERATE = temperate, 0
full.LT_ARCTIC = arctic, 1, subartic
full.LT_TOPIC = tropic, 2, subtropic
@TrueBrain
TrueBrain / network-debug-levels.md
Created July 11, 2021 10:33
Network debug levels

It now follows very simple rules:

  • 0 - Fatal, user should know about this
  • 1 - Error, but we are recovering
  • 2 - Warning, wrong but okay if you don't know
  • 3 - Info, information you might care about
  • 4 -
  • 5 - Debug #1 - High level debug messages
  • 6 - Debug #2 - Low level debug messages
  • 7 - Trace information
@TrueBrain
TrueBrain / quick-howto-guide.md
Last active July 17, 2021 17:39
Quick how-to guide in setting up development setup for game coordinator

This guide is build for WSL2 / Linux. For Windows it is also possible, but I can never remember Powershell syntax.

The beginning (one-time effort)

Get Python3.8+. Create a venv (for Debian, install python3-virtualenv package first):

python3 -m venv venv
@TrueBrain
TrueBrain / presets.md
Last active April 28, 2024 06:54
Presets

Introduction

If you have played OpenTTD without NewGRFs and GSes for a bit, with the default settings, you get interested in spicing up your game. Currently this requires some pretty good knowledge of all kinds of things:

  • What NewGRFs are good and which work good together?
  • What settings make the game more interested (cargodist) and which should you never touch (inflation)?
  • What GS increases the fun of a game, and in what climate does it work best?

To get answers to these questions is difficult. You need access to any OpenTTD community, and other people need to help you out to piece everything together.

@TrueBrain
TrueBrain / backport-languages.py
Last active January 27, 2023 23:03
Backporting of PRs and language changes
"""
Put this file in a master checkout under .github/.
It should be next to backport.py.
"""
import argparse
import glob
import subprocess
import shlex
@TrueBrain
TrueBrain / readme.md
Last active January 27, 2022 20:42
TrueGRF custom callback language

TrueGRF uses a custom (RPN-based) language.

RPN (See: https://en.wikipedia.org/wiki/Reverse_Polish_notation), also known as postfix language or stack-based language, is used as NewGRFs have a limit subsets of supported operations. RPN best matches NewGRFs while still being a slightly higher language than NFO is.

Integer-based

As NewGRF is integer-based, so is this language. This is not so much a rule of this language, more a consequence of the rule NewGRF created.

@TrueBrain
TrueBrain / truegrf-primary-firs.js
Last active January 5, 2022 18:54
TrueGRF custom industry production
/*
These next variables can be templated in TrueGRF, and are generated (by TrueGRF) different for each industry.
These values are from the FIRS Steeltown Bulk Terminal industry, and are meant as example.
*/
level_requirements = [
{
level: 0,
percent: 100,
},
diff --git a/src/command_func.h b/src/command_func.h
index 861dd480b..7539d6f54 100644
--- a/src/command_func.h
+++ b/src/command_func.h
@@ -382,8 +382,18 @@ protected:
return MakeResult(CMD_ERROR);
}
- /* Test the command. */
DoCommandFlag flags = CommandFlagsToDCFlags(cmd_flags);
@TrueBrain
TrueBrain / roadmap.md
Last active February 18, 2023 19:57
Content Service Roadmap

Step 1

We add a dict classification to each versions entry on BaNaNaS. Depending on the content-type this can have several entries. For example, NewGRF has set-type, palette, resolution, etc. An AI has builds-trains, builds-roadveh, etc.

Each entry has an enum value assigned to it. For set-type this is for example train, air, or landscape. For builds-trains it is yes or no.