Live data from Hacker News

Writing a Minecraft server from scratch in Bash (2022)

sdomi.pl

41–50 of 56 posts

Re: Writing a Minecraft server from scratch in Bash (2022)

#41
post #39

Earlier quoted context omitted.

For Minecraft, very much so. Minecraft, especially the Java version, is in a comparatively odd place in that it receives significant free content updates AND officially supports running any historical version AND has an extremely vibrant modding community. Minecraft (Java) is as much of a game engine for others to build on as it is a game itself.

Minetest is much more of a game engine. I've heard from someone I know that played both extensively that minetest is less prone to losing everything for data corruption (never happened once in minetest, regularly in minecraft after a while. But sample size is 1).

Is that sample size of one from the java edition or bedrock edition of minecraft?

Re: Writing a Minecraft server from scratch in Bash (2022)

#43
post #39

Earlier quoted context omitted.

Minetest is much more of a game engine. I've heard from someone I know that played both extensively that minetest is less prone to losing everything for data corruption (never happened once in minetest, regularly in minecraft after a while. But sample size is 1).

Is that sample size of one from the java edition or bedrock edition of minecraft?

java

Re: Writing a Minecraft server from scratch in Bash (2022)

#45
post #8

A negative power, i.e. 2^(-n) is just 1/(2^n). I'm surprised the author didn't remember that with their own 2^-1 = 0.5 example and eventually reached out to awk for it.

I don't understand how this would help the author. Since the bash doesn't support floating point numbers anyway

This. Also, gawk has netwoki support, so you can write an mc server with just gawk.

Re: Writing a Minecraft server from scratch in Bash (2022)

#46
bash is one of my favorite, as favorite as vim and lua.

a single binary that is less than 2M bytes, universal, way more capable than many people think.

with shellcheck and good habits, bash can be readable and safe as well.

if you want something extra, you can always use C/C++ to add those utilities without using more involved FFI etc, and without pip/npm/etc to load who knows how many dependencies.

Re: Writing a Minecraft server from scratch in Bash (2022)

#47

bash is one of my favorite, as favorite as vim and lua. a single binary that is less than 2M bytes, universal, way more capable than many people think. with shellcheck and good habits, bash can be readable and safe as well. if you want something extra, you can always use C/C++ to add those utilities without using more involved FFI etc, and without pip/npm/etc to load who knows how many dependencies.

> with shellcheck and good habits, bash can be readable and safe as well.

My favorite thing to do with shellcheck: add it to CI. Developers hate this one trick!

A lot of times CI and Dockerfiles have inline bash scripts. My next favorite thing to do is to move all of that inlined bash to their own script files. Now that CI has shellcheck: all that stuff gets checked too! Developers seem to hate this though because it's "less readable". Less readable my ass, it's way more safe.

Next problem: the same bash scripts are now in the same files in multiple repositories (a distributed build). I'm open to ideas for improvements here.

Re: Writing a Minecraft server from scratch in Bash (2022)

#48

bash is one of my favorite, as favorite as vim and lua. a single binary that is less than 2M bytes, universal, way more capable than many people think. with shellcheck and good habits, bash can be readable and safe as well. if you want something extra, you can always use C/C++ to add those utilities without using more involved FFI etc, and without pip/npm/etc to load who knows how many dependencies.

I dislike bash because I'm not good with it. It sucks but is still often the best solution available. Actually, one of my regret was not to invest more time on it when I was a student (a while ago) because it's one of these rare tools that accompanied me my whole career.

Re: Writing a Minecraft server from scratch in Bash (2022)

#49

bash is one of my favorite, as favorite as vim and lua. a single binary that is less than 2M bytes, universal, way more capable than many people think. with shellcheck and good habits, bash can be readable and safe as well. if you want something extra, you can always use C/C++ to add those utilities without using more involved FFI etc, and without pip/npm/etc to load who knows how many dependencies.

I dislike bash because I'm not good with it. It sucks but is still often the best solution available. Actually, one of my regret was not to invest more time on it when I was a student (a while ago) because it's one of these rare tools that accompanied me my whole career.

It's true. The nice thing is that there are many many examples of how to use bash. Just open a script file in random repositories. Most scripts are super SUPER simple. But just copy-paste to shellcheck and it will give some feedback if you're looking to get in some really quick commits and PRs :)

Re: Writing a Minecraft server from scratch in Bash (2022)

#50
post #39

Earlier quoted context omitted.

For Minecraft, very much so. Minecraft, especially the Java version, is in a comparatively odd place in that it receives significant free content updates AND officially supports running any historical version AND has an extremely vibrant modding community. Minecraft (Java) is as much of a game engine for others to build on as it is a game itself.

Minetest is much more of a game engine. I've heard from someone I know that played both extensively that minetest is less prone to losing everything for data corruption (never happened once in minetest, regularly in minecraft after a while. But sample size is 1).

I don't think I've ever witnessed data corruption in Minecraft, and that's even playing since Alpha 1.0.11 and multiple data format migrations... well, my sample size is 1, too.

I've also been on ZFS nearly the whole time. Are you certain Minecraft actually corrupted your data file, or do you suffer underlying hardware failure?

Post reply on HN