Opened 9 years ago

Closed 8 years ago

Last modified 6 years ago

#3263 closed enhancement (fixed)

[PATCH] Objectives / Map & gamesettings info dialog

Reported by: elexis Owned by: elexis
Priority: Must Have Milestone: Alpha 21
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description (last modified by fpre_O_O_O_O_O_O)

A new dialog should be added that displays information about the players and the map settings.

It should be accessible with a button at the top right (near the diplomacy & trade menu buttons) and contain the following information:

Player Info:

  • List of players and observers
  • FPS and ping of players (that is ping from server to client)
  • Connection state of players (to see who is disconnected)
  • Buttons for kicking / banning / muting players (see #3241)
  • Display which players are AI and their difficulty

Map & game settings:

  • Mapname, size & description
  • Population limit
  • Victory condition
  • Starting resources
  • Initial ceasefire time
  • Gamespeed
  • Weather or not cheats, ratings and locked teams are enabled

Besides the kick feature, only the FPS and ping of players data is not known to clients and must be broadcasted by the host. Not sure if the latency can be computed already from the existing packet exchange.

The FPS must be sent from the client to the host before it can broadcast that info. The frames per second value is available in c++ with g_frequencyFilter->StableFrequency(). Often the game is lagging because it waits for a single client to finish the computation of the current turn. By displaying the FPS of all players in that dialog it is possible to find out if there is a client that has way less FPS than other clients and is therefore likely to cause the lag (especially if it is less than 30 fps). If the processing of the current turn is so time consuming that multiple clients are lagging, then this situation can be identified too, so that no one will be accused of being the lagger without a reason.

Attachments (2)

screenshot2.jpg (523.8 KB ) - added by elexis 8 years ago.
updated version
backup_3263-gameinfo-dialog.7z (27.9 KB ) - added by elexis 8 years ago.
Backup of the 27 github commits making up r18692. Deleting the github branch.

Download all attachments as: .zip

Change History (18)

comment:1 by elexis, 9 years ago

The ping / latency / round trip time is already saved and can be found in CNetServerWorker::RunStep() using:

event.peer->roundTripTime

Those values should be saved into a global array in the NetServer.

Since the CSimulationMessage is broadcasted frequently, it could be used to store the RTT as well. However it currently sends only a single command as far as I can see. So maybe broadcasting a new message type every two seconds might be smarter.

comment:2 by historic_bruno, 9 years ago

Indeed I don't think simulation messages are the correct way to implement that, it really only needs to be updated once per turn. See also #69; I would like to have latency listed in game setup, too.

comment:3 by historic_bruno, 9 years ago

Another thing to consider: it may be necessary / more useful to average the ping values, depending on how frequently they are collected, instead of simply storing the last value.

in reply to:  2 comment:4 by elexis, 9 years ago

Replying to historic_bruno:

Indeed I don't think simulation messages are the correct way to implement that, it really only needs to be updated once per turn. See also #69; I would like to have latency listed in game setup, too.

It should be updated more frequently than once per turn, so that you can follow the latency changes even when the game is pausd or lagging. I agree about the ping in the gamesetup. Would be great to kick laggers before starting the game.


Replying to historic_bruno:

Another thing to consider: it may be necessary / more useful to average the ping values, depending on how frequently they are collected, instead of simply storing the last value.

As noted here http://enet.bespin.org/group__peer.html for void enet_peer_ping, it already computes the mean RTT:

    ping requests factor into the mean round trip time as designated by the roundTripTime field in the ENetPeer structure. ENet automatically pings all connected peers at regular intervals, however, this function may be called to ensure more frequent ping requests.

Thanks for the early feedback :D

Last edited 9 years ago by elexis (previous) (diff)

comment:5 by elexis, 9 years ago

I think the player info part shouldn't display the diplomacies nor the civs, but only the buttons (kick / ban / mute) and technical information (online/offline state, FPS, latency, ready state of the NetTurnManager). The diplomacy manager would be really crowded if all of that would be in there. Also all observers should be displayed, so additional rows are required too.

comment:6 by elexis, 8 years ago

Priority: Nice to HaveMust Have

Totally needed as we already started a few games where we didn't know whether we had set the victory condition to conquest or wonder. There are lag-warnings now (#3264), but we also need buttons to kick/ban people (refs ticket somewhere).

comment:7 by elexis, 8 years ago

The network part needs to be done in #3787, so it could be reused in the gamesetup.

comment:8 by elexis, 8 years ago

Here an icon by Lionkanzen: attachment:objetives2.png:ticket:4018

comment:9 by Lionkanzen, 8 years ago

thank you elexis I trying to find this.

comment:10 by elexis, 8 years ago

In 18452:

Cache gameAttributes in the session. Patch by Imarok, refs #3143, #3263.

by elexis, 8 years ago

Attachment: screenshot2.jpg added

updated version

comment:11 by elexis, 8 years ago

Keywords: patch rfc added
Milestone: BacklogAlpha 21
Summary: Map & player info dialog[PATCH] Map & player info dialog

Patch can be found at https://github.com/elexis1/0ad/commits/3263-gameinfo-dialog Notice it also adds some of those strings (those that can't be found in the more-options window) to the gamesetup.

http://trac.wildfiregames.com/raw-attachment/ticket/3263/screenshot2.jpg

comment:12 by bb, 8 years ago

gamedescription.js L11 var --> let L65-115 maybe some ternary's would be more cleaner (don't make everything ternary tough) Translation: Describe a player in a selected game, f.e. ... many of theses duplicate comments, 1 is enough at declaration.

L310-12 could use another tabulation.

menu.js L617-20 open is not really needed. (The check seems redundant too as we close it just before so it should be closed always)

.xml files in top_panel why adding -28 and don't merge it with the number there is already?

Treasures doesn't seem to be added in the objectives. Cheats is only shown when it is enabled, I guess this is wanted. (can agree with it) Same for Revealed and explored map, but it might be nice to add them too when disabled.

in reply to:  12 comment:13 by elexis, 8 years ago

Keywords: review added; rfc removed
Summary: [PATCH] Map & player info dialog[PATCH] Objectives / Map & gamesettings info dialog

Thanks for your comments! I have addressed your remarks in two github commits.

Also improved some styling and fixed minor things. IMO it is complete now and can be committed.

With regards to sanderd17 suggestion to nuke the more options window in the gamesetup -> that should be easy to do once vertical scollbars for parent objects are implemented, but prior we don't have enough screenspace (and I'm not fond at all of introducing multiple gamesetup pages).


Replying to bb:

L11 var --> let

fixed

L65-115 maybe some ternary's would be more cleaner (don't make everything ternary tough) Translation: Describe a player in a selected game, f.e. ... many of theses duplicate comments, 1 is enough at declaration.

Those are translation comments and the python script picks up those and hands them over to transifex. But you might be right that transifex users might be happy with one copy of the comment. Either way, not removing the comments since it would mean to add unneeded translation work (new strings) afaik.

L310-12 could use another tabulation.

The present way highlights that it's an if-else-if block basically

menu.js L617-20 open is not really needed. (The check seems redundant too as we close it just before so it should be closed always)

The purpose of that variable is to keep in mind whether the window was opened previously, thus allowing to actually toggle that window.

why adding -28 and don't merge it with the number there is already?

fixed

Treasures doesn't seem to be added in the objectives.

fixed

Cheats is only shown when it is enabled, I guess this is wanted. (can agree with it) Same for Revealed and explored map, but it might be nice to add them too when disabled.

show 'em all (since late observers might wonder how things were set before the map got revealed on victory f.e.) and it's not obvous that a non-displayed setting means that it's disabled.

comment:14 by elexis, 8 years ago

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 18692:

Objectives dialog. Icon by Lionkanzen. Reviewed by bb, fixes #3263 #4141.

Explain the new victory conditions and last man standing option in the gamesetup.
Add an ingame dialog showing these explanations and all other chosen gamesetup options,
so that players don't have to recall them and late observers don't have to ask.

comment:15 by elexis, 8 years ago

Keywords: review removed

Also thanks to sanderd17, fatherbushido and niektb for some partial reviews.

by elexis, 8 years ago

Backup of the 27 github commits making up r18692. Deleting the github branch.

comment:16 by fpre_O_O_O_O_O_O, 6 years ago

Description: modified (diff)

For all players should also be visible besides being offline that a player has also been kicked or banned.

Note: See TracTickets for help on using tickets.