Player information window

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

Player information window

by MirceaKitsune » Sat Apr 12, 2014 20:49

Thread for pull #1220.

Formspec window which lists all players active on the server. The name of each player is shown, as well as their ping / lag. Additionally the system supports custom icons, which mods can set per player.

Image

FAQ (please read before asking questions or making requests):

Q - Why was this added in builtin?
A - Because it's intended for the Minetest engine and not for minetest_game, and doing it in Lua is the best and only way. If most developers suggest moving it minetest_game, I will do so... but note that in this case adding a keybind will no longer be possible.

Q - Why didn't you add a keybind to toggle the menu rather than a chat / console command?
A - I'll do that later, or add it to the pause menu if that's a better choice. Wanted to first hear what people think so I don't work for nothing. Currently you bring up the window by typing "/players" in the console. Note that this doesn't work in singleplayer.

Q - What are player icons for and how do they work?
A - Mods can set an icon for each player, which shows left of the player's name in the player list. Scripts can change a player's icon with the playerinfo.set_icon function. Servers / games / mods can either offer a selection of avatars, or use the face of the player skin (making it easier to recognize someone in-world). Player icons are not persisted between server restarts, because that would be both hard and a bad idea. The minetest logo is used when no icon is set.

Q - Does the window auto-update?
A - No, all info is generated when the window is opened. Auto-refresh would be both difficult and the info shown doesn't require it that much.

Q - What happens if there are too many players on the server to fit them all on the list?
A - The default size of the list is 6 x 8, so 48 players can be shown. If there are more than 48, some players will be excluded. If anyone thinks that's unacceptable, feel free to add support for multiple pages, I don't know how to do this myself.

Q - Any thoughts to add more features?
A - I wanted to list more information per player... but there isn't a lot of room for text, and it appears I can only afford two lines. My plan was to show the position of players as well as their distance from self, while clicking a player's name added a waypoint to their location. Such would be very hard to do however, especially if we don't auto-refresh the list and player positions. This could however be used to send private messages to players, by clicking their name to change chat channel.

Q - Minecraft also has a window like this, aren't we copying it too much?
A - NO! >:(
 

User avatar
hoodedice
Member
 
Posts: 1372
Joined: Sat Jul 06, 2013 06:33

by hoodedice » Sat Apr 12, 2014 21:02

Player icons are not persisted between server restarts, because that would be both hard and a bad idea.


Can you explain this a little more?
7:42 PM - Bauglio: I think if you go to staples you could steal firmware from a fax machine that would run better than win10 does on any platform
7:42 PM - Bauglio: so fudge the stable build
7:43 PM - Bauglio: get the staple build
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Sat Apr 12, 2014 21:14

hoodedice wrote:Can you explain this a little more?


They are stored in a local list inside the Lua file, with two functions to get / set them. Storing them permanently makes little sense. First of all because it's difficult... we would probably need to create and maintain a text file in the world folder which might get slow to read / write. But since the Lua API can set them in minetest.register_on_joinplayer, they can maintain their own list and handle this as they see fit.
 

User avatar
Evergreen
Member
 
Posts: 2131
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sat Apr 12, 2014 22:19

sfan wrote something which brings up a player list when the tab key is pressed. Good idea though.
"Help! I searched for a mod but I couldn't find it!"
http://krock-works.16mb.com/MTstuff/modSearch.php
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Sun Apr 13, 2014 02:16

MirceaKitsune wrote:A - I wanted to list more information per player... but there isn't a lot of room for text, and it appears I can only afford two lines. My plan was to show the position of players as well as their distance from self, while clicking a player's name added a waypoint to their location. Such would be very hard to do however, especially if we don't auto-refresh the list and player positions. This could however be used to send private messages to players, by clicking their name to change chat channel

Perhaps you might find the "textlist" type for formspecs of intrest. They're used in mobf and in my markers mod. There, they list all the areas and provide further information if one is clicked on. My traders also use that formspec element (for handling sales/buy limits).

The position of other players might be very intresting in relation to the player itself, spawn and other important areas (i.e. towns). There is a mod that adds a player radar. Perhaps that can be helpful here as well. However, I'd prefer to have a very abstract, server-specific map with abstract symbols for important places and roads (no way to do that automaticly I'm afraid) with all the player positions shown there.

Evergreen wrote:sfan wrote something which brings up a player list when the tab key is pressed. Good idea though

It would be very practical to have such a keybinding.

It's nice to have such an overview now. Not every player may know the /status command, and the output of that one is not as easily digestible as it ought to be. A nice formspec is better :-)
A list of my mods can be found here.
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Sun Apr 13, 2014 09:04

Looks nice, but not so compact. The ping should be shown in milliseconds instead of seconds, it makes much more sense and avoids leading zeros. Use player skin as default icon?
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Sun Apr 13, 2014 10:44

Notice: Tomorrow I'm leaving for a week, spending Easter at grandparents house. I'll have my laptop with me and of course Minetest on it, but might not spend time coding during this time. Changes I make today are possibly the last for a week.

