Why is "singleplayer" a special name?

Post Reply
User avatar
Wuzzy
Member
Posts: 4781
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy
Contact:

Why is "singleplayer" a special name?

by Wuzzy » Post

Why am I, the player, forced to have the name "singleplayer" in singleplayer and cannot choose my name freely?
This always bothered me a little that locked chests are owned by "singleplayer", not "Wuzzy".

I wonder if there is a technical reason for that and how realistic it would be to change that.

What I would like is that you can choose your singleplayer name as well.

User avatar
v-rob
Developer
Posts: 969
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: Why is "singleplayer" a special name?

by v-rob » Post

Technically, you kind of can if you use "Host server" but don't announce or allow anyone to connect. Of course, there is a lot of stuff that says singleplayer that is hardcoded into the engine, but I don't know if any of that code really requires the name to be "singleplayer", although some mods might.

(It would be annoying, of course, to change your name in an existing world since you'd be locked out of all your chests then :D)

I don't think singleplayer was actually a thing before 0.4 rolled out, as older versions require you to choose a name regardless of whether it's a server or not.
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

User avatar
Linuxdirk
Member
Posts: 3216
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Why is "singleplayer" a special name?

by Linuxdirk » Post

v-rob wrote:
Thu Sep 16, 2021 20:00
but I don't know if any of that code really requires the name to be "singleplayer", although some mods might.
It’s also the easiest and simplest way for mods to check if it’s a “normal server” or a “singleplayer server”.

User avatar
rubenwardy
Moderator
Posts: 6969
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: Why is "singleplayer" a special name?

by rubenwardy » Post

Linuxdirk wrote:
Fri Sep 17, 2021 18:04
v-rob wrote:
Thu Sep 16, 2021 20:00
but I don't know if any of that code really requires the name to be "singleplayer", although some mods might.
It’s also the easiest and simplest way for mods to check if it’s a “normal server” or a “singleplayer server”.
Well, minetest.is_singleplayer() is simpler - doesn't require a player object or list

I think the reason that singleplayer as a name exists is for UI reasons - we don't have an account system, and using a fixed username saves needing to show a text field
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Linuxdirk
Member
Posts: 3216
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Why is "singleplayer" a special name?

by Linuxdirk » Post

rubenwardy wrote:
Sat Sep 18, 2021 11:55
Well, minetest.is_singleplayer() is simpler - doesn't require a player object or list
The good thing with “singleplayer” is that it’s possible to create a mod that works pretty much independent from server type. Instead of checking for being a singleplayer server on startup and then, only when needed, behave differently. The mod can simply check if the player name is “singleplayer” and then either do nothing special because “singleplayer” is just treated as a regular player on a regular server, or do something different depending on the name.

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: Why is "singleplayer" a special name?

by Desour » Post

If everyone used another name in singleplayer mode, there would be some problems when sharing maps.
Ie. you'd have another position and inventory than the player who gave you the map.
This could probably be circumvented by saving the last singleplayer-name used in the map, so the map receiver can then play as the map creator.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
Linuxdirk
Member
Posts: 3216
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Why is "singleplayer" a special name?

by Linuxdirk » Post

DS-minetest wrote:
Sun Sep 19, 2021 16:32
If everyone used another name in singleplayer mode, there would be some problems when sharing maps.
Ie. you'd have another position and inventory than the player who gave you the map.
Right now this is the case, yes. It could be possible to make singleplayer-servers independent of the player's name. The mentioned minetest.is_singleplayer() could help with this.

User avatar
PolySaken
Member
Posts: 817
Joined: Thu Nov 09, 2017 05:18
GitHub: PolySaken-I-Am
In-game: PolySaken
Location: Wānaka, Aotearoa
Contact:

Re: Why is "singleplayer" a special name?

by PolySaken » Post

I don't see how a name even means anything in singleplayer, as there's no one else to see it and you don't need to see your own name. The real issue is mods yelling "singleplayer" at you, instead of saying "you", etc.

Instead of adding bloat with single player names, change MTG and such to not use the playername and set an example
Guidebook Lib, for in-game docs | Poly Decor, some cool blocks | Vision Lib, an all-purpose library.

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: Why is "singleplayer" a special name?

by twoelk » Post

although the player name is of no importance if you start a singleplayer world, you might change your mind someday and want to use that exact map in some multiplayer setup.
So what we might need would be some mod or command that can reassign some singleplayer owned nodes to the new server god or whatever the new setup needs.

User avatar
Linuxdirk
Member
Posts: 3216
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: Why is "singleplayer" a special name?

by Linuxdirk » Post

twoelk wrote:
Tue Oct 05, 2021 14:54
although the player name is of no importance if you start a singleplayer world, you might change your mind someday and want to use that exact map in some multiplayer setup.
This is why I always start all my worlds in multiplayer mode. Since it’s local there is no difference between a server with fixed name “singleplayer” and no password or a server with a given name and a password.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests