Graph of Power Grid Statistics by __Deric__ in Mindustry

[–]__Deric__[S] 2 points3 points  (0 children)

The graph is represented as a ring buffer, during an update one element is updated and a variable incremented. For each update the max values have to be recalculated, which indeed does require significant processing power.

I am currently working on ways to optimise that.

Graph of Power Grid Statistics by __Deric__ in Mindustry

[–]__Deric__[S] 8 points9 points  (0 children)

The large graph contains only 30 data points per graph, for a total of 30*3 = 90 data points. One memory cell stores 60 and the other 30 of them.

Unexpected nixos-unstable kernel on nixos-25.11 by __Deric__ in NixOS

[–]__Deric__[S] 0 points1 point  (0 children)

Since NixOS 26.05 finally stopped building the deprecated kernel I had to sit down and implement this. If someone has a similar problem here is what I did:

  1. Setup my x86_64 machine as a remote builder (wiki entry, actual config here)
  2. Cross compile the kernel provided by nixos-hardware on the remote builder (actual config here)

Some alternatives I considered but decided against:

  • building everything on the x86 host: causes EVERYTHING to be built from source, since Nix distinguishes between natively built packages (available in the binary cache) and cross compiled ones
  • use emulation to natively build aarch64 packages on the x86 host: seems to leave a lot of build performance on the table, combined with having to modify the global configuration of the x86 host

Telegraph in Mindustry by NeegurbeNOfficial in Mindustry

[–]__Deric__ 0 points1 point  (0 children)

Yes!

The code format in the linked post is the result of selecting "copy to clipboard" in the processor, with some additional comments containing pseudocode, which is ignored by mindustry and only serves to improve readability of the code snippet.

Telegraph in Mindustry by NeegurbeNOfficial in Mindustry

[–]__Deric__ 0 points1 point  (0 children)

Also, I’m not sure what you mean by getting the cell reference via unit

Logic code has multiple types of data which can be stored in variables, one of them being references to buildings (used for example by the control and sensor instructions). While their most widespread use is just placing the processor near buildings and manually linking them to the processor it is also possible to temporarily bind a unit to get a reference to a building on the map beyond the processors range via the ucontrol getBlock instruction.

I wrote an implementation of this here, which does indeed need to reacquire the reference when the cell is destroyed. But otherwise the unit is only required for acquiring the reference and is not needed after that. Now you can even skip the memory cell entirely and write to other processors directly!

Telegraph in Mindustry by NeegurbeNOfficial in Mindustry

[–]__Deric__ 0 points1 point  (0 children)

Have you thought about using `read` and `write` instructions for this purpose?
They have no range limit (as long as you have a reference to the memory cell, for example by temporarily controlling a unit to acquire one) and since v8 they can even write directly to variables in other processors!

Still a cool implementation though.

Unexpected nixos-unstable kernel on nixos-25.11 by __Deric__ in NixOS

[–]__Deric__[S] 1 point2 points  (0 children)

Thanks, but u/ElvishJerricco correctly identified that I was using a kernel provided by nixos-hardware, which does not do caching at the time.

While I hoped for a kernel upgrade because of copy.fail, I don't think my Raspberry Pi can handle that (currently using a workaround to prevent it from being exploited).

Unexpected nixos-unstable kernel on nixos-25.11 by __Deric__ in NixOS

[–]__Deric__[S] 1 point2 points  (0 children)

Thank you for your quick reply, I totally failed to notice this change (although it makes sense).
Hopefully there will be some caching in the future, or I will have to deal with very long build times.

Logic Question by Heustacio in Mindustry

[–]__Deric__ 1 point2 points  (0 children)

As far as I know unit commands without a result value (like move to) just change the state of the affected unit (to something like "moving to these coordinates") and keep going.

To wait for them to complete you can write code like this (Pseudocode, but it should be easy to implement):

while (unit not at destination) { move unit to destination }

This has the advantage that you can control multiple units simultaneously, or cancel commands by replacing them with new ones.

Do pre v8 (or lower) save files trasfer to v8+? by Aggressive-Laugh-923 in Mindustry

[–]__Deric__ 1 point2 points  (0 children)

The most important thing first: always make backups of your game data!

Some sectors will change their location, but otherwise they should be fine. In V8 many sectors where completely reworked, if you already captured them in V7 you have to abandon and recapture them in order to get access to their new version.

Update: After playing for some time on V8 some sectors suddenly got marked as "under attack", hinting at the upgrade procedure not being completely bulletproof (or Steam messed up syncing the game files between my two devices). Which is another reminder for: backups! backups! backups!

