Where is the documentation (if any) for understanding how the game server communicates with the client?

For people working on the C++ code.
Post Reply
kujo
New member
Posts: 1
Joined: Thu Dec 09, 2021 05:47
In-game: kujo

Where is the documentation (if any) for understanding how the game server communicates with the client?

by kujo » Post

I'm trying to get a feel for the quantity of work required to build a version of the game server in Go (mostly to experiment with high-core-count performance). I'm under no allusions about the size of a project and do not actually intend to do this for plenty of reasons. This is mostly a hypothetical thought experiment, unless I'm pleasantly surprised with how easy it would be; though I've cloned the repo and this doesn't seem to be the case. Minetest *is* meant to be modded, though, so I'm holding out a little hope that I could do so.

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Where is the documentation (if any) for understanding how the game server communicates with the client?

by Blockhead » Post

All the docs that matter live in the source repository. In particular minetest/doc/protocol.txt will help you. But in my opinion really there's very little you could do to speed up Minetest when most of the server's workload is written in thread-unsafe Lua code, crossing the boundary between Lua and C++ has its own costs which won't go away when switching to Go, and C++ is just as multi-threadable as Go or any other useful programming language.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: Where is the documentation (if any) for understanding how the game server communicates with the client?

by Desour » Post

See also:
* <https://github.com/minetest/minetest/bl ... entiface.h>
* <https://github.com/minetest/minetest/bl ... nnection.h>
* <https://github.com/minetest/minetest/bl ... protocol.h>

But in the end, you have to RTFS (S for source) to understand everything.

--------------
Blockhead wrote:
Wed Nov 02, 2022 11:36
thread-unsafe Lua
FYI, "thread-unsafe" is the wrong term here. It's not thread-unsafe because it has no threads.
Blockhead wrote:
Wed Nov 02, 2022 11:36
C++ is just as multi-threadable as Go or any other useful programming language.
A language doesn't have to support multithreading to be useful, just take lua as example. >:(
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
snoopy
Member
Posts: 263
Joined: Thu Oct 20, 2016 16:49
Location: DE, European Union

Re: Where is the documentation (if any) for understanding how the game server communicates with the client?

by snoopy » Post

I would suppose to better differentiate and avoid a mixing of concepts. I support DS-minetest's hint here.
DS-minetest wrote:
Wed Nov 02, 2022 17:58
Blockhead wrote:
Wed Nov 02, 2022 11:36
C++ is just as multi-threadable as Go or any other useful programming language.
A language doesn't have to support multithreading to be useful, just take lua as example. >:(
https://en.wikipedia.org/wiki/Thread_(computing) wrote:Threads made an early appearance under the name of "tasks" in OS/360 Multiprogramming with a Variable Number of Tasks (MVT) in 1967. Saltzer (1966) credits Victor A. Vyssotsky with the term "thread".
Obviously, scheduling can be done at the kernel level or user level, and multitasking can be done pre-emptively or cooperatively. This yields a variety of related concepts.

wsor4035
Member
Posts: 182
Joined: Sun Aug 11, 2019 21:23
GitHub: wsor4035
IRC: wsor
In-game: wsor

Re: Where is the documentation (if any) for understanding how the game server communicates with the client?

by wsor4035 » Post

ignoring the fact that writing it in go isnt going to fix anything as blockhead alluded to, see https://github.com/minetest-go for a jump start
j5uBLfc6NxgersvVj5D5dIsiKDkoQb0o

User avatar
snoopy
Member
Posts: 263
Joined: Thu Oct 20, 2016 16:49
Location: DE, European Union

Re: Where is the documentation (if any) for understanding how the game server communicates with the client?

by snoopy » Post

Just may share this information on Lua and thread safety:

a)
https://stackoverflow.com/questions/39226715/is-lua-lru-thread-safe wrote: If module written on C and use e.g. static variables then it may not be thread safe. But pure lua modules which do not use any not thread safe libs are thread safe – moteus - Aug 30, 2016 at 20:17
b)
Subject: Thread Safety in Lua, part 1 - http://lua-users.org/lists/lua-l/2005-08/msg00564.html

And now hopefully back to the original request how the game server communicates with the client?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest