Skip to content

Instantly share code, notes, and snippets.

@TrueBrain
TrueBrain / eints-replacement.md
Last active April 4, 2024 20:33
Eints replacement

Motivation

Eints has been written years ago, and it is showing.

  • The interface feels dated, and there are several feature-requests related to it.
  • The codebase is very hard to deal with. It was written in a Python style that is unusual (really too much OO, not much use of Pythonic, more a C++-style of writing, etc).
  • The backend of eints is consuming a lot (500+ MiB) of memory, which costs a lot monthly.

Also, in its core, eints is not all that complex.

@TrueBrain
TrueBrain / legal-entity.md
Last active November 10, 2023 14:48
Signing binaries and getting on Steam
@TrueBrain
TrueBrain / openttd-survey.md
Last active April 26, 2023 09:20
OpenTTD Opt-In Automated Survey

OpenTTD Opt-In Automated Survey

!! THIS DOCUMENT IS IN PROPOSAL STATE !!

There are many ways to play OpenTTD. There are tons of settings, you can load extensions, from AIs to NewGRFs. They all modify how the game plays.

From a developer perspective, we don't actually know what settings are heavily used, and which are never used. As such, we often find ourself in a discussion about whether something is actually useful.

@TrueBrain
TrueBrain / 1-openttd-date-time.md
Last active April 9, 2023 14:00
OpenTTD and date/time

In OpenTTD, we have a few different places that uses the concept of date and time.

  • Windows has several counters. The Window timing is one of the first that was changed to work based on real-time, instead of game-time, but with a twist. The solution for this is created locally in the Window code, by tracking the delta_ms between calls to UpdateWindows. But instead of having the rest of the code change to show things in "real-time" values, the rest of the code still uses "ticks". Just the Window code makes sure that a tick is always MILLISECONDS_PER_TICK, no matter if you fast-forward or not. There are six counter-like things in total:
    • scroller-click: rate-limits how fast you can scroll; not influenced by fast-forward.
  • OnHundredthTick callback: meant to be called every 3 seconds for various of jobs in a Window (like refreshing the list); not influenced by fast-forward.
@TrueBrain
TrueBrain / integration.md
Last active March 26, 2023 14:50
Steam / Discord integration (Rich Presence)

To start with, few things to keep in mind:

  • I am not a lawyer.
  • Neither are you.
  • 1000 people 1000 opinions; this is not so much about opinions, but about facts, options, and risk.
  • I did a morning of searching the web to gather this information, just so we have something to talk about. To bring this a bit more into facts rather than opinions we all have on what GPL is and isn't :D

Problem description

With us going to Steam, the request for Steam integration has increased.

0000 0000
0001 1111 &
---------
0000 0000
000N NNNN
0001 1111 &
---------
000N NNNN
@TrueBrain
TrueBrain / batchmode.md
Last active February 23, 2023 22:31
Command batch in scripts

The GSBatchMode starts a mode, much like GSTestMode and GSExecMode. All commands executed in the scope of a batch are queued to be executed as soon as the batch closes.

If wanted, one can request a promise from the last command queued, so at a later moment the actual value can be retrieved. This is mostly useful for things like building of new stuff, but in many other cases users don't care about the result.

When the batch closes, OpenTTD sends all the commands to the command-queue, in order of creation. It is important to note that our current queue-system is limited, so possibly we need to allow those queues to either be a bit bigger, or to receive batches. The latter can be useful, as that means all multiplayer clients get a single packet with everything in there for the batch.

@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.

@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
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);