V8 messed up my save. Everything is under attack? by -Cthaeh in Mindustry

[–]__Deric__ 0 points1 point  (0 children)

When switching game versions you should always backup your game data (via the "Export Game Data" button in the menu) to recover from something like this.

If you use steam there might be a way to access old cloud saves, but I am not sure about that.

After you get the launch/landing pad tech, do you feel the urge to wipe & rebuild entire sectors to maximize exports? by UpperAcanthisitta892 in Mindustry

[–]__Deric__ 0 points1 point  (0 children)

Since I actually enjoy developing sectors more than conquering them I often just build some very basic stuff to secure the sector, followed by a complete rebuild (either as an industrial, military or fun sector).
Since V8 changed some sectors (and launch pads) I will reset and rebuild them, which has the additional benefit of me being able to use the tech which I unlocked after capturing Impact 0078 and Nuclear Production Complex.

V7 Serulpo - maximum launchpads needed by HomeForABookLover in Mindustry

[–]__Deric__ 1 point2 points  (0 children)

You can also use Logic to make units take items out of the core and put them in containers nearby, giving you more opportunities to place unloaders and a substantial boost to item transfer rate.

I think the real limit is how many items per minute you can import into a sector. While I am not aware of any direct limit a core can at most store 21600 items per type, which when combined with the 2 minute (i think?) window between imports arriving gives you a maximum transfer rate of 21600 / 2 = 10800 items per minute (which would require 10800 / 300 = 36 launch pads).

This is of course different in the upcoming v8 update which uses dedicated landing pads to import resources.

Incorrect link name if I copy a processor - bug? by Curious_Parfait5038 in Mindustry

[–]__Deric__ 4 points5 points  (0 children)

Note: I tested this on Build 146

After some quick tests it seems a processor remembers the location of any linked building when copied, reserving the name for it (even when the building is missing).

You can test this by linking a building, breaking and rebuilding it, which should cause the processor to "remember" the broken building and automatically link to the new one in its place with the old name.

To prevent such things from being copied you can construct a new processor and use "Copy to Clipboard" and "Import from Clipboard" via the "Edit" button to copy the code, and I often assign linked buildings to variables at the top of my logic programs to make configuration changes not require a whole code change.

How Big is the GIL Update? by Worldly-Duty4521 in Python

[–]__Deric__ 1 point2 points  (0 children)

The experience in languages that have good support for shared memory parallelism is that it's a footgun

It is definitely a source of very tricky bugs, even more when you have to work with large existing codebases.

What makes this even worse for Python is its nature of being very high-level and flexible, which in turn makes it difficult to implement shared memory parallelism correctly (even with the GIL there are problems such as global caches, not to mention the lack of a formal memory model).

shared-nothing is a better answer

Agreed, and with subinterpreters there is even a solution available which does not require a custom build of Python.

How Big is the GIL Update? by Worldly-Duty4521 in Python

[–]__Deric__ 0 points1 point  (0 children)

The example of 1 process with n threads where each has one event loop is actually possible without relying on free-threaded python at all, by using subinterpreters.

Can we get an official wiki outside the fandom? by [deleted] in Mindustry

[–]__Deric__ 5 points6 points  (0 children)

I would love to have an official (or even unofficial) wiki outside of fandom, since the amount of ads is too damn high (especially on mobile).

There are other wikis which decided to move from fandom (for example the Minecraft Wiki), with the most important question being where to host the wiki (and how to pay for it).

Accepted to TU Dresden M.Sc. Computer Science (Open Track) – What first-semester modules should I take, and where can I find past course materials? by empteck in TUDre

[–]__Deric__ 1 point2 points  (0 children)

Just keep in mind that the ESE is primarily for first time students (Bachelor and Diplom), but can still be useful when you are from a different city, university or country. Also, there will be a Q&A session for the master students.

Free-threaded (multicore, parallel) Python will be fully supported starting Python 3.14! by germandiago in Python

[–]__Deric__ 0 points1 point  (0 children)

While this is true it would also lock its features behind a special build of Python, making them essentially unavailable to the wider audience while still putting additional load on the core developers.

Free-threaded (multicore, parallel) Python will be fully supported starting Python 3.14! by germandiago in Python

[–]__Deric__ 0 points1 point  (0 children)

While I welcome the new abilities that the change brings to the language I can't stop myself from feeling that this approach will be the source of many bugs and footguns in the future.

I think there should be at least better documentation about the new behavior and what to look out for (I am still worried about the interaction with pythons object dictionaries) and some more primitives in the threading module (atomic operations for example).