Sokomine wrote:Perhaps you might find the "textlist" type for formspecs of intrest. They're used in mobf and in my markers mod. There, they list all the areas and provide further information if one is clicked on. My traders also use that formspec element (for handling sales/buy limits).

The position of other players might be very intresting in relation to the player itself, spawn and other important areas (i.e. towns). There is a mod that adds a player radar. Perhaps that can be helpful here as well. However, I'd prefer to have a very abstract, server-specific map with abstract symbols for important places and roads (no way to do that automaticly I'm afraid) with all the player positions shown there.


I wasn't aware of this element. When I work on this again I shall attempt using it instead... sounds like the right way to go.

Also, if I can think of a layout which offers enough room, I might add buttons for each player to the right of their name... such as "chat" or "spawn waypoint at last location". I'm actually thinking of having a vertical list only, since the current layout is pretty meh.

Calinou wrote:Looks nice, but not so compact. The ping should be shown in milliseconds instead of seconds, it makes much more sense and avoids leading zeros. Use player skin as default icon?


I wasn't sure what the best value for the ping would be. I'll multiply by 1000 to get miliseconds instead, thanks for the correction.

And I thought about using the player skin instead of an icon. But there's no way to read the texture assigned to the player, without each game / mod providing a function for this purpose. More importantly, using the player texture there would look kinda ugly... why see random bits of clothing and skin intended to be UV-mapped over a mesh? Existing system will allow mods to use the player texture's face as an icon (different texture) making things nicer and easier.
Last edited by MirceaKitsune on Sun Apr 13, 2014 10:45, edited 1 time in total.
 

User avatar
webdesigner97
Member
 
Posts: 1307
Joined: Mon Jul 30, 2012 19:16
GitHub: webD97
IRC: webdesigner97
In-game: webdesigner97

by webdesigner97 » Sun Apr 13, 2014 12:21

Calinou wrote:Looks nice, but not so compact. The ping should be shown in milliseconds instead of seconds, it makes much more sense and avoids leading zeros. Use player skin as default icon?

IMHO, it is compact enough. But I agree with the time units and the icon idea.
 

User avatar
BlockMen
Member
 
Posts: 768
Joined: Fri Mar 01, 2013 17:24
GitHub: BlockMen

by BlockMen » Sun Apr 13, 2014 13:00

webdesigner97 wrote:
Calinou wrote:Looks nice, but not so compact. The ping should be shown in milliseconds instead of seconds, it makes much more sense and avoids leading zeros. Use player skin as default icon?

IMHO, it is compact enough. But I agree with the time units and the icon idea.


If using the player skin as icon, then use just the face part
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Sun Apr 13, 2014 16:18

Updated the layout to use textlist, show player information to the left only for selected player. Player list is only refreshed when re-opening the window, but player information is gathered whenever clicking a player. Let me know what you think of the current design.

Image
Last edited by MirceaKitsune on Sun Apr 13, 2014 16:19, edited 1 time in total.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Sun Apr 13, 2014 16:18

So much white space!

Maybe players could write biographies, or you can allow mods to set multi-line labels.
Last edited by rubenwardy on Sun Apr 13, 2014 16:30, edited 1 time in total.
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Sun Apr 13, 2014 16:21

rubenwardy wrote:So much white space!

Maybe players could write bios, or you can allow mods to set multi-line labels.


Hmmm... descriptions / profiles players can write sounds like an intriguing idea! I'll think about it. Otherwise, I'll consider trying to reduce empty areas.
Last edited by MirceaKitsune on Sun Apr 13, 2014 16:22, edited 1 time in total.
 

User avatar
Calinou
Member
 
Posts: 3124
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou

by Calinou » Sun Apr 13, 2014 16:26

BlockMen wrote:If using the player skin as icon, then use just the face part


Ideally, players would have the ability to upload their own avatars (or admin installs them, like with the player_textures mod), separately from skins.
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Sun Apr 13, 2014 19:57

BlockMen wrote:If using the player skin as icon, then use just the face part

Sounds like an intresting idea. For my traders, I use the texture as such for the buttons to switch texture and as inventory images - which does not look so well. Perhaps it would be possible to apply a mask to the texture so that only the front is shown?
A list of my mods can be found here.
 

User avatar
MirceaKitsune
Member
 
Posts: 809
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune

by MirceaKitsune » Sun Apr 13, 2014 21:28

Allow players to have descriptions apart from just icons (thanks rubenwardy for the idea). Can be used as profiles, class descriptions (PvP servers), status messages, or anything else plus all of these combined (given multi-line support). Also improve the layout: Add a list refresh button, print current / maximum player count, show ping in the player list and colorize entries based on it.

Image

Image
Last edited by MirceaKitsune on Sun Apr 13, 2014 21:28, edited 1 time in total.
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

by Sokomine » Mon Apr 14, 2014 00:07

Status messages sounds fine. If there's a way for players to change these, it might be an easy way of telling other players what a player prefers to do on the server/would like to trade/plans building/...
A list of my mods can be found here.
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 2 guests